Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6526448

Unecessary checkcast generated

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P5 P5
    • None
    • 6
    • tools
    • None
    • generic
    • generic

      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?

            wtaosunw Wei Tao (Inactive)
            abuckley Alex Buckley
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: