JDK1.6 (final) compiles:
Serializable zz = null;
String[] ss = (String[])zz;
to:
201: aconst_null
202: astore 16
204: aload 16
206: checkcast #54; //class "[Ljava/lang/String;"
209: checkcast #54; //class "[Ljava/lang/String;"
212: astore 17
Why the double checkcast?
Serializable zz = null;
String[] ss = (String[])zz;
to:
201: aconst_null
202: astore 16
204: aload 16
206: checkcast #54; //class "[Ljava/lang/String;"
209: checkcast #54; //class "[Ljava/lang/String;"
212: astore 17
Why the double checkcast?
- duplicates
-
JDK-6246854 Unnecessary checkcast in generated code
- Closed