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 2 Sep 2005 12:25:44 -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.35.2.1 diff -u -r1.35.2.1 LocalTypeBinding.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/LocalTypeBinding.java 8 Jul 2005 15:43:12 -0000 1.35.2.1 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/LocalTypeBinding.java 2 Sep 2005 12:25:45 -0000 @@ -175,7 +175,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)