Program: 57352
Project: 57352
Buggy source:
/** 
 * <p> Creates the   {@link Table} and the {@link AColumn}s for the   {@link Table}, as well as the raw data columns to be set into the columns, which are also stored in   {@link #targetRawContainer}. </p> <p> Also creates the mapping of columnIDs to column labels in the   {@link IDMappingManager}</p>
 */
@SuppressWarnings("String_Node_Str") private void initializTables(){
  Table table=dataDomain.getTable();
  ArrayList<ColumnDescription> parsingPattern=dataSetDescription.getOrCreateParsingPattern();
  String[] headers=null;
  if (dataSetDescription.isContainsColumnIDs()) {
    try {
      BufferedReader reader=GeneralManager.get().getResourceLoader().getResource(filePath);
      Integer rowOfColumnIDs=dataSetDescription.getNumberOfHeaderLines() - 1;
      if (dataSetDescription.getRowOfColumnIDs() != null)       rowOfColumnIDs=dataSetDescription.getRowOfColumnIDs();
      for (int rowCount=0; rowCount < rowOfColumnIDs; rowCount++) {
        reader.readLine();
      }
      String headerLine=reader.readLine();
      headers=headerLine.split(dataSetDescription.getDelimiter());
      reader.close();
    }
 catch (    Exception e) {
      Logger.log(new Status(IStatus.ERROR,this.toString(),"String_Node_Str",e));
      throw new IllegalStateException("String_Node_Str" + filePath + "String_Node_Str",e);
    }
  }
  calculateNumberOfLinesInFile();
  int numberOfDataLines=numberOfLinesInFile - dataSetDescription.getNumberOfHeaderLines();
  IDMappingManager columnIDMappingManager;
  IDType targetColumnIDType;
  IDType sourceColumnIDType=IDType.getIDType(dataSetDescription.getColumnIDSpecification().getIdType());
  IDTypeParsingRules parsingRules=null;
  if (dataSetDescription.getColumnIDSpecification().getIdTypeParsingRules() != null)   parsingRules=dataSetDescription.getColumnIDSpecification().getIdTypeParsingRules();
 else   if (sourceColumnIDType.getIdTypeParsingRules() != null)   parsingRules=sourceColumnIDType.getIdTypeParsingRules();
  if (!dataDomain.getDataSetDescription().isTransposeMatrix()) {
    columnIDMappingManager=dataDomain.getDimensionIDMappingManager();
    targetColumnIDType=dataDomain.getDimensionIDType();
  }
 else {
    columnIDMappingManager=dataDomain.getRecordIDMappingManager();
    targetColumnIDType=dataDomain.getRecordIDType();
  }
  MappingType mappingType=columnIDMappingManager.createMap(targetColumnIDType,sourceColumnIDType,false,true);
  int columnID;
  DataDescription dataDescription=dataSetDescription.getDataDescription();
  for (  ColumnDescription columnDescription : parsingPattern) {
    if (columnDescription.getDataDescription() != null) {
      dataDescription=columnDescription.getDataDescription();
    }
switch (dataDescription.getDataClass()) {
case REAL_NUMBER:
{
        FloatContainer container=new FloatContainer(numberOfDataLines);
        targetRawContainer.add(container);
        NumericalColumn<FloatContainer,Float> column=new NumericalColumn<>(dataDescription);
        column.setRawData(container);
        columnID=table.addColumn(column);
        break;
      }
case NATURAL_NUMBER:
{
      IntContainer container=new IntContainer(numberOfDataLines);
      targetRawContainer.add(container);
      NumericalColumn<IntContainer,Integer> column;
      column=new NumericalColumn<>(dataDescription);
      column.setRawData(container);
      columnID=table.addColumn(column);
      break;
    }
case CATEGORICAL:
switch (dataDescription.getRawDataType()) {
case STRING:
    CategoricalColumn<String> categoricalColumn;
  CategoricalContainer<String> categoricalContainer;
categoricalContainer=new CategoricalContainer<String>(numberOfDataLines,EDataType.STRING,CategoricalContainer.UNKNOWN_CATEOGRY_STRING);
targetRawContainer.add(categoricalContainer);
categoricalColumn=new CategoricalColumn<String>(dataDescription);
categoricalColumn.setRawData(categoricalContainer);
if (table instanceof CategoricalTable<?>) {
categoricalColumn.setCategoryDescriptions(((CategoricalTable<String>)table).getCategoryDescriptions());
}
 else {
categoricalColumn.setCategoryDescriptions((CategoricalClassDescription<String>)dataDescription.getCategoricalClassDescription());
}
columnID=table.addColumn(categoricalColumn);
break;
case INTEGER:
CategoricalColumn<Integer> categoricalIntColumn;
CategoricalContainer<Integer> categoricalIntContainer;
categoricalIntContainer=new CategoricalContainer<Integer>(numberOfDataLines,EDataType.INTEGER,CategoricalContainer.UNKNOWN_CATEGORY_INT);
targetRawContainer.add(categoricalIntContainer);
categoricalIntColumn=new CategoricalColumn<Integer>(dataDescription);
categoricalIntColumn.setRawData(categoricalIntContainer);
if (table instanceof CategoricalTable<?>) {
categoricalIntColumn.setCategoryDescriptions(((CategoricalTable<Integer>)table).getCategoryDescriptions());
}
 else {
categoricalIntColumn.setCategoryDescriptions((CategoricalClassDescription<Integer>)dataDescription.getCategoricalClassDescription());
}
columnID=table.addColumn(categoricalIntColumn);
break;
case FLOAT:
default :
throw new IllegalStateException("String_Node_Str" + dataDescription.getRawDataType() + "String_Node_Str"+ dataDescription.getDataClass());
}
break;
case UNIQUE_OBJECT:
default :
throw new IllegalStateException("String_Node_Str" + columnDescription + "String_Node_Str"+ parsingPattern);
}
if (headers != null) {
String idString=headers[columnDescription.getColumn()];
idString=convertID(idString,parsingRules);
columnIDMappingManager.addMapping(mappingType,columnID,idString);
}
 else {
columnIDMappingManager.addMapping(mappingType,columnID,"String_Node_Str" + columnID);
}
}
}

