atom feed22 messages in net.java.dev.rococoa.usersBOOL mapping issues
FromSent OnAttachments
Harald KuhrFeb 9, 2010 11:58 am 
Duncan McGregorFeb 9, 2010 12:04 pm 
Harald KuhrFeb 9, 2010 12:27 pm 
Harald KuhrFeb 9, 2010 12:37 pm.java
Duncan McGregorFeb 10, 2010 12:37 am 
Harald KuhrFeb 10, 2010 2:39 am.java
Harald KuhrFeb 17, 2010 7:25 am 
Duncan McGregorFeb 18, 2010 1:56 am 
Andrew ThompsonFeb 18, 2010 6:52 pm 
Harald KuhrFeb 19, 2010 6:49 am 
Harald KuhrFeb 19, 2010 7:23 am 
Harald KuhrFeb 19, 2010 10:37 am 
Harald KuhrFeb 19, 2010 12:13 pm 
Duncan McGregorFeb 19, 2010 2:04 pm 
Harald KuhrFeb 19, 2010 3:06 pm 
Andrew ThompsonFeb 20, 2010 8:02 am 
Harald KuhrFeb 20, 2010 1:12 pm 
Andrew ThompsonFeb 20, 2010 5:22 pm 
Duncan McGregorFeb 21, 2010 2:55 am 
Harald KuhrFeb 21, 2010 8:14 am 
Duncan McGregorFeb 21, 2010 8:40 am 
Duncan McGregorFeb 21, 2010 9:01 am 
Subject:BOOL mapping issues
From:Harald Kuhr (hara@gmail.com)
Date:Feb 9, 2010 11:58:19 am
List:net.java.dev.rococoa.users

Hi guys,

I just came across some very odd mapping behavior... There seems to be a problem
mapping (ObjC) BOOL to (Java) boolean in method parameters.

Given:

@RunOnMainThread public interface NSView extends NSObject { void setHidden(boolean hidden); // What I want. void setHidden(int hidden); // My workaround... boolean isHidden();

// ... }

And the following code snippet:

NSView view;

view.setHidden(false); System.out.println(view.isHidden());

view.setHidden(0); System.out.println(view.isHidden());

view.setHidden(true); System.out.println(view.isHidden());

view.setHidden(1); System.out.println(view.isHidden());

The output is as follows:

false false false true

While the expected would be false, false, true, true... It would be trivial to
convert this code into a failing test case, if anyone's interested.

Has anyone else stumbled across this? Is this a known issue? Am I doing anything
wrong?

Best regards,