Buggy code:
public class PackageReferencePattern extends AndPattern { private static char [ ] [ ] TAGS = new char [ ] [ ] { IIndexConstants . REF } ; private char [ ] pkgName ; private char [ ] [ ] segments ; private int currentSegment ; private char [ ] decodedSegment ; public PackageReferencePattern ( char [ ] pkgName , 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 ( ) { } private boolean matches ( char [ ] [ ] tokens ) { } protected boolean matchIndexEntry ( ) { } protected void matchReportReference ( AstNode reference , 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 ( QualifiedNameReference qNameRef , boolean resolve ) { if ( ! resolve ) { if ( ( this . pkgName ) == null ) { return POSSIBLE_MATCH ; } else { switch ( this . matchMode ) { case EXACT_MATCH : case PREFIX_MATCH : if ( CharOperation . prefixEquals ( this . pkgName , CharOperation . concatWith ( qNameRef . tokens , '.' ) , this . isCaseSensitive ) ) { return POSSIBLE_MATCH ; } else { return IMPOSSIBLE_MATCH ; } case PATTERN_MATCH : char [ ] pattern = ( ( this . pkgName [ ( ( this . pkgName . length ) - 1 ) ] ) == '*' ) ? this . pkgName : CharOperation . concat ( this . pkgName , ".*" . toCharArray ( ) ) ; if ( CharOperation . match ( pattern , CharOperation . concatWith ( qNameRef . tokens , '.' ) , this . isCaseSensitive ) ) { return POSSIBLE_MATCH ; } else { return IMPOSSIBLE_MATCH ; } default : return IMPOSSIBLE_MATCH ; } } } else { Binding binding = qNameRef . binding ; if ( binding == null ) { return INACCURATE_MATCH ; } else { TypeBinding typeBinding = null ; 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 ) ) ; } if ( typeBinding instanceof ArrayBinding ) { typeBinding = ( ( ArrayBinding ) ( typeBinding ) ) . leafComponentType ; } if ( typeBinding == null ) { return INACCURATE_MATCH ; } else { if ( typeBinding instanceof ReferenceBinding ) { PackageBinding pkgBinding = ( ( ReferenceBinding ) ( typeBinding ) ) . fPackage ; if ( pkgBinding == null ) { return INACCURATE_MATCH ; } else if ( this . matches ( pkgBinding . compoundName ) ) { return ACCURATE_MATCH ; } else { return IMPOSSIBLE_MATCH ; } } else { return IMPOSSIBLE_MATCH ; } } } } } private int matchLevel ( QualifiedTypeReference typeRef , boolean resolve ) { } }

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