Buggy code:
public class TypeReferencePattern extends MultipleSearchPattern { private char [ ] qualification ; private char [ ] simpleName ; private char [ ] decodedQualification ; private char [ ] decodedSimpleName ; private static char [ ] [ ] TAGS = new char [ ] [ ] { TYPE_REF , SUPER_REF , REF , CONSTRUCTOR_REF } ; private static char [ ] [ ] REF_TAGS = new char [ ] [ ] { REF } ; private char [ ] [ ] segments ; private int currentSegment ; private char [ ] decodedSegment ; public TypeReferencePattern ( char [ ] qualification , char [ ] simpleName , int matchMode , boolean isCaseSensitive ) { } public void decodeIndexEntry ( IEntryResult entryResult ) { } public void feedIndexRequestor ( IIndexSearchRequestor requestor , int detailLevel , int [ ] references , IndexInput input , IJavaSearchScope scope ) throws IOException { } protected char [ ] [ ] getPossibleTags ( ) { } protected boolean hasNextQuery ( ) { } public char [ ] indexEntryPrefix ( ) { } protected int matchContainer ( ) { } protected boolean matchIndexEntry ( ) { } protected void matchReportReference ( AstNode reference , IJavaElement element , int accuracy , MatchLocator locator ) throws CoreException { } private void matchReportReference ( ArrayTypeReference arrayRef , IJavaElement element , int accuracy , MatchLocator locator ) throws CoreException { } private void matchReportReference ( QualifiedNameReference nameRef , IJavaElement element , int accuracy , MatchLocator locator ) throws CoreException { } private void matchReportReference ( QualifiedTypeReference typeRef , IJavaElement element , int accuracy , MatchLocator locator ) throws CoreException { } protected void resetQuery ( ) { } public String toString ( ) { } public int matchLevel ( AstNode node , boolean resolve ) { } private int matchLevel ( ImportReference importRef , boolean resolve ) { } private int matchLevel ( NameReference nameRef , boolean resolve ) { if ( ! resolve ) { if ( ( this . simpleName ) == null ) { return POSSIBLE_MATCH ; } else { if ( nameRef instanceof SingleNameReference ) { if ( this . matchesName ( this . simpleName , ( ( SingleNameReference ) ( nameRef ) ) . token ) ) { return POSSIBLE_MATCH ; } else { return IMPOSSIBLE_MATCH ; } } else { char [ ] [ ] tokens = ( ( QualifiedNameReference ) ( nameRef ) ) . tokens ; for ( int i = 0 , max = tokens . length ; i < max ; i ++ ) { if ( this . matchesName ( this . simpleName , tokens [ i ] ) ) return POSSIBLE_MATCH ; } return IMPOSSIBLE_MATCH ; } } } else { Binding binding = nameRef . binding ; if ( binding == null ) { return INACCURATE_MATCH ; } else { if ( nameRef instanceof SingleNameReference ) { if ( binding instanceof TypeBinding ) { return this . matchLevelForType ( this . simpleName , this . qualification , ( ( TypeBinding ) ( binding ) ) ) ; } else { return IMPOSSIBLE_MATCH ; } } else { TypeBinding typeBinding = null ; QualifiedNameReference qNameRef = ( ( QualifiedNameReference ) ( nameRef ) ) ; char [ ] [ ] tokens = qNameRef . tokens ; int lastIndex = ( tokens . length ) - 1 ; <START_BUG> switch ( ( qNameRef . bits ) & ( Statement . RestrictiveFlagMASK ) ) { <END_BUG> case BindingIds . FIELD : typeBinding = ( ( FieldBinding ) ( binding ) ) . declaringClass ; int otherBindingsCount = ( ( qNameRef . otherBindings ) == null ) ? 0 : qNameRef . otherBindings . length ; lastIndex -= otherBindingsCount + 1 ; if ( lastIndex < 0 ) return IMPOSSIBLE_MATCH ; break ; case BindingIds . LOCAL : return IMPOSSIBLE_MATCH ; case BindingIds . TYPE : typeBinding = ( ( TypeBinding ) ( binding ) ) ; } while ( ( typeBinding != null ) && ( lastIndex >= 0 ) ) { if ( this . matchesName ( this . simpleName , tokens [ ( lastIndex -- ) ] ) ) { int level = this . matchLevelForType ( this . simpleName , this . qualification , typeBinding ) ; if ( level != ( IMPOSSIBLE_MATCH ) ) { return level ; } } if ( typeBinding instanceof ReferenceBinding ) { typeBinding = ( ( ReferenceBinding ) ( typeBinding ) ) . enclosingType ( ) ; } else { typeBinding = null ; } } return IMPOSSIBLE_MATCH ; } } } } private int matchLevel ( TypeReference typeRef , boolean resolve ) { } public int matchLevel ( Binding binding ) { } }

Fix:
switch ( ( qNameRef . bits ) & ( AstNode . RestrictiveFlagMASK ) ) {