Program: 185430
Project: 185430
Buggy source:
@Override public VisitStatus acceptASTNode(ASTNode node,TypeLookupResult result,IJavaElement enclosingElement){
  if (result.declaringType == null) {
    return VisitStatus.CONTINUE;
  }
  boolean isConstructorCall=false;
  boolean isDeclaration=(node instanceof MethodNode);
  int start=0;
  int end=0;
  if (result.declaration instanceof MethodNode) {
    if (methodName.equals(((MethodNode)result.declaration).getName())) {
      if (isDeclaration) {
        start=((MethodNode)node).getNameStart();
        end=((MethodNode)node).getNameEnd() + 1;
      }
 else       if (node.getText().equals(methodName)) {
        start=node.getStart();
        end=node.getEnd();
      }
 else       if (node instanceof StaticMethodCallExpression && node.getText().contains("String_Node_Str" + methodName + "String_Node_Str")) {
        start=((StaticMethodCallExpression)node).getStart();
        end=start + methodName.length();
      }
    }
  }
  if (end > 0) {
    Position position=new Position(start,end - start);
    if (!acceptedPositions.contains(position)) {
      if (nameAndArgsMatch(GroovyUtils.getBaseType(result.declaringType),isDeclaration ? GroovyUtils.getParameterTypes(((MethodNode)node).getParameters()) : result.scope.getMethodCallArgumentTypes())) {
        if (enclosingElement.getOpenable() instanceof GroovyClassFileWorkingCopy) {
          enclosingElement=((GroovyClassFileWorkingCopy)enclosingElement.getOpenable()).convertToBinary(enclosingElement);
        }
        SearchMatch match=null;
        if (isDeclaration && findDeclarations) {
          match=new MethodDeclarationMatch(enclosingElement,getAccuracy(result.confidence),start,end - start,participant,enclosingElement.getResource());
        }
 else         if (!isDeclaration && findReferences) {
          match=new MethodReferenceMatch(enclosingElement,getAccuracy(result.confidence),start,end - start,isConstructorCall,false,false,false,participant,enclosingElement.getResource());
        }
        if (match != null) {
          try {
            acceptedPositions.add(position);
            requestor.acceptSearchMatch(match);
          }
 catch (          Exception e) {
            Util.log(e,"String_Node_Str" + enclosingElement + "String_Node_Str"+ enclosingElement.getResource());
          }
        }
      }
    }
  }
  return VisitStatus.CONTINUE;
}

Fixed version (ground truth):
@Override public VisitStatus acceptASTNode(ASTNode node,TypeLookupResult result,IJavaElement enclosingElement){
  if (result.declaringType == null) {
    return VisitStatus.CONTINUE;
  }
  boolean isDeclaration=(node instanceof MethodNode);
  int start=0;
  int end=0;
  if (result.declaration instanceof MethodNode) {
    if (methodName.equals(((MethodNode)result.declaration).getName())) {
      if (isDeclaration || node instanceof StaticMethodCallExpression) {
        start=((AnnotatedNode)node).getNameStart();
        end=((AnnotatedNode)node).getNameEnd() + 1;
      }
 else {
        String text=node.getText();
        if (methodName.equals(text) || result.declaringType.getField(text) != null) {
          start=node.getStart();
          end=node.getEnd();
        }
      }
    }
  }
  if (end > 0) {
    Position position=new Position(start,end - start);
    if (!acceptedPositions.contains(position)) {
      if (nameAndArgsMatch(GroovyUtils.getBaseType(result.declaringType),isDeclaration ? GroovyUtils.getParameterTypes(((MethodNode)node).getParameters()) : result.scope.getMethodCallArgumentTypes())) {
        if (enclosingElement.getOpenable() instanceof GroovyClassFileWorkingCopy) {
          enclosingElement=((GroovyClassFileWorkingCopy)enclosingElement.getOpenable()).convertToBinary(enclosingElement);
        }
        SearchMatch match=null;
        if (isDeclaration && findDeclarations) {
          match=new MethodDeclarationMatch(enclosingElement,getAccuracy(result.confidence),start,end - start,participant,enclosingElement.getResource());
        }
 else         if (!isDeclaration && findReferences) {
          match=new MethodReferenceMatch(enclosingElement,getAccuracy(result.confidence),start,end - start,false,false,false,false,participant,enclosingElement.getResource());
        }
        if (match != null) {
          try {
            acceptedPositions.add(position);
            requestor.acceptSearchMatch(match);
          }
 catch (          Exception e) {
            Util.log(e,"String_Node_Str" + enclosingElement + "String_Node_Str"+ enclosingElement.getResource());
          }
        }
      }
    }
  }
  return VisitStatus.CONTINUE;
}