Buggy code:
class DefaultBindingResolver extends BindingResolver { static class BindingTables { Map compilerBindingsToASTBindings ; Map bindingsToAstNodes ; Map bindingKeysToAstNodes ; BindingTables ( ) { } } private static final char [ ] [ ] JAVA_LANG_STRINGBUFFER = new char [ ] [ ] { "java" . toCharArray ( ) , "lang" . toCharArray ( ) , "StringBuffer" . toCharArray ( ) } ; private static final char [ ] [ ] JAVA_LANG_EXCEPTION = new char [ ] [ ] { "java" . toCharArray ( ) , "lang" . toCharArray ( ) , "Exception" . toCharArray ( ) } ; Map newAstToOldAst ; Map astNodesToBlockScope ; DefaultBindingResolver . BindingTables bindingTables ; private CompilationUnitScope scope ; WorkingCopyOwner workingCopyOwner ; DefaultBindingResolver ( ) { } DefaultBindingResolver ( CompilationUnitScope scope , WorkingCopyOwner workingCopyOwner , DefaultBindingResolver . BindingTables bindingTables ) { } synchronized IBinding resolveName ( Name name ) { } synchronized ITypeBinding resolveType ( Type type ) { } synchronized ITypeBinding resolveWellKnownType ( String name ) { } synchronized ITypeBinding resolveType ( TypeDeclaration type ) { } synchronized ITypeBinding resolveTypeParameter ( TypeParameter typeParameter ) { } synchronized IMethodBinding resolveMethod ( MethodDeclaration method ) { } synchronized IMethodBinding resolveMethod ( MethodInvocation method ) { } synchronized IMethodBinding resolveMethod ( SuperMethodInvocation method ) { } synchronized IVariableBinding resolveVariable ( VariableDeclaration variable ) { } synchronized ITypeBinding resolveExpressionType ( Expression expression ) { } synchronized IVariableBinding resolveField ( FieldAccess fieldAccess ) { } synchronized IVariableBinding resolveField ( SuperFieldAccess fieldAccess ) { } synchronized IBinding resolveImport ( ImportDeclaration importDeclaration ) { try { ASTNode node = ( ( ASTNode ) ( this . newAstToOldAst . get ( importDeclaration ) ) ) ; if ( node instanceof ImportReference ) { ImportReference importReference = ( ( ImportReference ) ( node ) ) ; if ( importReference . onDemand ) { Binding binding = this . scope . getImport ( CharOperation . subarray ( importReference . tokens , 0 , importReference . tokens . length ) , true , importReference . isStatic ( ) ) ; if ( binding != null ) { <START_BUG> if ( ( binding . bindingType ( ) ) == ( Binding . PACKAGE ) ) { <END_BUG> IPackageBinding packageBinding = this . getPackageBinding ( ( ( PackageBinding ) ( binding ) ) ) ; if ( packageBinding == null ) { return null ; } return packageBinding ; } else { ITypeBinding typeBinding = this . getTypeBinding ( ( ( TypeBinding ) ( binding ) ) ) ; if ( typeBinding == null ) { return null ; } return typeBinding ; } } } else { Binding binding = this . scope . getImport ( importReference . tokens , false , importReference . isStatic ( ) ) ; if ( ( binding != null ) && ( binding instanceof TypeBinding ) ) { ITypeBinding typeBinding = this . getTypeBinding ( ( ( TypeBinding ) ( binding ) ) ) ; return typeBinding == null ? null : typeBinding ; } } } } catch ( RuntimeException e ) { } return null ; } synchronized IPackageBinding resolvePackage ( PackageDeclaration pkg ) { } synchronized ASTNode findDeclaringNode ( IBinding binding ) { } synchronized ASTNode findDeclaringNode ( String bindingKey ) { } synchronized void store ( ASTNode node , ASTNode oldASTNode ) { } synchronized void updateKey ( ASTNode node , ASTNode newNode ) { } synchronized ITypeBinding getTypeBinding ( TypeBinding referenceBinding ) { } synchronized IPackageBinding getPackageBinding ( PackageBinding packageBinding ) { } synchronized IVariableBinding getVariableBinding ( VariableBinding variableBinding ) { } synchronized IMethodBinding getMethodBinding ( MethodBinding methodBinding ) { } synchronized IMethodBinding resolveConstructor ( ClassInstanceCreation expression ) { } synchronized IMethodBinding resolveConstructor ( ConstructorInvocation expression ) { } synchronized IMethodBinding resolveConstructor ( SuperConstructorInvocation expression ) { } synchronized ITypeBinding resolveType ( AnonymousClassDeclaration type ) { } synchronized ASTNode getCorrespondingNode ( ASTNode currentNode ) { } synchronized void recordScope ( ASTNode astNode , BlockScope blockScope ) { } synchronized IBinding resolveReference ( MemberRef ref ) { } synchronized IBinding resolveReference ( MethodRef ref ) { } }

Fix:
if ( ( ( binding . bindingType ( ) ) & ( Binding . PACKAGE ) ) != 0 ) {