This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: C++ and Java CNI: Check Java references
Mark Mitchell writes:
> >>>>> "Andrew" == Andrew Haley <aph@cambridge.redhat.com> writes:
>
> Andrew> I can see the logic here, but doesn't it amount to a
> Andrew> redesign of CNI?
>
> Maybe -- I'm not by any means a CNI expert.
Yeah, that question was really for the wider audience, especially Per.
>
> Andrew> would become this:
>
> Andrew> jobjectArray java::io::File::performList
> Andrew> (JavaPointer<java::io::FilenameFilter> filter,
> Andrew> JavaPointer<java::io::FileFilter> fileFilter,
> Andrew> JavaPointer<java::lang::Class> result_type)
>
> Right.
>
> Note, too, that you could leave the interface alone and copy the
> parameters to local variables with JavaPointer<...> type, if you
> didn't want to change the interfaces.
>
> Also, of course, you can make the `operator*' not do the check at all
> if you have a system where you can recover from the signal handler.
Yes, I can see why this is so neat.
> This kind of pointer-checking was one of the explicit motivations
> behind operator overloading and member templates in C++; it's
> certainly something that C++ programers are used to doing at
> user-level.
Sure. I guess this would have been good when CNI was designed,
although I don't think we had full template support at that time. I'm
trying to make this work without having to break anything else. :-)
Thanks.
Andrew.