[Bluej-discuss] Codepad Bug?
Davin McCall
davmac at bluej.org
Wed Oct 31 03:14:11 GMT 2007
Hi Brad,
Thanks for reporting this.
If you're interested the internal reason for this problem is that it is
possible to load array classes by name using a classloader in Java 5 and
prior, but apparently not with Java 6. For instance:
this.getClass().getClassLoader().loadClass("[I")
... succeeds with Java 5 but not with 6 (note that "[I" is the Java's
internal name for "int []"). I don't know if this should perhaps be
classified as a Java bug. Anyway, BlueJ fails to load the array class
and as a result misinterprets the type of the declaration. We can work
around it by using Class.forName() internally instead (which still seems
to allow loading array classes); I've implemented this for the next
BlueJ release.
Davin
Brad Richards wrote:
> Hi all,
>
> When running BlueJ 2.2.0 with Java 1.6 on a Windows XP machine, I'm
> not able to create array variables in the codepad. For example:
>
>
>> int[] nums;
>>
> Error: incompatible types - found int but expected int[]
>
>> int[] nums = {1,2,3};
>>
> Error: cannot find symbol - constructor Integer(int[])
>
> I know this used to work. It still *does* work on my Mac, running
> BlueJ 2.2.0 with Java 1.5. (I don't have access to a Windows machine
> with Java 1.5 or I'd try that mix as well.) Is this behavior a
> result of the change in Java versions, or a bug in the codepad? Does
> anyone have a workaround for this?
>
> Thanks,
> Brad
>
> _______________________________________________
> mailing list bluej-discuss at bluej.org
> To unsubscribe or change your preferences, go to
> http://lists.bluej.org/mailman/listinfo/bluej-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.bluej.org/pipermail/bluej-discuss/attachments/20071031/8e6219a9/attachment.html
More information about the bluej-discuss
mailing list