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

Javac emits duplicate pool entries on array::clone

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 17
    • 14, 15, 16
    • tools
    • None
    • b04

    Description

      Compiling this program:

      class TestDups {
          void test(Object[] o) {
             o.clone();
             o.clone();
          }
      }

      Leads to duplicate CP entries:

      Constant pool:
         #1 = Methodref #5.#14 // java/lang/Object."<init>":()V
         #2 = Methodref #15.#16 // "[Ljava/lang/Object;".clone:()Ljava/lang/Object;
         #3 = Methodref #17.#16 // "[Ljava/lang/Object;".clone:()Ljava/lang/Object; // <--------------------
         #4 = Class #18 // TestDups
         #5 = Class #19 // java/lang/Object
         #6 = Utf8 <init>
         #7 = Utf8 ()V
         #8 = Utf8 Code
         #9 = Utf8 LineNumberTable
        #10 = Utf8 test
        #11 = Utf8 ([Ljava/lang/Object;)V
        #12 = Utf8 SourceFile
        #13 = Utf8 TestDups.java
        #14 = NameAndType #6:#7 // "<init>":()V
        #15 = Class #20 // "[Ljava/lang/Object;"
        #16 = NameAndType #21:#22 // clone:()Ljava/lang/Object; // <--------------------
        #17 = Class #20 // "[Ljava/lang/Object;"
        #18 = Utf8 TestDups
        #19 = Utf8 java/lang/Object
        #20 = Utf8 [Ljava/lang/Object;
        #21 = Utf8 clone
        #22 = Utf8 ()Ljava/lang/Object;

      Attachments

        Issue Links

          Activity

            People

              vromero Vicente Arturo Romero Zaldivar
              mcimadamore Maurizio Cimadamore
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: