Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Fix for javac 9003176: Class reference duplicates in constant pool
diff --git a/src/share/classes/com/sun/tools/javac/jvm/Pool.java b/src/share/classes/com/sun/tools/javac/jvm/Pool.java
--- a/src/share/classes/com/sun/tools/javac/jvm/Pool.java
+++ b/src/share/classes/com/sun/tools/javac/jvm/Pool.java
@@ -28,6 +28,7 @@
import java.util.*;
import com.sun.tools.javac.code.Symbol.*;
+import com.sun.tools.javac.code.Type.ClassType;
/** An internal structure that corresponds to the constant pool of a classfile.
*
@@ -100,6 +101,10 @@
value = new Method((MethodSymbol)value);
else if (value instanceof VarSymbol)
value = new Variable((VarSymbol)value);
+ else if (value instanceof ClassType) {
+ ClassType ct = (ClassType) value;
+ value = ct.tsym;
+ }
// assert !(value instanceof Type.TypeVar);
Integer index = indices.get(value);
if (index == null) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.