JDK-6246854 : Unnecessary checkcast in generated code
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 6
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • OS: generic,windows_xp
  • CPU: generic,x86
  • Submitted: 2005-03-28
  • Updated: 2014-06-27
  • Resolved: 2014-06-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9Resolved
Related Reports
Duplicate :  
Duplicate :  
Description
$ cat A.java
class A {
    void A(Object o) {
        int[] x = (int[]) o;
    }
}
$ javap -c A
Compiled from "A.java"
class A extends java.lang.Object{
A();
  Code:
   0:   aload_0
   1:   invokespecial   #1; //Method java/lang/Object."<init>":()V
   4:   return
 
void A(java.lang.Object);
  Code:
   0:   aload_1
   1:   checkcast       #2; //class "[I"
   4:   checkcast       #2; //class "[I"
   7:   astore_2
   8:   return
 
}

###@###.### 2005-03-28 20:06:46 GMT

Comments
This issue is harmless but it's solution could be risky. Deferred to 9
25-06-2013