[Bluej-discuss] Codepad Bug?
Ben Kaplan
bskaplan14 at yahoo.com
Sun Oct 28 22:31:01 GMT 2007
More on this problem:
- This has nothing to do with Windows. I get the same problem running Java 1.6 on Ubuntu.
- From what I can see, the codepad attempts to interpret the statement, but is not identifying it as an array. When it tries to create the object to represent the array, it has an error.
- With primitive arrays (which it, for some reason, thinks are primitives), it attempts to use the wrapper class. That is why it has the error about the lack of an Integer(int[]) constructor.
- With objects, it can successfully store the variables, but only if the array is declared and initialized on the same line. However, you'll get a ClassCastException if you try doing anything with the object.
- If you try declaring an array of objects on different lines, you'll get an error because of incompatible types (expected X got X[]).
Just making the array (not in a statement) does still work. You can't declare the array in the code pad, but you can use it if you make it in the code pad and put it on the object bench.
----- Original Message ----
From: Brad Richards <ber at acm.org>
To: General discussion for users of BlueJ <bluej-discuss at bluej.org>
Sent: Saturday, October 27, 2007 3:18:22 PM
Subject: [Bluej-discuss] Codepad Bug?
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
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.bluej.org/pipermail/bluej-discuss/attachments/20071028/b98f8f82/attachment.html
More information about the bluej-discuss
mailing list