Program: 47719
Project: 47719
Buggy source:
/** 
 * Reads the given test suite.
 * @param testSuite the test suite
 * @return List<PhpUnitTestReport> A list containing on report per php class
 */
public List<PhpUnitTestReport> readSuite(TestSuite testSuite,String parentFileName){
  List<PhpUnitTestReport> result=new ArrayList<PhpUnitTestReport>();
  List<TestSuite> testSuites=testSuite.getTestSuites();
  if (testSuites != null) {
    for (    TestSuite childSuite : testSuites) {
      readSuite(childSuite,testSuite.getFile());
    }
  }
  List<TestCase> testCases=testSuite.getTestCases();
  if (testCases != null) {
    for (    TestCase testCase : testCases) {
      String testClassName=testCase.getClassName();
      if (testClassName == null) {
        String name=testSuite.getName();
        int testSuiteClassIndex=name.indexOf(TESTSUITE_CLASS_NAME_SEPARATOR);
        if (testSuiteClassIndex > 0) {
          testClassName=name.substring(0,testSuiteClassIndex);
        }
      }
      PhpUnitTestReport report=reportsPerClass.get(testClassName);
      if (report == null) {
        report=new PhpUnitTestReport();
        report.setDetails(new ArrayList<TestCase>());
        report.setClassKey(testClassName);
        String file=testCase.getFile();
        if (file == null) {
          file=parentFileName;
        }
        report.setFile(file);
        reportsPerClass.put(testClassName,report);
      }
      if (parentFileName == null) {
        report.setTime(testSuite.getTime());
      }
      cumulateTestCaseDetails(testCase,report);
    }
  }
  result.addAll(reportsPerClass.values());
  return result;
}

Fixed version (ground truth):
/** 
 * Reads the given test suite. FIXME: Due to a inconsistent XML format in phpUnit, we have to parse enclosing testsuite name for generated testcases when a testcase holds the annotation dataProvider.
 * @param testSuite the test suite
 * @return List<PhpUnitTestReport> A list containing on report per php class
 */
public List<PhpUnitTestReport> readSuite(TestSuite testSuite,String parentFileName){
  List<PhpUnitTestReport> result=new ArrayList<PhpUnitTestReport>();
  List<TestSuite> testSuites=testSuite.getTestSuites();
  if (testSuites != null) {
    for (    TestSuite childSuite : testSuites) {
      readSuite(childSuite,testSuite.getFile());
    }
  }
  List<TestCase> testCases=testSuite.getTestCases();
  if (testCases != null) {
    for (    TestCase testCase : testCases) {
      String testClassName=testCase.getClassName();
      if (testClassName == null) {
        String name=testSuite.getName();
        int testSuiteClassIndex=name.indexOf(TESTSUITE_CLASS_NAME_SEPARATOR);
        if (testSuiteClassIndex > 0) {
          testClassName=name.substring(0,testSuiteClassIndex);
        }
      }
      PhpUnitTestReport report=reportsPerClass.get(testClassName);
      if (report == null) {
        report=new PhpUnitTestReport();
        report.setDetails(new ArrayList<TestCase>());
        report.setClassKey(testClassName);
        String file=testCase.getFile();
        if (file == null) {
          file=parentFileName;
        }
        report.setFile(file);
        reportsPerClass.put(testClassName,report);
      }
      if (parentFileName == null) {
        report.setTime(testSuite.getTime());
      }
      cumulateTestCaseDetails(testCase,report);
    }
  }
  result.addAll(reportsPerClass.values());
  return result;
}