Before anyone screams about the EOL'ed JDK, I would like to point out that my question is not about how to compile the following. There is a real question here, and it is not that JDK 1.5 is EOL'ed ...
Below in JDK 1.5, to 1.5.0_22 (the last I could find), a compiler error occurs on my system:
private Object[] boozinga() {
boolean b = Math.abs(42) > 0;
Object[] res = new Object[1];
res[0] = b ? new int[1] : new String[1];
return res;
}
Changing Math.abs (42)> 0 to true allows compilation.
Changing the triple "assignment" to if / else allows compilation.
Using JDK 1.6 allows compilation.
So, I was wondering: is there anything illegal in the above code for Java 1.5, and is this allowed in Java 1.6?
Crash for those under Java 1.5 too?
Failure says something like this:
(1.5.0_22). , Java Developer Connection (Http://java.sun.com/webapps/bugreport) . . .
, EOL'ed JDK - , , Java 1.5 .