Buggy code:
public class ClassFileMatchLocator implements IIndexConstants { public static char [ ] convertClassFileFormat ( char [ ] name ) { } private boolean checkDeclaringType ( IBinaryType enclosingBinaryType , char [ ] simpleName , char [ ] qualification , boolean isCaseSensitive , boolean isCamelCase ) { } private boolean checkParameters ( char [ ] methodDescriptor , char [ ] [ ] parameterSimpleNames , char [ ] [ ] parameterQualifications , boolean isCaseSensitive , boolean isCamelCase ) { } private boolean checkTypeName ( char [ ] simpleName , char [ ] qualification , char [ ] fullyQualifiedTypeName , boolean isCaseSensitive , boolean isCamelCase ) { } public void locateMatches ( MatchLocator locator , ClassFile classFile , IBinaryType info ) throws CoreException { } boolean matchBinary ( SearchPattern pattern , Object binaryInfo , IBinaryType enclosingBinaryType ) { } boolean matchConstructor ( ConstructorPattern pattern , Object binaryInfo , IBinaryType enclosingBinaryType ) { } boolean matchField ( FieldPattern pattern , Object binaryInfo , IBinaryType enclosingBinaryType ) { } boolean matchMethod ( MethodPattern pattern , Object binaryInfo , IBinaryType enclosingBinaryType ) { } boolean matchSuperTypeReference ( SuperTypeReferencePattern pattern , Object binaryInfo , IBinaryType enclosingBinaryType ) { } boolean matchTypeDeclaration ( TypeDeclarationPattern pattern , Object binaryInfo , IBinaryType enclosingBinaryType ) { if ( ! ( binaryInfo instanceof IBinaryType ) ) return false ; IBinaryType type = ( ( IBinaryType ) ( binaryInfo ) ) ; char [ ] fullyQualifiedTypeName = ClassFileMatchLocator . convertClassFileFormat ( type . getName ( ) ) ; if ( ( ( pattern . enclosingTypeNames ) == null ) || ( pattern instanceof QualifiedTypeDeclarationPattern ) ) { <START_BUG> char [ ] simpleName = ( ( ( pattern . getMatchMode ( ) ) | ( SearchPattern . R_PREFIX_MATCH ) ) != 0 ) ? CharOperation . concat ( pattern . simpleName , IIndexConstants . ONE_STAR ) : pattern . simpleName ; <END_BUG> if ( ! ( checkTypeName ( simpleName , pattern . pkg , fullyQualifiedTypeName , pattern . isCaseSensitive ( ) , pattern . isCamelCase ( ) ) ) ) return false ; } else { char [ ] enclosingTypeName = CharOperation . concatWith ( pattern . enclosingTypeNames , '.' ) ; char [ ] patternString = ( ( pattern . pkg ) == null ) ? enclosingTypeName : CharOperation . concat ( pattern . pkg , enclosingTypeName , '.' ) ; if ( ! ( checkTypeName ( pattern . simpleName , patternString , fullyQualifiedTypeName , pattern . isCaseSensitive ( ) , pattern . isCamelCase ( ) ) ) ) return false ; } int kind = TypeDeclaration . kind ( type . getModifiers ( ) ) ; switch ( pattern . typeSuffix ) { case IIndexConstants . CLASS_SUFFIX : return kind == ( TypeDeclaration . CLASS_DECL ) ; case IIndexConstants . INTERFACE_SUFFIX : return kind == ( TypeDeclaration . INTERFACE_DECL ) ; case IIndexConstants . ENUM_SUFFIX : return kind == ( TypeDeclaration . ENUM_DECL ) ; case IIndexConstants . ANNOTATION_TYPE_SUFFIX : return kind == ( TypeDeclaration . ANNOTATION_TYPE_DECL ) ; case IIndexConstants . CLASS_AND_INTERFACE_SUFFIX : return ( kind == ( TypeDeclaration . CLASS_DECL ) ) || ( kind == ( TypeDeclaration . INTERFACE_DECL ) ) ; case IIndexConstants . CLASS_AND_ENUM_SUFFIX : return ( kind == ( TypeDeclaration . CLASS_DECL ) ) || ( kind == ( TypeDeclaration . ENUM_DECL ) ) ; case IIndexConstants . TYPE_SUFFIX : } return true ; } }

Fix:
char [ ] simpleName = ( ( pattern . getMatchMode ( ) ) == ( SearchPattern . R_PREFIX_MATCH ) ) ? CharOperation . concat ( pattern . simpleName , IIndexConstants . ONE_STAR ) : pattern . simpleName ;