Program: 12098
Project: 12098
Buggy source:
public static List<String> getTestMethodsFromTarget(IFile javaFile) throws Exception {
  List<String> testMethods=new ArrayList<String>();
  boolean enabled=Activator.getDefault().getPreferenceStore().getBoolean(STR.Preference.TestMethodAutoGenerate.ENABLE);
  String delimiter=Activator.getDefault().getPreferenceStore().getString(STR.Preference.TestMethodAutoGenerate.DELIMITER);
  boolean enabledArgs=Activator.getDefault().getPreferenceStore().getBoolean(STR.Preference.TestMethodAutoGenerate.ARGS);
  String argsPrefix=Activator.getDefault().getPreferenceStore().getString(STR.Preference.TestMethodAutoGenerate.ARGS_PREFIX);
  String argsDelimiter=Activator.getDefault().getPreferenceStore().getString(STR.Preference.TestMethodAutoGenerate.ARGS_DELIMITER);
  boolean enabledReturn=Activator.getDefault().getPreferenceStore().getBoolean(STR.Preference.TestMethodAutoGenerate.RETURN);
  String returnPrefix=Activator.getDefault().getPreferenceStore().getString(STR.Preference.TestMethodAutoGenerate.RETURN_PREFIX);
  String returnDelimiter=Activator.getDefault().getPreferenceStore().getString(STR.Preference.TestMethodAutoGenerate.RETURN_DELIMITER);
  if (enabled) {
    InputStream is=null;
    BufferedReader br=null;
    try {
      is=javaFile.getContents();
      br=new BufferedReader(new InputStreamReader(is));
      StringBuffer tmpsb=new StringBuffer();
      String line=null;
      while ((line=br.readLine()) != null)       tmpsb.append(line + "String_Node_Str");
      String allSrc=tmpsb.toString();
      String[] publics=allSrc.split("String_Node_Str");
      for (      String publicsEach : publics) {
        if (publicsEach.matches("String_Node_Str")) {
          Matcher matcher=Pattern.compile("String_Node_Str").matcher(publicsEach);
          if (matcher.find()) {
            String methodReturnType=matcher.group(1);
            String methodName=matcher.group(2);
            String args=matcher.group(3);
            String[] argArr=args.split("String_Node_Str");
            String argTypes="String_Node_Str";
            for (int i=0; i < argArr.length; i+=2) {
              argTypes+=argsDelimiter + argArr[i];
            }
            String testMethodName="String_Node_Str" + delimiter + methodName;
            if (enabledReturn)             testMethodName+=delimiter + returnPrefix + returnDelimiter+ methodReturnType;
            if (enabledArgs)             testMethodName+=delimiter + argsPrefix + argTypes;
            testMethods.add(testMethodName);
          }
        }
      }
    }
  finally {
      if (is != null)       try {
        is.close();
      }
 catch (      Exception ignore) {
      }
      if (br != null)       try {
        br.close();
      }
 catch (      Exception ignore) {
      }
    }
  }
  return testMethods;
}

Fixed version (ground truth):
public static List<String> getTestMethodsFromTarget(IFile javaFile) throws Exception {
  List<String> testMethods=new ArrayList<String>();
  boolean enabled=Activator.getDefault().getPreferenceStore().getBoolean(STR.Preference.TestMethodAutoGenerate.ENABLE);
  String delimiter=Activator.getDefault().getPreferenceStore().getString(STR.Preference.TestMethodAutoGenerate.DELIMITER);
  boolean enabledArgs=Activator.getDefault().getPreferenceStore().getBoolean(STR.Preference.TestMethodAutoGenerate.ARGS);
  String argsPrefix=Activator.getDefault().getPreferenceStore().getString(STR.Preference.TestMethodAutoGenerate.ARGS_PREFIX);
  String argsDelimiter=Activator.getDefault().getPreferenceStore().getString(STR.Preference.TestMethodAutoGenerate.ARGS_DELIMITER);
  boolean enabledReturn=Activator.getDefault().getPreferenceStore().getBoolean(STR.Preference.TestMethodAutoGenerate.RETURN);
  String returnPrefix=Activator.getDefault().getPreferenceStore().getString(STR.Preference.TestMethodAutoGenerate.RETURN_PREFIX);
  String returnDelimiter=Activator.getDefault().getPreferenceStore().getString(STR.Preference.TestMethodAutoGenerate.RETURN_DELIMITER);
  if (enabled) {
    InputStream is=null;
    BufferedReader br=null;
    try {
      is=javaFile.getContents();
      br=new BufferedReader(new InputStreamReader(is));
      StringBuffer tmpsb=new StringBuffer();
      String line=null;
      while ((line=br.readLine()) != null)       tmpsb.append(line + "String_Node_Str");
      String allSrc=tmpsb.toString();
      String[] publics=allSrc.split("String_Node_Str");
      for (      String publicsEach : publics) {
        if (publicsEach.matches("String_Node_Str")) {
          Matcher matcher=Pattern.compile("String_Node_Str").matcher(publicsEach);
          if (matcher.find()) {
            String methodReturnType=matcher.group(1);
            String methodName=matcher.group(2);
            String args=matcher.group(3);
            String[] argArr=args.split("String_Node_Str");
            String argTypes="String_Node_Str";
            for (int i=0; i < argArr.length; i+=2) {
              String arg="String_Node_Str";
              arg=argArr[i].replaceAll("String_Node_Str","String_Node_Str");
              arg=arg.replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str");
              argTypes+=argsDelimiter + arg;
            }
            String testMethodName="String_Node_Str" + delimiter + methodName;
            if (enabledReturn) {
              methodReturnType=methodReturnType.replaceAll("String_Node_Str","String_Node_Str");
              testMethodName+=delimiter + returnPrefix + returnDelimiter+ methodReturnType;
            }
            if (enabledArgs)             testMethodName+=delimiter + argsPrefix + argTypes;
            testMethods.add(testMethodName);
          }
        }
      }
    }
  finally {
      if (is != null)       try {
        is.close();
      }
 catch (      Exception ignore) {
      }
      if (br != null)       try {
        br.close();
      }
 catch (      Exception ignore) {
      }
    }
  }
  return testMethods;
}