Program: 95643
Project: 95643
Buggy source:
/** 
 * Creates the instance of the persistent object which is defined by the XML element used as parameter. The method generates all dependent objects as well.
 * @param proj The IProjectPO which is currently build. The instance isneeded by some objects to verify that their data confirms to project specification (for instance languages).
 * @param xml Abstraction of the XML element (see Apache XML Beans)
 * @param assignNewGuid <code>true</code> if the testcase should be assigned a new GUID. Otherwise  <code>false</code>.
 * @param mapper mapper to resolve param names
 * @return a persistent object generated from the information in the XMLelement
 */
private ISpecTestCasePO createTestCaseBase(IProjectPO proj,TestCase xml,boolean assignNewGuid,IParamNameMapper mapper){
  ISpecTestCasePO tc;
  if (xml.getId() != null) {
    tc=NodeMaker.createSpecTestCasePO(xml.getName());
    m_tcRef.put(xml.getId(),tc);
  }
 else   if (assignNewGuid) {
    tc=NodeMaker.createSpecTestCasePO(xml.getName());
    m_tcRef.put(tc.getGuid(),tc);
    m_oldToNewGuids.put(xml.getGUID(),tc.getGuid());
  }
 else {
    tc=NodeMaker.createSpecTestCasePO(xml.getName(),xml.getGUID());
    m_tcRef.put(xml.getGUID(),tc);
  }
  tc.setComment(xml.getComment());
  tc.setDescription(xml.getDescription());
  tc.setGenerated(xml.getGenerated());
  tc.setTaskId(xml.getTaskId());
  tc.setInterfaceLocked(xml.getInterfaceLocked());
  tc.setDataFile(xml.getDatafile());
  fillTrackedChangesInformation(tc,xml);
  if (xml.getReferencedTestData() != null) {
    String referencedDataName=xml.getReferencedTestData();
    for (    IParameterInterfacePO testDataCube : TestDataCubeBP.getAllTestDataCubesFor(proj)) {
      if (referencedDataName.equals(testDataCube.getName())) {
        tc.setReferencedDataCube(testDataCube);
        break;
      }
    }
  }
  for (  ParamDescription pdXml : xml.getParameterDescriptionList()) {
    String uniqueId=pdXml.getUniqueId();
    if (assignNewGuid) {
      IParamDescriptionPO paramDesc=tc.addParameter(pdXml.getType(),pdXml.getName(),mapper);
      m_oldToNewGuids.put(uniqueId,paramDesc.getUniqueId());
    }
 else {
      if (uniqueId != null && Pattern.matches("String_Node_Str" + GUID_LENGTH + "String_Node_Str",uniqueId)) {
        tc.addParameter(pdXml.getType(),pdXml.getName(),uniqueId,mapper);
      }
 else {
        tc.addParameter(pdXml.getType(),pdXml.getName(),mapper);
      }
    }
  }
  tc.setDataManager(createTDManager(tc,xml.getTestdata(),assignNewGuid));
  return tc;
}

Fixed version (ground truth):
/** 
 * Creates the instance of the persistent object which is defined by the XML element used as parameter. The method generates all dependent objects as well.
 * @param proj The IProjectPO which is currently build. The instance isneeded by some objects to verify that their data confirms to project specification (for instance languages).
 * @param xml Abstraction of the XML element (see Apache XML Beans)
 * @param assignNewGuid <code>true</code> if the testcase should be assigned a new GUID. Otherwise  <code>false</code>.
 * @param mapper mapper to resolve param names
 * @return a persistent object generated from the information in the XMLelement
 */
private ISpecTestCasePO createTestCaseBase(IProjectPO proj,TestCase xml,boolean assignNewGuid,IParamNameMapper mapper){
  ISpecTestCasePO tc;
  if (xml.getId() != null) {
    tc=NodeMaker.createSpecTestCasePO(xml.getName());
    m_tcRef.put(xml.getId(),tc);
  }
 else   if (assignNewGuid) {
    tc=NodeMaker.createSpecTestCasePO(xml.getName());
    m_tcRef.put(tc.getGuid(),tc);
    m_oldToNewGuids.put(xml.getGUID(),tc.getGuid());
  }
 else {
    tc=NodeMaker.createSpecTestCasePO(xml.getName(),xml.getGUID());
    m_tcRef.put(xml.getGUID(),tc);
  }
  tc.setComment(xml.getComment());
  tc.setDescription(xml.getDescription());
  tc.setGenerated(xml.getGenerated());
  tc.setTaskId(xml.getTaskId());
  tc.setInterfaceLocked(xml.getInterfaceLocked());
  tc.setDataFile(xml.getDatafile());
  fillTrackedChangesInformation(tc,xml);
  if (xml.getReferencedTestData() != null) {
    String referencedDataName=xml.getReferencedTestData();
    for (    IParameterInterfacePO testDataCube : TestDataCubeBP.getAllTestDataCubesFor(proj)) {
      if (referencedDataName.equals(testDataCube.getName())) {
        tc.setReferencedDataCube(testDataCube);
        break;
      }
    }
  }
  for (  ParamDescription pdXml : xml.getParameterDescriptionList()) {
    String uniqueId=pdXml.getUniqueId();
    if (assignNewGuid) {
      IParamDescriptionPO paramDesc=tc.addParameter(pdXml.getType(),pdXml.getName(),mapper);
      m_oldToNewGuids.put(uniqueId,paramDesc.getUniqueId());
    }
 else {
      if (uniqueId != null && Pattern.matches("String_Node_Str" + ImportExportUtil.UUID_LENGTH + "String_Node_Str",uniqueId)) {
        tc.addParameter(pdXml.getType(),pdXml.getName(),uniqueId,mapper);
      }
 else {
        tc.addParameter(pdXml.getType(),pdXml.getName(),mapper);
      }
    }
  }
  tc.setDataManager(createTDManager(tc,xml.getTestdata(),assignNewGuid));
  return tc;
}