GNOME Bugzilla – Bug 337282
Type in native function declaration is too conservative
Last modified: 2006-04-30 11:22:03 UTC
Hello, As part of my PhD work, I'm developing a tool to perform multi-lingual type checking. I've run the JNI version of it on several of the java-gnome libraries and have found a few errors. In the file ActionGroup.java, the last parameter to the native function addRadioActions is given the type Object. However, this value is used as a ActionGroup object in the C code (src/jni/org_gnu_gtk_ActionGroup.c, function Java_org_gnu_gtk_ActionGroup_addRadioActions, line 328). Similarly, the last parameter of TreeSelection.startForEach should have the type TreeSelection instead of Object since it is used that way (src/jni/org_gnu_gtk_TreeSelection.c, function Java_org_gnu_gtk_TreeSelection_startForEach, line 55) This isn't an error at the moment, but it could easy introduce one down the line since the Java type checker won't catch any mistakes there. Cheers, -Mike
Mike, Can you verify that this (and the other 10 bugs you filed) are against the latest java-gnome code (either one of the java-gnome 2.14.0 set of libraries, or CVS HEAD)? [Sorry, I know the Bugzilla version field is a bit unhelpful - our "components" are actual released entities, as opposed to most other "products" which are singular released entities. I'll see about fixing the field up] AfC
All of the bugs were detected in the lastest released tarballs (i.e., "gnome 2.14.0"). So in this case, I ran it on libgtk-java 2.8.4 released Mar 29, 2006. Since these were released so recently, I didn't bother checking against CVS. The only exception was gtkhtml which was released over a year ago, and manual inspection of a couple of those bugs in CVS seemed to imply that all of them still exist (since they are all so similar).
That's fine. I just wanted to make sure you hadn't evaluated anything older that java-gnome 2.14.0 code as there were some pretty significant changes down in the JNI layer (notably, generating the JNI header files). I have no reason to disbelieve Mike's reports, but no real facility to evaluate them. Can people with more C experience have a look at the bugs he's filed and mark them NEW (or comment to that effect)? [After all, if this is the result of research work, validating the outputs is a worthy contribution] AfC
Updated CVS head's native methods' parameters. Closing.