Buggy code:
public abstract class MethodCallCheck extends MethodCallVisitedCheck { public static final String MSG_KEY = "expectedMethodCall" ; public static final String TYPE_SIGNATURE_SEPARATOR = "!" ; public static final String CALLER_TYPE_SEPARATOR = "#" ; public static final String TREE_REGEX_START = "%" ; public static final String CALLER_PARAMETER_SPECIFIER = "\\$" ; protected Map < String , String [ ] > typeToSignaturesWithTargets = new HashMap < > ( ) ; public void setExpectedSignaturesOfType ( String aPattern ) { } public void setExpectedCalls ( String [ ] aPatterns ) { } protected abstract boolean returnValueOnMatch ( ) { } String matchedSignature ; @ Override protected Boolean check ( STType aCallingType , DetailAST ast , String aShortMethodName , String aLongMethodName , CallInfo aCallInfo ) { } static StringBuffer aComposedString = new StringBuffer ( 300 ) ; public static String substituteParameters ( String aSpecification , STMethod aCallingMethod ) { } public boolean parameterMatches ( List < DetailAST > aCalledActuals , String aRegex , int anActualIndex ) { } static StringBuffer treeText = new StringBuffer ( 4096 ) ; protected boolean parametersMatch ( STMethod aCallingMethod , CallInfo aCallInfo , String aSpecifiedParameters ) { } protected boolean incrementalParametersMatch ( STMethod aCallingMethod , CallInfo aCallInfo , List < String > aSpecifiedParameters ) { } protected Boolean matches ( STType aCallingSTType , String aSpecifier , String aShortMethodName , String aLongMethodName , CallInfo aCallInfo ) { } protected void log ( DetailAST ast , DetailAST aTreeAST , String aShortMethodName , String aLongMethodName , CallInfo aCallInfo ) { } protected static boolean isStarParameters ( String [ ] aParameters ) { } static STMethod noMethod = new NoMethod ( ) ; protected Boolean matches ( String aSpecifiedTarget , STMethod aSpecifiedMethod , String aShortMethodName , String aLongMethodName , CallInfo aCallInfo ) { int i = 0 ; if ( ( ! ( MethodCallCheck . isStarParameters ( aSpecifiedMethod . getParameterTypes ( ) ) ) ) && ( ( aCallInfo . getActuals ( ) . size ( ) ) != ( aSpecifiedMethod . getParameterTypes ( ) . length ) ) ) return false ; String aTypeName = aCallInfo . getCalledType ( ) ; if ( ( aTypeName == null ) || ( aTypeName . contains ( "[" ) ) ) { return null ; } if ( ( ! ( aSpecifiedMethod . getName ( ) . startsWith ( TAG_STRING ) ) ) && ( ! ( aSpecifiedTarget . startsWith ( TAG_STRING ) ) ) ) { if ( ( aCallInfo . getNormalizedCall ( ) . length ) > 2 ) { <START_BUG> return aLongMethodName . matches ( aSpecifiedMethod . getName ( ) ) ; <END_BUG> } return ( aShortMethodName . matches ( aSpecifiedMethod . getName ( ) ) ) && ( toShortTypeName ( aTypeName ) . matches ( aSpecifiedTarget ) ) ; } Boolean matchesType = matchesTypeUnifying ( aSpecifiedTarget , aTypeName ) ; if ( matchesType == null ) return null ; if ( ! matchesType ) { return false ; } if ( ! ( aSpecifiedMethod . getName ( ) . startsWith ( TAG_STRING ) ) ) { return aShortMethodName . matches ( aSpecifiedMethod . getName ( ) ) ; } if ( ! ( isIdentifier ( aTypeName ) ) ) { aTypeName = aSpecifiedTarget ; } STType aTargetSTType = SymbolTableFactory . getOrCreateSymbolTable ( ) . getSTClassByShortName ( aTypeName ) ; if ( aTargetSTType == null ) { return null ; } STMethod [ ] aMethods = aTargetSTType . getMethods ( ) ; if ( aMethods == null ) return null ; boolean hadNullMatch = false ; for ( STMethod anSTMethod : aMethods ) { Boolean aMatch = matchSignature ( aSpecifiedMethod , anSTMethod ) ; if ( aMatch == null ) { hadNullMatch = true ; continue ; } if ( ! aMatch ) continue ; if ( ( anSTMethod . getName ( ) . equals ( aCallInfo . getCallee ( ) ) ) && ( ( anSTMethod . getParameterTypes ( ) . length ) == ( aCallInfo . getActuals ( ) . size ( ) ) ) ) { return hasTag ( anSTMethod , aSpecifiedMethod . getName ( ) ) ; } } if ( hadNullMatch ) return null ; return false ; } String specifiedType ; public Boolean doPendingCheck ( DetailAST anAST , DetailAST aTree ) { } @ Override protected String msgKey ( ) { } public static void main ( String [ ] args ) { } }

Fix:
return aLongMethodName . toLowerCase ( ) . matches ( aSpecifiedMethod . getName ( ) ) ;