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;
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;
- duplicates
-
JDK-8255777 javac is generating duplicates in the class file
-
- Closed
-