After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 337282 - Type in native function declaration is too conservative
Type in native function declaration is too conservative
Status: RESOLVED FIXED
Product: java-gnome
Classification: Bindings
Component: GTK
mainline
Other Linux
: Normal normal
: ---
Assigned To: java-gnome bindings maintainers
java-gnome bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2006-04-04 23:47 UTC by Mike Furr
Modified: 2006-04-30 11:22 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Mike Furr 2006-04-04 23:47:24 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
Comment 1 Andrew Cowie 2006-04-05 12:02:32 UTC
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
Comment 2 Mike Furr 2006-04-05 14:08:14 UTC
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).
Comment 3 Andrew Cowie 2006-04-06 03:51:20 UTC
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
Comment 4 Remy Suen 2006-04-30 11:22:03 UTC
Updated CVS head's native methods' parameters. Closing.