Fixed version (ground truth):
/** 
 * <p> Creates the   {@link Table} and the {@link AColumn}s for the   {@link Table}, as well as the raw data columns to be set into the columns, which are also stored in   {@link #targetRawContainer}. </p> <p> Also creates the mapping of columnIDs to column labels in the   {@link IDMappingManager}</p>
 */
@SuppressWarnings("String_Node_Str") private void initializTables(){
  Table table=dataDomain.getTable();
  ArrayList<ColumnDescription> parsingPattern=dataSetDescription.getOrCreateParsingPattern();
  String[] headers=null;
  if (dataSetDescription.isContainsColumnIDs()) {
    try {
      BufferedReader reader=GeneralManager.get().getResourceLoader().getResource(filePath);
      Integer rowOfColumnIDs=dataSetDescription.getNumberOfHeaderLines() - 1;
      if (dataSetDescription.getRowOfColumnIDs() != null)       rowOfColumnIDs=dataSetDescription.getRowOfColumnIDs();
      for (int rowCount=0; rowCount < rowOfColumnIDs; rowCount++) {
        reader.readLine();
      }
      String headerLine=reader.readLine();
      headers=headerLine.split(dataSetDescription.getDelimiter());
      reader.close();
    }
 catch (    Exception e) {
      Logger.log(new Status(IStatus.ERROR,this.toString(),"String_Node_Str",e));
      throw new IllegalStateException("String_Node_Str" + filePath + "String_Node_Str",e);
    }
  }
  calculateNumberOfLinesInFile();
  int numberOfDataLines=numberOfLinesInFile - dataSetDescription.getNumberOfHeaderLines();
  IDMappingManager columnIDMappingManager;
  IDType targetColumnIDType;
  IDType sourceColumnIDType=IDType.getIDType(dataSetDescription.getColumnIDSpecification().getIdType());
  IDTypeParsingRules parsingRules=null;
  if (dataSetDescription.getColumnIDSpecification().getIdTypeParsingRules() != null)   parsingRules=dataSetDescription.getColumnIDSpecification().getIdTypeParsingRules();
 else   if (sourceColumnIDType.getIdTypeParsingRules() != null)   parsingRules=sourceColumnIDType.getIdTypeParsingRules();
  if (!dataDomain.getDataSetDescription().isTransposeMatrix()) {
    columnIDMappingManager=dataDomain.getDimensionIDMappingManager();
    targetColumnIDType=dataDomain.getDimensionIDType();
  }
 else {
    columnIDMappingManager=dataDomain.getRecordIDMappingManager();
    targetColumnIDType=dataDomain.getRecordIDType();
  }
  MappingType mappingType=columnIDMappingManager.createMap(targetColumnIDType,sourceColumnIDType,false,true);
  int columnID;
  DataDescription dataDescription=dataSetDescription.getDataDescription();
  for (  ColumnDescription columnDescription : parsingPattern) {
    if (columnDescription.getDataDescription() != null) {
      dataDescription=columnDescription.getDataDescription();
    }
switch (dataDescription.getDataClass()) {
case REAL_NUMBER:
{
        FloatContainer container=new FloatContainer(numberOfDataLines);
        targetRawContainer.add(container);
        NumericalColumn<FloatContainer,Float> column=new NumericalColumn<>(dataDescription);
        column.setRawData(container);
        columnID=table.addColumn(column);
        break;
      }
case NATURAL_NUMBER:
{
      IntContainer container=new IntContainer(numberOfDataLines);
      targetRawContainer.add(container);
      NumericalColumn<IntContainer,Integer> column;
      column=new NumericalColumn<>(dataDescription);
      column.setRawData(container);
      columnID=table.addColumn(column);
      break;
    }
case CATEGORICAL:
switch (dataDescription.getRawDataType()) {
case STRING:
    CategoricalColumn<String> categoricalColumn;
  CategoricalContainer<String> categoricalContainer;
categoricalContainer=new CategoricalContainer<String>(numberOfDataLines,EDataType.STRING,CategoricalContainer.UNKNOWN_CATEOGRY_STRING);
targetRawContainer.add(categoricalContainer);
categoricalColumn=new CategoricalColumn<String>(dataDescription);
categoricalColumn.setRawData(categoricalContainer);
if (table instanceof CategoricalTable<?>) {
categoricalColumn.setCategoryDescriptions(((CategoricalTable<String>)table).getCategoryDescriptions());
}
 else if (dataDescription.getCategoricalClassDescription() != null) {
categoricalColumn.setCategoryDescriptions((CategoricalClassDescription<String>)dataDescription.getCategoricalClassDescription());
}
columnID=table.addColumn(categoricalColumn);
break;
case INTEGER:
CategoricalColumn<Integer> categoricalIntColumn;
CategoricalContainer<Integer> categoricalIntContainer;
categoricalIntContainer=new CategoricalContainer<Integer>(numberOfDataLines,EDataType.INTEGER,CategoricalContainer.UNKNOWN_CATEGORY_INT);
targetRawContainer.add(categoricalIntContainer);
categoricalIntColumn=new CategoricalColumn<Integer>(dataDescription);
categoricalIntColumn.setRawData(categoricalIntContainer);
if (table instanceof CategoricalTable<?>) {
categoricalIntColumn.setCategoryDescriptions(((CategoricalTable<Integer>)table).getCategoryDescriptions());
}
 else if (dataDescription.getCategoricalClassDescription() != null) {
categoricalIntColumn.setCategoryDescriptions((CategoricalClassDescription<Integer>)dataDescription.getCategoricalClassDescription());
}
columnID=table.addColumn(categoricalIntColumn);
break;
case FLOAT:
default :
throw new IllegalStateException("String_Node_Str" + dataDescription.getRawDataType() + "String_Node_Str"+ dataDescription.getDataClass());
}
break;
case UNIQUE_OBJECT:
GenericContainer<String> container=new GenericContainer<>(numberOfDataLines);
targetRawContainer.add(container);
GenericColumn<String> column=new GenericColumn<>(dataDescription);
column.setRawData(container);
columnID=table.addColumn(column);
break;
default :
throw new IllegalStateException("String_Node_Str" + columnDescription + "String_Node_Str"+ parsingPattern);
}
if (headers != null) {
String idString=headers[columnDescription.getColumn()];
idString=convertID(idString,parsingRules);
columnIDMappingManager.addMapping(mappingType,columnID,idString);
}
 else {
columnIDMappingManager.addMapping(mappingType,columnID,"String_Node_Str" + columnID);
}
}
}