-
Enhancement
-
Resolution: Unresolved
-
P4
-
None
-
None
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
Zero-length arrays are immutable values, therefore, it should be permissible to allow all zero-length arrays to compile with a constant value. For example, the compiler should maintain a single copy of an empty byte array and assign it to both b1, b2.
byte b1[] = new byte[0];
byte b2[] = new byte[0];
if (System.identityHashCode(b1) != System.identityHashCode(b2)) {
System.out.println("Different objects");
}
Zero-length arrays are immutable values, therefore, it should be permissible to allow all zero-length arrays to compile with a constant value. For example, the compiler should maintain a single copy of an empty byte array and assign it to both b1, b2.
byte b1[] = new byte[0];
byte b2[] = new byte[0];
if (System.identityHashCode(b1) != System.identityHashCode(b2)) {
System.out.println("Different objects");
}