Buggy code:
public static IJavaElement getProjectOrJar ( IJavaElement element ) { } public static boolean isPolymorphicSearch ( InternalSearchPattern pattern ) { } public static IJavaElement projectOrJarFocus ( InternalSearchPattern pattern ) { } public MatchLocator ( SearchPattern pattern , SearchRequestor requestor , IJavaSearchScope scope , IProgressMonitor progressMonitor ) { } public void accept ( IBinaryType binaryType , PackageBinding packageBinding , AccessRestriction accessRestriction ) { } public void accept ( org . eclipse . jdt . internal . compiler . env . ICompilationUnit sourceUnit , AccessRestriction accessRestriction ) { } public void accept ( ISourceType [ ] sourceTypes , PackageBinding packageBinding , AccessRestriction accessRestriction ) { } protected Parser basicParser ( ) { } protected BinaryTypeBinding cacheBinaryType ( IType type , IBinaryType binaryType ) throws JavaModelException { } protected char [ ] [ ] [ ] computeSuperTypeNames ( IType focusType ) { } protected IJavaElement createHandle ( AbstractMethodDeclaration method , IJavaElement parent ) { } IMethod createBinaryMethodHandle ( IType type , char [ ] methodSelector , char [ ] [ ] argumentTypeNames , MatchLocator locator ) { } private IJavaElement createMethodHandle ( IType type , String methodName , String [ ] parameterTypeSignatures ) { } protected IJavaElement createHandle ( FieldDeclaration fieldDeclaration , TypeDeclaration typeDeclaration , IJavaElement parent ) { } protected IJavaElement createHandle ( AbstractVariableDeclaration variableDeclaration , IJavaElement parent ) { } protected boolean createHierarchyResolver ( IType focusType , PossibleMatch [ ] possibleMatches ) { } protected IJavaElement createImportHandle ( ImportReference importRef ) { } protected IJavaElement createPackageDeclarationHandle ( CompilationUnitDeclaration unit ) { } protected IType createTypeHandle ( String simpleTypeName ) { } protected boolean encloses ( IJavaElement element ) { } private long findLastTypeArgumentInfo ( TypeReference typeRef ) { } protected IBinaryType getBinaryInfo ( ClassFile classFile , IResource resource ) throws CoreException { } protected IType getFocusType ( ) { } protected void getMethodBodies ( CompilationUnitDeclaration unit , MatchingNodeSet nodeSet ) { } protected TypeBinding getType ( Object typeKey , char [ ] typeName ) { } public MethodBinding getMethodBinding ( MethodPattern methodPattern ) { } protected boolean hasAlreadyDefinedType ( CompilationUnitDeclaration parsedUnit ) { } public void initialize ( JavaProject project , int possibleMatchSize ) throws JavaModelException { } protected void locateMatches ( JavaProject javaProject , PossibleMatch [ ] possibleMatches , int start , int length ) throws CoreException { } protected void locateMatches ( JavaProject javaProject , PossibleMatchSet matchSet , int expected ) throws CoreException { } public void locateMatches ( SearchDocument [ ] searchDocuments ) throws CoreException { } public void locatePackageDeclarations ( SearchParticipant participant ) throws CoreException { } protected void locatePackageDeclarations ( SearchPattern searchPattern , SearchParticipant participant ) throws CoreException { } protected IType lookupType ( ReferenceBinding typeBinding ) { if ( typeBinding == null ) return null ; char [ ] packageName = typeBinding . qualifiedPackageName ( ) ; IPackageFragment [ ] pkgs = this . nameLookup . findPackageFragments ( ( ( packageName == null ) || ( ( packageName . length ) == 0 ) ? IPackageFragment . DEFAULT_PACKAGE_NAME : new String ( packageName ) ) , false ) ; char [ ] sourceName = typeBinding . qualifiedSourceName ( ) ; String typeName = new String ( sourceName ) ; int acceptFlag = 0 ; if ( typeBinding . isAnnotationType ( ) ) { acceptFlag = NameLookup . ACCEPT_ANNOTATIONS ; } else if ( typeBinding . isEnum ( ) ) { acceptFlag = NameLookup . ACCEPT_ENUMS ; } else if ( typeBinding . isInterface ( ) ) { acceptFlag = NameLookup . ACCEPT_INTERFACES ; } else if ( typeBinding . isClass ( ) ) { acceptFlag = NameLookup . ACCEPT_CLASSES ; } for ( int i = 0 , length = ( pkgs == null ) ? 0 : pkgs . length ; i < length ; i ++ ) { <START_BUG> IType type = this . nameLookup . findType ( typeName , pkgs [ i ] , false , acceptFlag ) ; <END_BUG> if ( type != null ) return type ; } char [ ] [ ] qualifiedName = CharOperation . splitOn ( '.' , sourceName ) ; int length = qualifiedName . length ; if ( length == 0 ) return null ; IType type = createTypeHandle ( new String ( qualifiedName [ 0 ] ) ) ; if ( type == null ) return null ; for ( int i = 1 ; i < length ; i ++ ) { type = type . getType ( new String ( qualifiedName [ i ] ) ) ; if ( type == null ) return null ; } if ( type . exists ( ) ) return type ; return null ; } public SearchMatch newDeclarationMatch ( IJavaElement element , Binding binding , int accuracy , int offset , int length ) { } public SearchMatch newDeclarationMatch ( IJavaElement element , Binding binding , int accuracy , int offset , int length , SearchParticipant participant , IResource resource ) { } public SearchMatch newFieldReferenceMatch ( IJavaElement enclosingElement , Binding enclosingBinding , int accuracy , int offset , int length , ASTNode reference ) { } public SearchMatch newLocalVariableReferenceMatch ( IJavaElement enclosingElement , int accuracy , int offset , int length , ASTNode reference ) { } public SearchMatch newMethodReferenceMatch ( IJavaElement enclosingElement , Binding enclosingBinding , int accuracy , int offset , int length , boolean isConstructor , boolean isSynthetic , ASTNode reference ) { } public SearchMatch newPackageReferenceMatch ( IJavaElement enclosingElement , int accuracy , int offset , int length , ASTNode reference ) { } public SearchMatch newTypeParameterReferenceMatch ( IJavaElement enclosingElement , int accuracy , int offset , int length , ASTNode reference ) { } public TypeReferenceMatch newTypeReferenceMatch ( IJavaElement enclosingElement , Binding enclosingBinding , int accuracy , int offset , int length , ASTNode reference ) { } public TypeReferenceMatch newTypeReferenceMatch ( IJavaElement enclosingElement , Binding enclosingBinding , int accuracy , ASTNode reference ) { } protected boolean parseAndBuildBindings ( PossibleMatch possibleMatch , boolean mustResolve ) throws CoreException { }

Fix:
IType type = this . nameLookup . findType ( typeName , pkgs [ i ] , false , acceptFlag , true ) ;