You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only the zero-th position of the array is initialized. The first one is not, as JVM's newarray specification specifies the following: Each of the elements of the new array is initialized to the default initial value (§2.3, §2.4) for the element type of the array type.
[Taken from: http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-6.html#jvms-6.5.newarray]
So, there is no need to initialize numbers[1] explicitly in the JVM code. However, Muggl initializes numbers[1] to null. As a consequence, null is returned in a method that should return an int. This generates the following test case, which is ill-typed:
Given the following Java method (can be found in IntegerDivision: 9fe4389 ):
The javac compiler (openjdk: javac 1.6.0_24) generates the following bytecode:
Only the zero-th position of the array is initialized. The first one is not, as JVM's
newarray
specification specifies the following: Each of the elements of the new array is initialized to the default initial value (§2.3, §2.4) for the element type of the array type.[Taken from: http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-6.html#jvms-6.5.newarray]
So, there is no need to initialize numbers[1] explicitly in the JVM code. However, Muggl initializes numbers[1] to null. As a consequence, null is returned in a method that should return an int. This generates the following test case, which is ill-typed:
The text was updated successfully, but these errors were encountered: