Program: 186061
Project: 186061
Buggy source:
private MethodNode findMethodNode(IMethod method){
  ClassNode clazz=findClassWithName(createName(method.getDeclaringType()));
  try {
    if (method.isConstructor()) {
      List<ConstructorNode> constructors=clazz.getDeclaredConstructors();
      for (      ConstructorNode constructorNode : constructors) {
        String[] jdtParamTypes=method.getParameterTypes() == null ? new String[0] : method.getParameterTypes();
        Parameter[] groovyParams=constructorNode.getParameters() == null ? new Parameter[0] : constructorNode.getParameters();
        if (groovyParams != null && groovyParams.length > 0 && groovyParams[0].getName().startsWith("String_Node_Str")) {
          Parameter[] newGroovyParams=new Parameter[groovyParams.length - 1];
          System.arraycopy(groovyParams,1,newGroovyParams,0,newGroovyParams.length);
          groovyParams=newGroovyParams;
        }
        if (groovyParams.length != jdtParamTypes.length) {
          continue;
        }
        for (int i=0; i < groovyParams.length; i++) {
          String groovyClassType=groovyParams[i].getType().getName();
          if (!groovyClassType.startsWith("String_Node_Str")) {
            groovyClassType=Signature.createTypeSignature(groovyClassType,false);
          }
          if (!groovyClassType.equals(jdtParamTypes[i])) {
            continue;
          }
        }
        return constructorNode;
      }
    }
 else {
      List<MethodNode> methods=clazz.getMethods(method.getElementName());
      for (      MethodNode methodNode : methods) {
        String[] jdtParamTypes=method.getParameterTypes() == null ? new String[0] : method.getParameterTypes();
        Parameter[] groovyParams=methodNode.getParameters() == null ? new Parameter[0] : methodNode.getParameters();
        if (groovyParams.length != jdtParamTypes.length) {
          continue;
        }
        for (int i=0; i < groovyParams.length; i++) {
          String groovyClassType=groovyParams[i].getType().getName();
          if (!groovyClassType.startsWith("String_Node_Str")) {
            groovyClassType=Signature.createTypeSignature(groovyClassType,false);
          }
          if (!groovyClassType.equals(jdtParamTypes[i])) {
            continue;
          }
        }
        return methodNode;
      }
    }
  }
 catch (  JavaModelException e) {
    Util.log(e,"String_Node_Str" + method.getElementName() + "String_Node_Str"+ clazz.getName());
  }
  throw new IllegalArgumentException("String_Node_Str" + method.getElementName() + "String_Node_Str"+ clazz.getName());
}

Fixed version (ground truth):
private MethodNode findMethodNode(IMethod method){
  ClassNode clazz=findClassWithName(createName(method.getDeclaringType()));
  try {
    if (method.isConstructor()) {
      List<ConstructorNode> constructors=clazz.getDeclaredConstructors();
      for (      ConstructorNode constructorNode : constructors) {
        String[] jdtParamTypes=method.getParameterTypes() == null ? new String[0] : method.getParameterTypes();
        Parameter[] groovyParams=constructorNode.getParameters() == null ? new Parameter[0] : constructorNode.getParameters();
        if (groovyParams != null && groovyParams.length > 0 && groovyParams[0].getName().startsWith("String_Node_Str")) {
          Parameter[] newGroovyParams=new Parameter[groovyParams.length - 1];
          System.arraycopy(groovyParams,1,newGroovyParams,0,newGroovyParams.length);
          groovyParams=newGroovyParams;
        }
        if (groovyParams.length != jdtParamTypes.length) {
          continue;
        }
        for (int i=0; i < groovyParams.length; i++) {
          String groovyClassType=groovyParams[i].getType().getName();
          if (!groovyClassType.startsWith("String_Node_Str")) {
            groovyClassType=Signature.createTypeSignature(groovyClassType,false);
          }
          if (!groovyClassType.equals(jdtParamTypes[i])) {
            continue;
          }
        }
        return constructorNode;
      }
    }
 else {
      List<MethodNode> methods=clazz.getMethods(method.getElementName());
      for (      MethodNode methodNode : methods) {
        String[] jdtParamTypes=method.getParameterTypes() == null ? new String[0] : method.getParameterTypes();
        Parameter[] groovyParams=methodNode.getParameters() == null ? new Parameter[0] : methodNode.getParameters();
        if (groovyParams.length != jdtParamTypes.length) {
          continue;
        }
        for (int i=0; i < groovyParams.length; i++) {
          String groovyClassType=groovyParams[i].getType().getName();
          if (!groovyClassType.startsWith("String_Node_Str")) {
            groovyClassType=Signature.createTypeSignature(groovyClassType,false);
          }
          if (!groovyClassType.equals(jdtParamTypes[i])) {
            continue;
          }
        }
        return methodNode;
      }
    }
  }
 catch (  JavaModelException e) {
    Util.log(e,"String_Node_Str" + method.getElementName() + "String_Node_Str"+ clazz.getName());
  }
  return null;
}