-
Bug
-
Resolution: Fixed
-
P4
-
8
-
b08
-
Verified
In the case of this class:
public class Test {
void m1(byte[] b) {}
void m2() {
Object o;
m1((byte[])(o = null));
}
}
javac generates this code for m2:
void m2();
descriptor: ()V
flags:
Code:
stack=3, locals=2, args_size=1
0: aload_0
1: aconst_null
2: dup
3: astore_1
4: checkcast #2 // class "[B"
7: checkcast #2 // class "[B"
10: invokevirtual #3 // Method m1:([B)V
13: return
LineNumberTable:
line 6: 0
line 7: 13
The second checkcast is unnecessary.
public class Test {
void m1(byte[] b) {}
void m2() {
Object o;
m1((byte[])(o = null));
}
}
javac generates this code for m2:
void m2();
descriptor: ()V
flags:
Code:
stack=3, locals=2, args_size=1
0: aload_0
1: aconst_null
2: dup
3: astore_1
4: checkcast #2 // class "[B"
7: checkcast #2 // class "[B"
10: invokevirtual #3 // Method m1:([B)V
13: return
LineNumberTable:
line 6: 0
line 7: 13
The second checkcast is unnecessary.
- relates to
-
JDK-7053059 VerifyError with double Assignment using a Generic Member of a Superclass
-
- Closed
-