Closed Bug 333420 Opened 18 years ago Closed 18 years ago

Can't build with gcj

Categories

(Core Graveyard :: Java to XPCOM Bridge, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: glandium, Assigned: jhpedemonte)

Details

(Keywords: fixed1.8.1)

Attachments

(1 file, 1 obsolete file)

When trying to build with gcj 4.0, I get the following error:

./../nsJavaXPCOMBindingUtils.cpp: In member function 'nsresult NativeToJavaProxyMap::Remove(JNIEnv*, nsISupports*, const nsIID&)':
./../nsJavaXPCOMBindingUtils.cpp:535: error: invalid conversion from '__jobject* const' to '__jweak*'
./../nsJavaXPCOMBindingUtils.cpp:535: error:   initializing argument 1 of 'void _Jv_JNIEnv::DeleteWeakGlobalRef(__jweak*)'
Attached patch patch (obsolete) — Splinter Review
Odd that I don't get this error (or a warning even) on other compilers, since it is clearly going from a const to non-const situation.  Try this patch.
Attachment #218033 - Flags: review?(mh+mozilla)
A bit different with the patch:
./../nsJavaXPCOMBindingUtils.cpp: In member function 'nsresult NativeToJavaProxyMap::Remove(JNIEnv*, nsISupports*, const nsIID&)':
./../nsJavaXPCOMBindingUtils.cpp:535: error: invalid conversion from '__jobject*' to '__jweak*'

(I am not authorized to edit the attachment, though i've been asked review to... bugzilla is... interesting...)
BTW, is there any simple way to test the javaxpcom stuff ? It seems the tests in extensions/java/xpcom/tests don't use the javaxpcomglue and javaxpcom.jar.
Attached patch patch v1.1Splinter Review
Forgot about the static cast;  was only doing const cast.  Give this a shot.
Attachment #218033 - Attachment is obsolete: true
Attachment #218033 - Flags: review?(mh+mozilla)
it builds fine, but i don't know how to test if it works correctly.
Checked in patch to trunk.  Marking as fixed for now, but if you have more problems, reopen the bug.

Also, I updated some of the TestArray and TestJavaProxy tests on the trunk (although TestArray seems to have some issues).  But those should be good enough to tell you if JavaXPCOM is working correctly.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Keywords: fixed1.8.1
I can confirm that the patch works correctly
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.