Program: 12044
Project: 12044
Buggy source:
/** 
 * Get the information on the unimplemented test methods.
 * @param testTarget
 * @param testCase
 * @return the information on test class with the unimplemented test methods
 * @throws Exception
 */
public static ClassInfo getClassInfoWithUnimplementedTestMethods(IFile testTarget,IFile testCase) throws Exception {
  PreferenceLoader pref=new PreferenceLoader();
  ClassInfo classInfo=new ClassInfo();
  List<MethodInfo> unimplementedMethodNames=new ArrayList<MethodInfo>();
  if (pref.isTestMethodGenEnabled) {
    ClassInfo expectedClassInfo=getTestClassInfoFromTargetClass(testTarget);
    List<MethodInfo> expectedMethods=expectedClassInfo.methods;
    ClassInfo actualClassInfo=getMethodNamesAlreadyExists(testCase);
    List<MethodInfo> actualMethods=actualClassInfo.methods;
    for (    MethodInfo expected : expectedMethods) {
      boolean exist=false;
      for (      MethodInfo actual : actualMethods) {
        String escapedExp=expected.testMethodName.replace(StrConst.testMethodPrefix4Version3,StrConst.empty).replaceAll("String_Node_Str","String_Node_Str");
        if (actual.testMethodName.matches("String_Node_Str" + escapedExp + "String_Node_Str")) {
          exist=true;
          break;
        }
      }
      if (!exist)       unimplementedMethodNames.add(expected);
    }
    if (pref.isTestMethodGenNotBlankEnabled) {
      List<String> notImportedList=new ArrayList<String>();
      List<String> expImportedList=expectedClassInfo.importList;
      List<String> actImportedList=actualClassInfo.importList;
      for (      String expImported : expImportedList) {
        boolean found=false;
        for (        String actImported : actImportedList) {
          if (expImported.equals(actImported)) {
            found=true;
            break;
          }
        }
        if (!found)         notImportedList.add(expImported);
 else         notImportedList.add("String_Node_Str" + expImported);
      }
      classInfo.importList=notImportedList;
      if (pref.isTestMethodGenEnabledSupportJMock2) {
        classInfo.importList.add("String_Node_Str");
        classInfo.importList.add("String_Node_Str");
        classInfo.importList.add("String_Node_Str");
      }
      if (pref.isTestMethodGenEnabledSupportEasyMock) {
        classInfo.importList.add("String_Node_Str");
        classInfo.importList.add("String_Node_Str");
      }
    }
  }
  classInfo.methods=unimplementedMethodNames;
  return classInfo;
}

Fixed version (ground truth):
/** 
 * Get the information on the unimplemented test methods.
 * @param testTarget
 * @param testCase
 * @return the information on test class with the unimplemented test methods
 * @throws Exception
 */
public static ClassInfo getClassInfoWithUnimplementedTestMethods(IFile testTarget,IFile testCase) throws Exception {
  PreferenceLoader pref=new PreferenceLoader();
  ClassInfo classInfo=new ClassInfo();
  List<MethodInfo> unimplementedMethodNames=new ArrayList<MethodInfo>();
  if (pref.isTestMethodGenEnabled) {
    ClassInfo expectedClassInfo=getTestClassInfoFromTargetClass(testTarget);
    List<MethodInfo> expectedMethods=expectedClassInfo.methods;
    ClassInfo actualClassInfo=getMethodNamesAlreadyExists(testCase);
    List<MethodInfo> actualMethods=actualClassInfo.methods;
    for (    MethodInfo expected : expectedMethods) {
      boolean exist=false;
      for (      MethodInfo actual : actualMethods) {
        String escapedExp=expected.testMethodName.replace(StrConst.testMethodPrefix4Version3,StrConst.empty).replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str",StrConst.empty);
        if (actual.testMethodName.matches("String_Node_Str" + escapedExp + "String_Node_Str")) {
          exist=true;
          break;
        }
      }
      if (!exist)       unimplementedMethodNames.add(expected);
    }
    if (pref.isTestMethodGenNotBlankEnabled) {
      List<String> notImportedList=new ArrayList<String>();
      List<String> expImportedList=expectedClassInfo.importList;
      List<String> actImportedList=actualClassInfo.importList;
      for (      String expImported : expImportedList) {
        boolean found=false;
        for (        String actImported : actImportedList) {
          if (expImported.equals(actImported)) {
            found=true;
            break;
          }
        }
        if (!found)         notImportedList.add(expImported);
 else         notImportedList.add("String_Node_Str" + expImported);
      }
      classInfo.importList=notImportedList;
      if (pref.isTestMethodGenEnabledSupportJMock2) {
        classInfo.importList.add("String_Node_Str");
        classInfo.importList.add("String_Node_Str");
        classInfo.importList.add("String_Node_Str");
      }
      if (pref.isTestMethodGenEnabledSupportEasyMock) {
        classInfo.importList.add("String_Node_Str");
        classInfo.importList.add("String_Node_Str");
      }
    }
  }
  classInfo.methods=unimplementedMethodNames;
  return classInfo;
}