Buggy code:
public abstract class PatternLocator implements IIndexConstants { protected int matchMode ; protected boolean isCaseSensitive ; protected boolean isCamelCase ; protected boolean isEquivalentMatch ; protected boolean isErasureMatch ; protected boolean mustResolve ; protected boolean mayBeGeneric ; SearchMatch match = null ; public static final int IMPOSSIBLE_MATCH = 0 ; public static final int INACCURATE_MATCH = 1 ; public static final int POSSIBLE_MATCH = 2 ; public static final int ACCURATE_MATCH = 3 ; public static final int ERASURE_MATCH = 4 ; protected static final int POSSIBLE_FULL_MATCH = ( PatternLocator . POSSIBLE_MATCH ) | ( ( SearchPattern . R_FULL_MATCH ) << 16 ) ; protected static final int POSSIBLE_PREFIX_MATCH = ( PatternLocator . POSSIBLE_MATCH ) | ( ( SearchPattern . R_PREFIX_MATCH ) << 16 ) ; protected static final int POSSIBLE_PATTERN_MATCH = ( PatternLocator . POSSIBLE_MATCH ) | ( ( SearchPattern . R_PATTERN_MATCH ) << 16 ) ; protected static final int POSSIBLE_REGEXP_MATCH = ( PatternLocator . POSSIBLE_MATCH ) | ( ( SearchPattern . R_REGEXP_MATCH ) << 16 ) ; protected static final int POSSIBLE_CAMELCASE_MATCH = ( PatternLocator . POSSIBLE_MATCH ) | ( ( SearchPattern . R_CAMELCASE_MATCH ) << 16 ) ; protected static final int NODE_SET_MASK = 255 ; protected static final int POSSIBLE_MATCH_MASK = ~ ( PatternLocator . NODE_SET_MASK ) ; public static final int COMPILATION_UNIT_CONTAINER = 1 ; public static final int CLASS_CONTAINER = 2 ; public static final int METHOD_CONTAINER = 4 ; public static final int FIELD_CONTAINER = 8 ; public static final int ALL_CONTAINER = ( ( ( PatternLocator . COMPILATION_UNIT_CONTAINER ) | ( PatternLocator . CLASS_CONTAINER ) ) | ( PatternLocator . METHOD_CONTAINER ) ) | ( PatternLocator . FIELD_CONTAINER ) ; public static final int RAW_MASK = ( SearchPattern . R_EQUIVALENT_MATCH ) | ( SearchPattern . R_ERASURE_MATCH ) ; public static final int RULE_MASK = PatternLocator . RAW_MASK ; public static PatternLocator patternLocator ( SearchPattern pattern ) { } public static char [ ] qualifiedPattern ( char [ ] simpleNamePattern , char [ ] qualificationPattern ) { } public static char [ ] qualifiedSourceName ( TypeBinding binding ) { } public PatternLocator ( SearchPattern pattern ) { } protected void clear ( ) { } protected char [ ] getQualifiedPattern ( char [ ] simpleNamePattern , char [ ] qualificationPattern ) { } protected char [ ] getQualifiedSourceName ( TypeBinding binding ) { } protected TypeBinding getTypeNameBinding ( int index ) { } public void initializePolymorphicSearch ( MatchLocator locator ) { } public int match ( Annotation node , MatchingNodeSet nodeSet ) { } public int match ( ASTNode node , MatchingNodeSet nodeSet ) { } public int match ( ConstructorDeclaration node , MatchingNodeSet nodeSet ) { } public int match ( Expression node , MatchingNodeSet nodeSet ) { } public int match ( FieldDeclaration node , MatchingNodeSet nodeSet ) { } public int match ( LocalDeclaration node , MatchingNodeSet nodeSet ) { } public int match ( MethodDeclaration node , MatchingNodeSet nodeSet ) { } public int match ( MemberValuePair node , MatchingNodeSet nodeSet ) { } public int match ( MessageSend node , MatchingNodeSet nodeSet ) { } public int match ( Reference node , MatchingNodeSet nodeSet ) { } public int match ( TypeDeclaration node , MatchingNodeSet nodeSet ) { } public int match ( TypeParameter node , MatchingNodeSet nodeSet ) { } public int match ( TypeReference node , MatchingNodeSet nodeSet ) { } protected int matchContainer ( ) { } protected boolean matchesName ( char [ ] pattern , char [ ] name ) { } protected int matchNameValue ( char [ ] pattern , char [ ] name ) { <START_BUG> if ( ( pattern == null ) || ( ( pattern . length ) == 0 ) ) <END_BUG> return PatternLocator . ACCURATE_MATCH ; if ( name == null ) return PatternLocator . IMPOSSIBLE_MATCH ; if ( ( name . length ) == 0 ) { if ( ( pattern . length ) == 0 ) { return PatternLocator . ACCURATE_MATCH ; } return PatternLocator . IMPOSSIBLE_MATCH ; } else if ( ( pattern . length ) == 0 ) { return PatternLocator . IMPOSSIBLE_MATCH ; } boolean matchFirstChar = ( ! ( this . isCaseSensitive ) ) || ( ( pattern [ 0 ] ) == ( name [ 0 ] ) ) ; boolean sameLength = ( pattern . length ) == ( name . length ) ; boolean canBePrefix = ( name . length ) > ( pattern . length ) ; switch ( this . matchMode ) { case SearchPattern . R_EXACT_MATCH : if ( ( sameLength && matchFirstChar ) && ( CharOperation . equals ( pattern , name , this . isCaseSensitive ) ) ) { return PatternLocator . POSSIBLE_FULL_MATCH ; } if ( this . isCamelCase ) { if ( ( canBePrefix && matchFirstChar ) && ( CharOperation . prefixEquals ( pattern , name , this . isCaseSensitive ) ) ) { return PatternLocator . POSSIBLE_PREFIX_MATCH ; } if ( matchFirstChar && ( CharOperation . camelCaseMatch ( pattern , name ) ) ) { return PatternLocator . POSSIBLE_CAMELCASE_MATCH ; } } break ; case SearchPattern . R_PREFIX_MATCH : if ( ( sameLength && matchFirstChar ) && ( CharOperation . equals ( pattern , name , this . isCaseSensitive ) ) ) { return PatternLocator . POSSIBLE_FULL_MATCH ; } if ( ( canBePrefix && matchFirstChar ) && ( CharOperation . prefixEquals ( pattern , name , this . isCaseSensitive ) ) ) { return PatternLocator . POSSIBLE_PREFIX_MATCH ; } if ( ( ( this . isCamelCase ) && matchFirstChar ) && ( CharOperation . camelCaseMatch ( pattern , name ) ) ) { return PatternLocator . POSSIBLE_CAMELCASE_MATCH ; } break ; case SearchPattern . R_PATTERN_MATCH : if ( ! ( this . isCaseSensitive ) ) { pattern = CharOperation . toLowerCase ( pattern ) ; } if ( CharOperation . match ( pattern , name , this . isCaseSensitive ) ) { return PatternLocator . POSSIBLE_MATCH ; } break ;

Fix:
if ( pattern == null )