< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/PoolConstant.java

Print this page




 182             @Override
 183             public int hashCode() {
 184                 return bsmKey.hashCode() +
 185                         staticArgKeys.hashCode();
 186             }
 187 
 188             @Override
 189             public boolean equals(Object obj) {
 190                 if (obj instanceof BsmKey) {
 191                     BsmKey other = (BsmKey)obj;
 192                     return Objects.equals(bsmKey, other.bsmKey) &&
 193                             Objects.equals(staticArgKeys, other.staticArgKeys);
 194                 } else {
 195                     return false;
 196                 }
 197             }
 198         }
 199     }
 200 
 201     /**
 202      * A pool constant implememntation describing a name and type pool entry.
 203      */
 204     final class NameAndType implements PoolConstant {
 205 
 206         final Name name;
 207         final Type type;
 208 
 209         NameAndType(Name name, Type type) {
 210             this.name = name;
 211             this.type = type;
 212         }
 213 
 214         @Override
 215         public int poolTag() {
 216             return ClassFile.CONSTANT_NameandType;
 217         }
 218 
 219         @Override
 220         public Object poolKey(Types types) {
 221             return new Pair<>(name, new UniqueType(type, types));
 222         }


 182             @Override
 183             public int hashCode() {
 184                 return bsmKey.hashCode() +
 185                         staticArgKeys.hashCode();
 186             }
 187 
 188             @Override
 189             public boolean equals(Object obj) {
 190                 if (obj instanceof BsmKey) {
 191                     BsmKey other = (BsmKey)obj;
 192                     return Objects.equals(bsmKey, other.bsmKey) &&
 193                             Objects.equals(staticArgKeys, other.staticArgKeys);
 194                 } else {
 195                     return false;
 196                 }
 197             }
 198         }
 199     }
 200 
 201     /**
 202      * A pool constant implementation describing a name and type pool entry.
 203      */
 204     final class NameAndType implements PoolConstant {
 205 
 206         final Name name;
 207         final Type type;
 208 
 209         NameAndType(Name name, Type type) {
 210             this.name = name;
 211             this.type = type;
 212         }
 213 
 214         @Override
 215         public int poolTag() {
 216             return ClassFile.CONSTANT_NameandType;
 217         }
 218 
 219         @Override
 220         public Object poolKey(Types types) {
 221             return new Pair<>(name, new UniqueType(type, types));
 222         }
< prev index next >