This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: A Boolean inside a subclass of a subclass of Thread is null when accessed from run().




On Thu, 25 Jan 2007, Per Bothner wrote:

Kjetil S. Matheussen wrote:

Your test program works for me.

 The weird thing about this is that the variable "isplaying" is a Boolean
 initialized to false in the class AThread:
 "private Boolean isplaying=true;"

Note you typed Boolean rather than boolean, so it's actually implemented as: private Boolean isplaying=Boolean.valueOf(true);

Thanks! Changing to boolean fixed it. I didn't know about boolean. But I wonder something fishy may be going on anyway? If running kawa interactively, the error dissappears after evaluating (<AThread>) enough times.


I also tried various java implementations (its very easy to switch between java implementation when using gentoo), and:

2)      IBM JDK 1.5.0.3 [ibm-jdk-bin-1.5]
3)      WebLogic JRockit 1.5.0.06 [jrockit-jdk-bin-1.5]
4)      Sun JDK 1.5.0.10 [sun-jdk-1.5]
5)      Sun JDK 1.6.0 [sun-jdk-1.6]

All shows the same result (isplaying==null), while:

1) Blackdown JDK 1.4.2.03 [blackdown-jdk-1.4.2]

didn't compile and gave error about the Boolean/boolean mixup.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]