Buggy code:
public class LookupEnvironment implements ProblemReasons , TypeConstants { static final int BUILD_FIELDS_AND_METHODS = 4 ; static final int BUILD_TYPE_HIERARCHY = 1 ; static final int CHECK_AND_SET_IMPORTS = 2 ; static final int CONNECT_TYPE_HIERARCHY = 3 ; static final ProblemPackageBinding TheNotFoundPackage = new ProblemPackageBinding ( CharOperation . NO_CHAR , ProblemReasons . NotFound ) ; static final ProblemReferenceBinding TheNotFoundType = new ProblemReferenceBinding ( CharOperation . NO_CHAR , null , ProblemReasons . NotFound ) ; private Map accessRestrictions ; ImportBinding [ ] defaultImports ; PackageBinding defaultPackage ; HashtableOfPackage knownPackages ; private int lastCompletedUnitIndex = - 1 ; private int lastUnitIndex = - 1 ; public INameEnvironment nameEnvironment ; public CompilerOptions globalOptions ; public ProblemReporter problemReporter ; public ClassFilePool classFilePool ; private int stepCompleted ; public ITypeRequestor typeRequestor ; private ArrayBinding [ ] [ ] uniqueArrayBindings ; private SimpleLookupTable uniqueParameterizedTypeBindings ; private SimpleLookupTable uniqueRawTypeBindings ; private SimpleLookupTable uniqueWildcardBindings ; private SimpleLookupTable uniqueParameterizedGenericMethodBindings ; public CompilationUnitDeclaration unitBeingCompleted = null ; public Object missingClassFileLocation = null ; private CompilationUnitDeclaration [ ] units = new CompilationUnitDeclaration [ 4 ] ; private MethodVerifier verifier ; public LookupEnvironment ( ITypeRequestor typeRequestor , CompilerOptions globalOptions , ProblemReporter problemReporter , INameEnvironment nameEnvironment ) { } public ReferenceBinding askForType ( char [ ] [ ] compoundName ) { } ReferenceBinding askForType ( PackageBinding packageBinding , char [ ] name ) { } public void buildTypeBindings ( CompilationUnitDeclaration unit , AccessRestriction accessRestriction ) { } public BinaryTypeBinding cacheBinaryType ( IBinaryType binaryType , AccessRestriction accessRestriction ) { } public BinaryTypeBinding cacheBinaryType ( IBinaryType binaryType , boolean needFieldsAndMethods , AccessRestriction accessRestriction ) { } public BinaryTypeBinding cacheMissingBinaryType ( char [ ] [ ] compoundName , CompilationUnitDeclaration unit ) { } public void completeTypeBindings ( ) { } public void completeTypeBindings ( CompilationUnitDeclaration parsedUnit ) { } public void completeTypeBindings ( CompilationUnitDeclaration parsedUnit , boolean buildFieldsAndMethods ) { } public TypeBinding computeBoxingType ( TypeBinding type ) { } private PackageBinding computePackageFrom ( char [ ] [ ] constantPoolName ) { } public ReferenceBinding convertToParameterizedType ( ReferenceBinding originalType ) { } public TypeBinding convertToRawType ( TypeBinding type ) { } public TypeBinding convertUnresolvedBinaryToRawType ( TypeBinding type ) { } public ArrayBinding createArrayType ( TypeBinding leafComponentType , int dimensionCount ) { if ( leafComponentType instanceof LocalTypeBinding ) <START_BUG> return ( ( LocalTypeBinding ) ( leafComponentType ) ) . createArrayType ( dimensionCount ) ; <END_BUG> int dimIndex = dimensionCount - 1 ; int length = uniqueArrayBindings . length ; ArrayBinding [ ] arrayBindings ; if ( dimIndex < length ) { if ( ( arrayBindings = uniqueArrayBindings [ dimIndex ] ) == null ) uniqueArrayBindings [ dimIndex ] = arrayBindings = new ArrayBinding [ 10 ] ; } else { System . arraycopy ( uniqueArrayBindings , 0 , ( uniqueArrayBindings = new ArrayBinding [ dimensionCount ] [ ] ) , 0 , length ) ; uniqueArrayBindings [ dimIndex ] = arrayBindings = new ArrayBinding [ 10 ] ; } int index = - 1 ; length = arrayBindings . length ; while ( ( ++ index ) < length ) { ArrayBinding currentBinding = arrayBindings [ index ] ; if ( currentBinding == null ) return arrayBindings [ index ] = new ArrayBinding ( leafComponentType , dimensionCount , this ) ; if ( ( currentBinding . leafComponentType ) == leafComponentType ) return currentBinding ; } System . arraycopy ( arrayBindings , 0 , ( arrayBindings = new ArrayBinding [ length * 2 ] ) , 0 , length ) ; uniqueArrayBindings [ dimIndex ] = arrayBindings ; return arrayBindings [ length ] = new ArrayBinding ( leafComponentType , dimensionCount , this ) ; } public BinaryTypeBinding createBinaryTypeFrom ( IBinaryType binaryType , PackageBinding packageBinding , AccessRestriction accessRestriction ) { } public BinaryTypeBinding createBinaryTypeFrom ( IBinaryType binaryType , PackageBinding packageBinding , boolean needFieldsAndMethods , AccessRestriction accessRestriction ) { } PackageBinding createPackage ( char [ ] [ ] compoundName ) { } public ParameterizedGenericMethodBinding createParameterizedGenericMethod ( MethodBinding genericMethod , RawTypeBinding rawType ) { } public ParameterizedGenericMethodBinding createParameterizedGenericMethod ( MethodBinding genericMethod , TypeBinding [ ] typeArguments ) { } public ParameterizedTypeBinding createParameterizedType ( ReferenceBinding genericType , TypeBinding [ ] typeArguments , ReferenceBinding enclosingType ) { } public RawTypeBinding createRawType ( ReferenceBinding genericType , ReferenceBinding enclosingType ) { } public WildcardBinding createWildcard ( ReferenceBinding genericType , int rank , TypeBinding bound , TypeBinding [ ] otherBounds , int boundKind ) { } public AccessRestriction getAccessRestriction ( TypeBinding type ) { } public ReferenceBinding getCachedType ( char [ ] [ ] compoundName ) { } PackageBinding getPackage0 ( char [ ] name ) { } public ReferenceBinding getResolvedType ( char [ ] [ ] compoundName , Scope scope ) { } PackageBinding getTopLevelPackage ( char [ ] name ) { } public ReferenceBinding getType ( char [ ] [ ] compoundName ) { } private TypeBinding [ ] getTypeArgumentsFromSignature ( SignatureWrapper wrapper , TypeVariableBinding [ ] staticVariables , ReferenceBinding enclosingType , ReferenceBinding genericType ) { } ReferenceBinding getTypeFromCompoundName ( char [ ] [ ] compoundName , boolean isParameterized ) { } ReferenceBinding getTypeFromConstantPoolName ( char [ ] signature , int start , int end , boolean isParameterized ) { } TypeBinding getTypeFromSignature ( char [ ] signature , int start , int end , boolean isParameterized , TypeBinding enclosingType ) { } TypeBinding getTypeFromTypeSignature ( SignatureWrapper wrapper , TypeVariableBinding [ ] staticVariables , ReferenceBinding enclosingType ) { } TypeBinding getTypeFromVariantTypeSignature ( SignatureWrapper wrapper , TypeVariableBinding [ ] staticVariables , ReferenceBinding enclosingType , ReferenceBinding genericType , int rank ) { } boolean isPackage ( char [ ] [ ] compoundName , char [ ] name ) { } public MethodVerifier methodVerifier ( ) { } public void reset ( ) { } public void setAccessRestriction ( ReferenceBinding type , AccessRestriction accessRestriction ) { } void updateCaches ( UnresolvedReferenceBinding unresolvedType , ReferenceBinding resolvedType ) { } }

Fix:
return ( ( LocalTypeBinding ) ( leafComponentType ) ) . createArrayType ( dimensionCount , this ) ;