--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassFile.java Fri Dec 14 11:16:46 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassFile.java Sat Dec 15 13:54:51 2012 +0000
@@ -26,6 +26,8 @@
package com.sun.tools.javac.jvm;
import com.sun.tools.javac.code.Type;
+import com.sun.tools.javac.code.Types;
+import com.sun.tools.javac.code.Types.UniqueType;
import com.sun.tools.javac.util.Name;
@@ -166,22 +168,29 @@
*/
public static class NameAndType {
Name name;
- Type type;
+ UniqueType uniqueType;
+ Types types;
- NameAndType(Name name, Type type) {
+ NameAndType(Name name, Type type, Types types) {
this.name = name;
- this.type = type;
+ this.uniqueType = new UniqueType(type, types);
+ this.types = types;
}
- public boolean equals(Object other) {
- return
- other instanceof NameAndType &&
- name == ((NameAndType) other).name &&
- type.equals(((NameAndType) other).type);
+ void setType(Type type) {
+ this.uniqueType = new UniqueType(type, types);
}
+ @Override
+ public boolean equals(Object other) {
+ return (other instanceof NameAndType &&
+ name == ((NameAndType) other).name &&
+ uniqueType.equals(((NameAndType) other).uniqueType));
+ }
+
+ @Override
public int hashCode() {
- return name.hashCode() * type.hashCode();
+ return name.hashCode() * uniqueType.hashCode();
}
}
}