Program: 57538
Project: 57538
Buggy source:
/** 
 * <p> Initializes   {@link IDType}s and   {@link IDCategory} based on theinformation provides in the  {@link DataSetDescription}. </p> <p> Creates default values as specified in the   {@link IDSpecification}, or creates default values for <code>IDSpecification</code>s themselves if necessary. </p>
 * @param dataSetDescription the  {@link DataSetDescription} containing the externallyspecified information about IDs
 * @return the {@link DataSetDescription} enriched by default values
 */
public static DataSetDescription initIDs(DataSetDescription dataSetDescription){
  String dimensionIDCategoryName;
  String dimensionIDTypeName;
  String recordIDCategoryName;
  String recordIDTypeName;
  IDSpecification rowIDSpecification=dataSetDescription.getRowIDSpecification();
  if (rowIDSpecification == null) {
    rowIDSpecification=new IDSpecification();
    rowIDSpecification.setIDSpecification(dataSetDescription.getDataSetName() + "String_Node_Str",dataSetDescription.getDataSetName() + "String_Node_Str");
    dataSetDescription.setRowIDSpecification(rowIDSpecification);
    Logger.log(new Status(Status.INFO,"String_Node_Str","String_Node_Str" + dataSetDescription.getDataSetName()));
  }
  IDSpecification columnIDSpecification=dataSetDescription.getColumnIDSpecification();
  if (columnIDSpecification == null) {
    columnIDSpecification=new IDSpecification();
    columnIDSpecification.setIDSpecification(dataSetDescription.getDataSetName() + "String_Node_Str",dataSetDescription.getDataSetName() + "String_Node_Str");
    dataSetDescription.setColumnIDSpecification(columnIDSpecification);
    Logger.log(new Status(Status.INFO,"String_Node_Str","String_Node_Str" + dataSetDescription.getDataSetName()));
  }
  if (rowIDSpecification.getIdCategory() == null) {
    rowIDSpecification.setIdCategory(rowIDSpecification.getIdType());
  }
  if (columnIDSpecification.getIdCategory() == null) {
    columnIDSpecification.setIdCategory(columnIDSpecification.getIdType());
  }
  if (dataSetDescription.isTransposeMatrix()) {
    dimensionIDTypeName=rowIDSpecification.getIdType();
    dimensionIDCategoryName=rowIDSpecification.getIdCategory();
    recordIDTypeName=columnIDSpecification.getIdType();
    recordIDCategoryName=columnIDSpecification.getIdCategory();
  }
 else {
    dimensionIDTypeName=columnIDSpecification.getIdType();
    dimensionIDCategoryName=columnIDSpecification.getIdCategory();
    recordIDTypeName=rowIDSpecification.getIdType();
    recordIDCategoryName=rowIDSpecification.getIdCategory();
  }
  if (dimensionIDCategoryName == null)   dimensionIDCategoryName=dimensionIDTypeName;
  if (recordIDCategoryName == null)   recordIDCategoryName=recordIDTypeName;
  IDCategory dimensionIDCategory=IDCategory.getIDCategory(dimensionIDCategoryName);
  if (dimensionIDCategory == null) {
    dimensionIDCategory=IDCategory.registerCategory(dimensionIDCategoryName);
  }
  IDCategory recodIDCategory=IDCategory.getIDCategory(recordIDCategoryName);
  if (recodIDCategory == null) {
    recodIDCategory=IDCategory.registerCategory(recordIDCategoryName);
  }
  IDType recordIDType=IDType.getIDType(recordIDTypeName);
  if (recordIDType == null) {
    recordIDType=IDType.registerType(recordIDTypeName,recodIDCategory,EDataType.STRING);
  }
  IDType dimensionIDType=IDType.getIDType(dimensionIDTypeName);
  if (dimensionIDType == null) {
    dimensionIDType=IDType.registerType(dimensionIDTypeName,dimensionIDCategory,EDataType.STRING);
  }
  return dataSetDescription;
}

Fixed version (ground truth):
/** 
 * <p> Initializes   {@link IDType}s and   {@link IDCategory} based on theinformation provides in the  {@link DataSetDescription}. </p> <p> Creates default values as specified in the   {@link IDSpecification}, or creates default values for <code>IDSpecification</code>s themselves if necessary. </p>
 * @param dataSetDescription the  {@link DataSetDescription} containing the externallyspecified information about IDs
 * @return the {@link DataSetDescription} enriched by default values
 */
