Program: 57487
Project: 57487
Buggy source:
public void createTablePerspeciveByRowID(ATableBasedDataDomain dataDomain,int rowID,IDType sourceRowIDType,boolean isTablePerspectivePrivate){
  IDType rowIDType=null;
  if (dataDomain.isColumnDimension()) {
    rowIDType=dataDomain.getRecordIDType();
  }
 else {
    rowIDType=dataDomain.getDimensionIDType();
  }
  IDMappingManager idMappingManager=IDMappingManagerRegistry.get().getIDMappingManager(sourceRowIDType);
  List<Integer> ids=new ArrayList<Integer>();
  Integer convertedID=idMappingManager.getID(sourceRowIDType,rowIDType,rowID);
  if (convertedID == null)   return;
  ids.add(convertedID);
  AVariablePerspective<?,?,?,?> perspective;
  if (dataDomain.isColumnDimension()) {
    perspective=new RecordPerspective(dataDomain);
    dataDomain.getTable().registerRecordPerspective((RecordPerspective)perspective,false);
  }
 else {
    perspective=new DimensionPerspective(dataDomain);
    dataDomain.getTable().registerDimensionPerspective((DimensionPerspective)perspective,false);
  }
  perspective.setPrivate(true);
  String label=idMappingManager.getID(sourceRowIDType,rowIDType.getIDCategory().getHumanReadableIDType(),rowID);
  perspective.setLabel(label,false);
  PerspectiveInitializationData data=new PerspectiveInitializationData();
  data.setData(ids);
  perspective.init(data);
  RecordPerspective binnedPerspective=null;
  int numberOfBins=1;
  if (dataDomain.getLabel().contains("String_Node_Str")) {
    for (    String recordPerspectiveID : dataDomain.getTable().getRecordPerspectiveIDs()) {
      RecordPerspective recordPerspective=dataDomain.getTable().getRecordPerspective(recordPerspectiveID);
      ArrayList<String> groupLabels=new ArrayList<String>();
      groupLabels.add("String_Node_Str");
      groupLabels.add("String_Node_Str");
      groupLabels.add("String_Node_Str");
      groupLabels.add("String_Node_Str");
      groupLabels.add("String_Node_Str");
      numberOfBins=5;
      binnedPerspective=binRecords(numberOfBins,convertedID,recordPerspective,dataDomain,label,groupLabels);
      break;
    }
  }
  if (dataDomain.getLabel().contains("String_Node_Str")) {
    for (    String recordPerspectiveID : dataDomain.getTable().getRecordPerspectiveIDs()) {
      RecordPerspective recordPerspective=dataDomain.getTable().getRecordPerspective(recordPerspectiveID);
      ArrayList<String> groupLabels=new ArrayList<String>();
      groupLabels.add("String_Node_Str");
      groupLabels.add("String_Node_Str");
      numberOfBins=2;
      binnedPerspective=binRecords(numberOfBins,convertedID,recordPerspective,dataDomain,label,groupLabels);
      break;
    }
  }
  if (binnedPerspective != null) {
    boolean existsAlready=false;
    if (dataDomain.hasTablePerspective(binnedPerspective.getPerspectiveID(),perspective.getPerspectiveID()))     existsAlready=true;
    TablePerspective tablePerspective=dataDomain.getTablePerspective(binnedPerspective.getPerspectiveID(),perspective.getPerspectiveID(),false);
    tablePerspective.setLabel(label,false);
    if (!existsAlready)     tablePerspective.setPrivate(true);
    tablePerspective.getContainerStatistics().setNumberOfBucketsForHistogram(numberOfBins);
  }
}

Fixed version (ground truth):
public void createTablePerspeciveByRowID(ATableBasedDataDomain dataDomain,int rowID,IDType sourceRowIDType,boolean isTablePerspectivePrivate){
  IDType rowIDType=null;
  if (dataDomain.isColumnDimension()) {
    rowIDType=dataDomain.getRecordIDType();
  }
 else {
    rowIDType=dataDomain.getDimensionIDType();
  }
  IDMappingManager idMappingManager=IDMappingManagerRegistry.get().getIDMappingManager(sourceRowIDType);
  List<Integer> ids=new ArrayList<Integer>();
  Integer convertedID=idMappingManager.getID(sourceRowIDType,rowIDType,rowID);
  if (convertedID == null)   return;
  ids.add(convertedID);
  AVariablePerspective<?,?,?,?> perspective;
  if (dataDomain.isColumnDimension()) {
    perspective=new RecordPerspective(dataDomain);
    dataDomain.getTable().registerRecordPerspective((RecordPerspective)perspective,false);
  }
 else {
    perspective=new DimensionPerspective(dataDomain);
    dataDomain.getTable().registerDimensionPerspective((DimensionPerspective)perspective,false);
  }
  perspective.setPrivate(isTablePerspectivePrivate);
  String label=idMappingManager.getID(sourceRowIDType,rowIDType.getIDCategory().getHumanReadableIDType(),rowID);
  perspective.setLabel(label,false);
  PerspectiveInitializationData data=new PerspectiveInitializationData();
  data.setData(ids);
  perspective.init(data);
  RecordPerspective binnedPerspective=null;
  int numberOfBins=1;
  if (dataDomain.getLabel().contains("String_Node_Str")) {
    for (    String recordPerspectiveID : dataDomain.getTable().getRecordPerspectiveIDs()) {
      RecordPerspective recordPerspective=dataDomain.getTable().getRecordPerspective(recordPerspectiveID);
      ArrayList<String> groupLabels=new ArrayList<String>();
      groupLabels.add("String_Node_Str");
      groupLabels.add("String_Node_Str");
      groupLabels.add("String_Node_Str");
      groupLabels.add("String_Node_Str");
      groupLabels.add("String_Node_Str");
      numberOfBins=5;
      binnedPerspective=binRecords(numberOfBins,convertedID,recordPerspective,dataDomain,label,groupLabels,isTablePerspectivePrivate);
      break;
    }
  }
  if (dataDomain.getLabel().contains("String_Node_Str")) {
    for (    String recordPerspectiveID : dataDomain.getTable().getRecordPerspectiveIDs()) {
      RecordPerspective recordPerspective=dataDomain.getTable().getRecordPerspective(recordPerspectiveID);
      ArrayList<String> groupLabels=new ArrayList<String>();
      groupLabels.add("String_Node_Str");
      groupLabels.add("String_Node_Str");
      numberOfBins=2;
      binnedPerspective=binRecords(numberOfBins,convertedID,recordPerspective,dataDomain,label,groupLabels,isTablePerspectivePrivate);
      break;
    }
  }
  if (binnedPerspective != null) {
    boolean existsAlready=false;
    if (dataDomain.hasTablePerspective(binnedPerspective.getPerspectiveID(),perspective.getPerspectiveID()))     existsAlready=true;
    TablePerspective tablePerspective=dataDomain.getTablePerspective(binnedPerspective.getPerspectiveID(),perspective.getPerspectiveID(),false);
    tablePerspective.setLabel(label,false);
    if (!existsAlready)     tablePerspective.setPrivate(isTablePerspectivePrivate);
    tablePerspective.getContainerStatistics().setNumberOfBucketsForHistogram(numberOfBins);
  }
}