Index: codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java,v retrieving revision 1.47 diff -u -r1.47 Engine.java --- codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java 15 Jun 2005 13:08:06 -0000 1.47 +++ codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java 31 Aug 2005 11:31:23 -0000 @@ -316,29 +316,12 @@ } public static char[] getTypeSignature(TypeBinding typeBinding) { - if(typeBinding.isLocalType()) { - LocalTypeBinding localTypeBinding = (LocalTypeBinding)typeBinding; - if(localTypeBinding.isAnonymousType()) { - typeBinding = localTypeBinding.superclass(); - } else { - localTypeBinding.setConstantPoolName(typeBinding.sourceName()); - } - } return typeBinding.signature(); } public static char[] getSignature(Binding binding) { char[] result = null; if ((binding.kind() & Binding.TYPE) != 0) { TypeBinding typeBinding = (TypeBinding)binding; - if(typeBinding.isLocalType()) { - LocalTypeBinding localTypeBinding = (LocalTypeBinding)typeBinding; - if(localTypeBinding.isAnonymousType()) { - typeBinding = localTypeBinding.superclass(); - } else { - // TODO (david) this code is not necessary any longer (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=99686) - localTypeBinding.setConstantPoolName(typeBinding.sourceName()); - } - } result = typeBinding.genericTypeSignature(); } else if ((binding.kind() & Binding.METHOD) != 0) { MethodBinding methodBinding = (MethodBinding)binding; Index: compiler/org/eclipse/jdt/internal/compiler/lookup/LocalTypeBinding.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalTypeBinding.java,v retrieving revision 1.38 diff -u -r1.38 LocalTypeBinding.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/LocalTypeBinding.java 25 Aug 2005 11:13:09 -0000 1.38 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/LocalTypeBinding.java 31 Aug 2005 11:31:24 -0000 @@ -188,7 +188,20 @@ public void setConstantPoolName(char[] computedConstantPoolName) /* java/lang/Object */ { this.constantPoolName = computedConstantPoolName; } - +/* + * Overriden for code assist. In this case, the constantPoolName() has not been computed yet. + * Slam the source name so that the signature is syntactically correct. + * (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=102284) + */ +public char[] signature() { + if (this.signature == null && constantPoolName() == null) { + if (isAnonymousType()) + setConstantPoolName(superclass().sourceName()); + else + setConstantPoolName(sourceName()); + } + return super.signature(); +} public char[] sourceName() { if (isAnonymousType()) { if (superInterfaces == NoSuperInterfaces)