public static DataSetDescription initIDs(DataSetDescription dataSetDescription){
  String dimensionIDCategoryName;
  String dimensionIDTypeName;
  String recordIDCategoryName;
  String recordIDTypeName;
  IDTypeParsingRules recordIDTypeParsingRules;
  IDTypeParsingRules dimensionIDTypeParsingRules;
  IDSpecification rowIDSpecification=dataSetDescription.getRowIDSpecification();
  if (rowIDSpecification == null) {
    rowIDSpecification=new IDSpecification();
    rowIDSpecification.setIDSpecification(dataSetDescription.getDataSetName() + "String_Node_Str",dataSetDescription.getDataSetName() + "String_Node_Str");
    dataSetDescription.setRowIDSpecification(rowIDSpecification);
    Logger.log(new Status(Status.INFO,"String_Node_Str","String_Node_Str" + dataSetDescription.getDataSetName()));
  }
  IDSpecification columnIDSpecification=dataSetDescription.getColumnIDSpecification();
  if (columnIDSpecification == null) {
    columnIDSpecification=new IDSpecification();
    columnIDSpecification.setIDSpecification(dataSetDescription.getDataSetName() + "String_Node_Str",dataSetDescription.getDataSetName() + "String_Node_Str");
    dataSetDescription.setColumnIDSpecification(columnIDSpecification);
    Logger.log(new Status(Status.INFO,"String_Node_Str","String_Node_Str" + dataSetDescription.getDataSetName()));
  }
  if (rowIDSpecification.getIdCategory() == null) {
    rowIDSpecification.setIdCategory(rowIDSpecification.getIdType());
  }
  if (columnIDSpecification.getIdCategory() == null) {
    columnIDSpecification.setIdCategory(columnIDSpecification.getIdType());
  }
  if (dataSetDescription.isTransposeMatrix()) {
    dimensionIDTypeName=rowIDSpecification.getIdType();
    dimensionIDCategoryName=rowIDSpecification.getIdCategory();
    dimensionIDTypeParsingRules=rowIDSpecification.getIdTypeParsingRules();
    recordIDTypeName=columnIDSpecification.getIdType();
    recordIDCategoryName=columnIDSpecification.getIdCategory();
    recordIDTypeParsingRules=columnIDSpecification.getIdTypeParsingRules();
  }
 else {
    dimensionIDTypeName=columnIDSpecification.getIdType();
    dimensionIDCategoryName=columnIDSpecification.getIdCategory();
    dimensionIDTypeParsingRules=columnIDSpecification.getIdTypeParsingRules();
    recordIDTypeName=rowIDSpecification.getIdType();
    recordIDCategoryName=rowIDSpecification.getIdCategory();
    recordIDTypeParsingRules=rowIDSpecification.getIdTypeParsingRules();
  }
  if (dimensionIDCategoryName == null)   dimensionIDCategoryName=dimensionIDTypeName;
  if (recordIDCategoryName == null)   recordIDCategoryName=recordIDTypeName;
  IDCategory dimensionIDCategory=IDCategory.getIDCategory(dimensionIDCategoryName);
  if (dimensionIDCategory == null) {
    dimensionIDCategory=IDCategory.registerCategory(dimensionIDCategoryName);
  }
  IDCategory recodIDCategory=IDCategory.getIDCategory(recordIDCategoryName);
  if (recodIDCategory == null) {
    recodIDCategory=IDCategory.registerCategory(recordIDCategoryName);
  }
  IDType recordIDType=IDType.getIDType(recordIDTypeName);
  if (recordIDType == null) {
    recordIDType=IDType.registerType(recordIDTypeName,recodIDCategory,EDataType.STRING);
    recordIDType.setIdTypeParsingRules(recordIDTypeParsingRules);
  }
  IDType dimensionIDType=IDType.getIDType(dimensionIDTypeName);
  if (dimensionIDType == null) {
    dimensionIDType=IDType.registerType(dimensionIDTypeName,dimensionIDCategory,EDataType.STRING);
    dimensionIDType.setIdTypeParsingRules(dimensionIDTypeParsingRules);
  }
  return dataSetDescription;
}