Buggy code:
public class CompilationUnitScope extends Scope { public LookupEnvironment environment ; public CompilationUnitDeclaration referenceContext ; public char [ ] [ ] currentPackageName ; public PackageBinding fPackage ; public ImportBinding [ ] imports ; public HashtableOfObject typeOrPackageCache ; public SourceTypeBinding [ ] topLevelTypes ; private CompoundNameVector qualifiedReferences ; private SimpleNameVector simpleNameReferences ; private ObjectVector referencedTypes ; private ObjectVector referencedSuperTypes ; HashtableOfType constantPoolNameUsage ; public CompilationUnitScope ( CompilationUnitDeclaration unit , LookupEnvironment environment ) { } void buildFieldsAndMethods ( ) { } void buildTypeBindings ( AccessRestriction accessRestriction ) { } void checkAndSetImports ( ) { } void checkParameterizedTypeBounds ( ) { } public char [ ] computeConstantPoolName ( LocalTypeBinding localType ) { if ( ( localType . constantPoolName ( ) ) != null ) { return localType . constantPoolName ( ) ; } if ( ( constantPoolNameUsage ) == null ) constantPoolNameUsage = new HashtableOfType ( ) ; ReferenceBinding outerMostEnclosingType = localType . scope . outerMostClassScope ( ) . enclosingSourceType ( ) ; int index = 0 ; char [ ] candidateName ; boolean isCompliant15 = ( compilerOptions ( ) . complianceLevel ) >= ( ClassFileConstants . JDK1_5 ) ; while ( true ) { if ( localType . isMemberType ( ) ) { if ( index == 0 ) { candidateName = CharOperation . concat ( localType . enclosingType ( ) . constantPoolName ( ) , localType . sourceName , '$' ) ; } else { candidateName = CharOperation . concat ( localType . enclosingType ( ) . constantPoolName ( ) , '$' , String . valueOf ( index ) . toCharArray ( ) , '$' , localType . sourceName ) ; } } else if ( localType . isAnonymousType ( ) ) { if ( isCompliant15 ) { candidateName = CharOperation . concat ( localType . enclosingType . constantPoolName ( ) , String . valueOf ( ( index + 1 ) ) . toCharArray ( ) , '$' ) ; } else { candidateName = CharOperation . concat ( outerMostEnclosingType . constantPoolName ( ) , String . valueOf ( ( index + 1 ) ) . toCharArray ( ) , '$' ) ; } } else { if ( isCompliant15 ) { <START_BUG> candidateName = CharOperation . concat ( CharOperation . concat ( outerMostEnclosingType . constantPoolName ( ) , String . valueOf ( ( index + 1 ) ) . toCharArray ( ) , '$' ) , localType . sourceName ) ; <END_BUG> } else { candidateName = CharOperation . concat ( outerMostEnclosingType . constantPoolName ( ) , '$' , String . valueOf ( ( index + 1 ) ) . toCharArray ( ) , '$' , localType . sourceName ) ; } } if ( ( constantPoolNameUsage . get ( candidateName ) ) != null ) { index ++ ; } else { constantPoolNameUsage . put ( candidateName , localType ) ; break ; } } return candidateName ; } void connectTypeHierarchy ( ) { } void faultInImports ( ) { } public void faultInTypes ( ) { } private Binding findImport ( char [ ] [ ] compoundName , int length ) { } private Binding findSingleImport ( char [ ] [ ] compoundName , boolean findStaticImports ) { } private Binding findSingleStaticImport ( char [ ] [ ] compoundName ) { } MethodBinding findStaticMethod ( ReferenceBinding currentType , char [ ] selector ) { } ImportBinding [ ] getDefaultImports ( ) { } public final Binding getImport ( char [ ] [ ] compoundName , boolean onDemand , boolean isStaticImport ) { } public ProblemReporter problemReporter ( ) { } void recordQualifiedReference ( char [ ] [ ] qualifiedName ) { } void recordReference ( char [ ] [ ] qualifiedEnclosingName , char [ ] simpleName ) { } void recordReference ( ReferenceBinding type , char [ ] simpleName ) { } void recordSimpleReference ( char [ ] simpleName ) { } void recordSuperTypeReference ( TypeBinding type ) { } public void recordTypeConversion ( TypeBinding superType , TypeBinding subType ) { } void recordTypeReference ( TypeBinding type ) { } void recordTypeReferences ( TypeBinding [ ] types ) { } Binding resolveSingleImport ( ImportBinding importBinding ) { } public void storeDependencyInfo ( ) { } public String toString ( ) { } private ReferenceBinding typeToRecord ( TypeBinding type ) { } public void verifyMethods ( MethodVerifier verifier ) { } }

Fix:
candidateName = CharOperation . concat ( CharOperation . concat ( localType . enclosingType ( ) . constantPoolName ( ) , String . valueOf ( ( index + 1 ) ) . toCharArray ( ) , '$' ) , localType . sourceName ) ;