Buggy code:
public abstract class Scope implements BaseTypes , CompilerModifiers , ProblemReasons , TagBits , TypeConstants , TypeIds { public static final int BLOCK_SCOPE = 1 ; public static final int CLASS_SCOPE = 3 ; public static final int COMPILATION_UNIT_SCOPE = 4 ; public static final int METHOD_SCOPE = 2 ; public static int compareTypes ( TypeBinding left , TypeBinding right ) { } public static ReferenceBinding [ ] substitute ( Substitution substitution , ReferenceBinding [ ] originalTypes ) { } public static TypeBinding [ ] substitute ( Substitution substitution , TypeBinding [ ] originalTypes ) { } public int kind ; public Scope parent ; protected Scope ( int kind , Scope parent ) { } public int boxing ( int id ) { } public TypeBinding boxing ( TypeBinding type ) { } public final ClassScope classScope ( ) { } public int compareUncheckedException ( ReferenceBinding type ) { } public final CompilationUnitScope compilationUnitScope ( ) { } protected final MethodBinding computeCompatibleMethod ( MethodBinding method , TypeBinding [ ] arguments , InvocationSite invocationSite ) { } protected final MethodBinding computeCompatibleMethod ( MethodBinding method , TypeBinding [ ] arguments , InvocationSite invocationSite , boolean convertVarargs ) { } protected boolean connectTypeVariables ( TypeParameter [ ] typeParameters ) { } public TypeBinding convertToRawType ( TypeBinding type ) { if ( type . isArrayType ( ) ) { TypeBinding leafComponentType = type . leafComponentType ( ) ; if ( leafComponentType . isGenericType ( ) ) return createArrayType ( environment ( ) . createRawType ( ( ( ReferenceBinding ) ( leafComponentType ) ) , null ) , type . dimensions ( ) ) ; } else if ( type . isGenericType ( ) ) { <START_BUG> return environment ( ) . createRawType ( ( ( ReferenceBinding ) ( type ) ) , null ) ; <END_BUG> } return type ; } public ArrayBinding createArrayType ( TypeBinding type , int dimension ) { } public ParameterizedTypeBinding createParameterizedType ( ReferenceBinding genericType , TypeBinding [ ] arguments , ReferenceBinding enclosingType ) { } public TypeVariableBinding [ ] createTypeVariables ( TypeParameter [ ] typeParameters , Binding declaringElement ) { } public boolean detectCycle ( ReferenceBinding superType ) { } public final ClassScope enclosingClassScope ( ) { } public final MethodScope enclosingMethodScope ( ) { } public final SourceTypeBinding enclosingSourceType ( ) { } public final LookupEnvironment environment ( ) { } public MethodBinding findDefaultAbstractMethod ( ReferenceBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite , ReferenceBinding classHierarchyStart , MethodBinding matchingMethod , ObjectVector found ) { } public ReferenceBinding findDirectMemberType ( char [ ] typeName , ReferenceBinding enclosingType ) { } public MethodBinding findExactMethod ( ReferenceBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { } public FieldBinding findField ( TypeBinding receiverType , char [ ] fieldName , InvocationSite invocationSite , boolean needResolve ) { } public ReferenceBinding findMemberType ( char [ ] typeName , ReferenceBinding enclosingType ) { } public MethodBinding findMethod ( ReferenceBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { } public MethodBinding findMethodForArray ( ArrayBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { } public MethodBinding findMethodInSuperInterfaces ( ReferenceBinding currentType , char [ ] selector , ObjectVector found , MethodBinding matchingMethod ) { } public ReferenceBinding findType ( char [ ] typeName , PackageBinding declarationPackage , PackageBinding invocationPackage ) { } public LocalVariableBinding findVariable ( char [ ] variable ) { } public static TypeBinding getBaseType ( char [ ] name ) { } public Binding getBinding ( char [ ] name , int mask , InvocationSite invocationSite , boolean needResolve ) { } public MethodBinding getConstructor ( ReferenceBinding receiverType , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { } public final PackageBinding getCurrentPackage ( ) { } public int getDeclarationModifiers ( ) { } public FieldBinding getField ( TypeBinding receiverType , char [ ] fieldName , InvocationSite invocationSite ) { } public MethodBinding getImplicitMethod ( char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { } public final ReferenceBinding getJavaIoSerializable ( ) { } public final ReferenceBinding getJavaLangAssertionError ( ) { } public final ReferenceBinding getJavaLangClass ( ) { } public final ReferenceBinding getJavaLangCloneable ( ) { } public final ReferenceBinding getJavaLangEnum ( ) { } public final ReferenceBinding getJavaLangError ( ) { } public final ReferenceBinding getJavaLangIterable ( ) { } public final ReferenceBinding getJavaLangObject ( ) { } public final ReferenceBinding getJavaLangRuntimeException ( ) { } public final ReferenceBinding getJavaLangString ( ) { } public final ReferenceBinding getJavaLangThrowable ( ) { } public final ReferenceBinding getJavaUtilIterator ( ) { } public final ReferenceBinding getMemberType ( char [ ] typeName , ReferenceBinding enclosingType ) { } public MethodBinding getMethod ( TypeBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { } public final Binding getPackage ( char [ ] [ ] compoundName ) { } public final TypeBinding getType ( char [ ] name ) { } public final TypeBinding getType ( char [ ] name , PackageBinding packageBinding ) { } public final TypeBinding getType ( char [ ] [ ] compoundName , int typeNameLength ) { } final Binding getTypeOrPackage ( char [ ] name , int mask ) { } public final Binding getTypeOrPackage ( char [ ] [ ] compoundName ) { } public TypeBinding [ ] greaterLowerBound ( TypeBinding [ ] types ) { } public final boolean isDefinedInField ( FieldBinding field ) { } public final boolean isDefinedInMethod ( MethodBinding method ) { } public final boolean isDefinedInSameUnit ( ReferenceBinding type ) { } public final boolean isDefinedInType ( ReferenceBinding type ) { } public boolean isInsideDeprecatedCode ( ) { } private TypeBinding leastContainingInvocation ( TypeBinding mec , List invocations ) { } private TypeBinding leastContainingTypeArgument ( TypeBinding u , TypeBinding v , ReferenceBinding genericType , int rank ) { }

Fix:
return environment ( ) . createRawType ( ( ( ReferenceBinding ) ( type ) ) , type . enclosingType ( ) ) ;