diff --git a/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacBindingResolver.java b/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacBindingResolver.java index c8513d1e7b4..7bb28654462 100644 --- a/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacBindingResolver.java +++ b/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacBindingResolver.java @@ -193,7 +193,7 @@ public JavacPackageBinding getPackageBinding(PackageSymbol packageSymbol) { return null; } // - private Map typeBinding = new HashMap<>(); + private Map typeBinding = new HashMap<>(); public JavacTypeBinding getTypeBinding(JCTree tree, com.sun.tools.javac.code.Type type) { return getTypeBinding(type, tree instanceof JCClassDecl); } @@ -216,29 +216,21 @@ public JavacTypeBinding getTypeBinding(com.sun.tools.javac.code.Type type, boole && !(errorType.getOriginalType() instanceof com.sun.tools.javac.code.Type.ForAll) && !(errorType.getOriginalType() instanceof com.sun.tools.javac.code.Type.ErrorType)) { JavacTypeBinding newInstance = new JavacTypeBinding(errorType.getOriginalType(), type.tsym, isDeclaration, JavacBindingResolver.this) { }; - typeBinding.putIfAbsent(newInstance.getKey(), newInstance); - JavacTypeBinding jcb = typeBinding.get(newInstance.getKey()); + typeBinding.putIfAbsent(newInstance, newInstance); + JavacTypeBinding jcb = typeBinding.get(newInstance); jcb.setRecovered(true); return jcb; } JavacTypeBinding newInstance = new JavacTypeBinding(type, type.tsym, isDeclaration, JavacBindingResolver.this) { }; - String k = newInstance.getKey(); - if( k != null ) { - typeBinding.putIfAbsent(k, newInstance); - return typeBinding.get(k); - } - return null; + typeBinding.putIfAbsent(newInstance, newInstance); + return typeBinding.get(newInstance); } // - private Map typeVariableBindings = new HashMap<>(); + private Map typeVariableBindings = new HashMap<>(); public JavacTypeVariableBinding getTypeVariableBinding(TypeVar typeVar) { JavacTypeVariableBinding newInstance = new JavacTypeVariableBinding(typeVar, (TypeVariableSymbol)typeVar.tsym, JavacBindingResolver.this) { }; - String k = newInstance.getKey(); - if( k != null ) { - typeVariableBindings.putIfAbsent(k, newInstance); - return typeVariableBindings.get(k); - } - return null; + typeVariableBindings.putIfAbsent(newInstance, newInstance); + return typeVariableBindings.get(newInstance); } // private Map variableBindings = new HashMap<>();