nus-yam/ex-repair huggingface dataset:
Program: 65932
Project: 65932
Buggy source:
/** 
 * @param name
 * @param documentManager
 * @param dimensionInfo
 * @param measureInfo
 * @param segmentCount
 * @param dimensionDivision
 */
FactTable(String name,IDocumentManager documentManager,DimensionInfo[] dimensionInfo,MeasureInfo[] measureInfo,int segmentCount,DimensionDivision[] dimensionDivision){
  Object[] params={name,documentManager,dimensionInfo,measureInfo,Integer.valueOf(segmentCount),dimensionDivision};
  logger.entering(FactTable.class.getName(),"String_Node_Str",params);
  this.name=name;
  this.dimensionInfo=dimensionInfo;
  this.measureInfo=measureInfo;
  this.segmentCount=segmentCount;
  this.dimensionDivision=dimensionDivision;
  this.documentManager=documentManager;
  this.combinedPositionCalculator=new CombinedPositionContructor(dimensionDivision);
  logger.exiting(FactTable.class.getName(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param name
 * @param documentManager
 * @param dimensionInfo
 * @param measureInfo
 * @param segmentCount
 * @param dimensionDivision
 */
FactTable(String name,IDocumentManager documentManager,DimensionInfo[] dimensionInfo,MeasureInfo[] measureInfo,MeasureInfo[] calculatedMeasureInfo,int segmentCount,DimensionDivision[] dimensionDivision){
  Object[] params={name,documentManager,dimensionInfo,measureInfo,Integer.valueOf(segmentCount),dimensionDivision};
  logger.entering(FactTable.class.getName(),"String_Node_Str",params);
  this.name=name;
  this.dimensionInfo=dimensionInfo;
  this.measureInfo=measureInfo;
  this.calculatedMeasureInfo=calculatedMeasureInfo;
  this.segmentCount=segmentCount;
  this.dimensionDivision=dimensionDivision;
  this.documentManager=documentManager;
  this.combinedPositionCalculator=new CombinedPositionContructor(dimensionDivision);
  logger.exiting(FactTable.class.getName(),"String_Node_Str");
}
Program: 65933
Project: 65933
Buggy source:
/** 
 * @param factTableName
 * @param stopSign
 * @return
 * @throws IOException
 */
public FactTable load(String factTableName,StopSign stopSign) throws IOException {
  int segmentNumber=0;
  IDocumentObject documentObject=documentManager.openDocumentObject(NamingUtil.getFactTableName(factTableName));
  DimensionInfo[] dimensionInfo=new DimensionInfo[documentObject.readInt()];
  for (int i=0; i < dimensionInfo.length; i++) {
    dimensionInfo[i]=new DimensionInfo();
    dimensionInfo[i].dimensionName=documentObject.readString();
    dimensionInfo[i].dimensionLength=documentObject.readInt();
  }
  MeasureInfo[] measureInfo=new MeasureInfo[documentObject.readInt()];
  for (int i=0; i < measureInfo.length; i++) {
    measureInfo[i]=new MeasureInfo(documentObject.readString(),documentObject.readInt());
  }
  segmentNumber=documentObject.readInt();
  int[] dimensionMemberCount=new int[dimensionInfo.length];
  for (int i=0; i < dimensionInfo.length; i++) {
    dimensionMemberCount[i]=dimensionInfo[i].dimensionLength;
  }
  DimensionDivision[] subDimensions=calculateDimensionDivision(dimensionMemberCount,segmentNumber);
  documentObject.close();
  return new FactTable(factTableName,documentManager,dimensionInfo,measureInfo,segmentNumber,subDimensions);
}

Fixed version (ground truth):
/** 
 * @param factTableName
 * @param stopSign
 * @return
 * @throws IOException
 */
public FactTable load(String factTableName,StopSign stopSign) throws IOException {
  int segmentNumber=0;
  IDocumentObject documentObject=documentManager.openDocumentObject(NamingUtil.getFactTableName(factTableName));
  DimensionInfo[] dimensionInfo=new DimensionInfo[documentObject.readInt()];
  for (int i=0; i < dimensionInfo.length; i++) {
    dimensionInfo[i]=new DimensionInfo();
    dimensionInfo[i].dimensionName=documentObject.readString();
    dimensionInfo[i].dimensionLength=documentObject.readInt();
  }
  int measureSize=documentObject.readInt();
  List<MeasureInfo> measureInfoList=new ArrayList<MeasureInfo>();
  List<MeasureInfo> calMeasureInfoList=new ArrayList<MeasureInfo>();
  for (int i=0; i < measureSize; i++) {
    String measureName=documentObject.readString();
    if (measureName.startsWith(NamingUtil.DERIVED_MEASURE_PREFIX)) {
      calMeasureInfoList.add(new MeasureInfo(NamingUtil.getMeasureName(measureName),documentObject.readInt()));
    }
 else {
      measureInfoList.add(new MeasureInfo(measureName,documentObject.readInt()));
    }
  }
  MeasureInfo[] measureInfo=(MeasureInfo[])measureInfoList.toArray(new MeasureInfo[0]);
  MeasureInfo[] calMeasureInfo=(MeasureInfo[])calMeasureInfoList.toArray(new MeasureInfo[0]);
  segmentNumber=documentObject.readInt();
  int[] dimensionMemberCount=new int[dimensionInfo.length];
  for (int i=0; i < dimensionInfo.length; i++) {
    dimensionMemberCount[i]=dimensionInfo[i].dimensionLength;
  }
  DimensionDivision[] subDimensions=calculateDimensionDivision(dimensionMemberCount,segmentNumber);
  documentObject.close();
  return new FactTable(factTableName,documentManager,dimensionInfo,measureInfo,calMeasureInfo,segmentNumber,subDimensions);
}
Program: 65934
Project: 65934
Buggy source:
/** 
 * @param factTableName
 * @param dimensionInfo
 * @param measureInfo
 * @param segmentNumber
 * @throws IOException
 * @throws BirtException
 */
private void saveFactTableMetadata(String factTableName,DimensionInfo[] dimensionInfo,MeasureInfo[] measureInfo,int segmentNumber) throws IOException, BirtException {
  IDocumentObject documentObject=documentManager.createDocumentObject(NamingUtil.getFactTableName(factTableName));
  documentObject.writeInt(dimensionInfo.length);
  for (int i=0; i < dimensionInfo.length; i++) {
    documentObject.writeString(dimensionInfo[i].dimensionName);
    documentObject.writeInt(dimensionInfo[i].dimensionLength);
  }
  documentObject.writeInt(measureInfo.length);
  for (int i=0; i < measureInfo.length; i++) {
    documentObject.writeString(measureInfo[i].getMeasureName());
    documentObject.writeInt(measureInfo[i].getDataType());
  }
  documentObject.writeInt(segmentNumber);
  documentObject.close();
}

Fixed version (ground truth):
/** 
 * @param factTableName
 * @param dimensionInfo
 * @param measureInfo
 * @param segmentNumber
 * @throws IOException
 * @throws BirtException
 */
private void saveFactTableMetadata(String factTableName,DimensionInfo[] dimensionInfo,MeasureInfo[] measureInfo,MeasureInfo[] calculatedMeasureInfo,int segmentNumber) throws IOException, BirtException {
  IDocumentObject documentObject=documentManager.createDocumentObject(NamingUtil.getFactTableName(factTableName));
  documentObject.writeInt(dimensionInfo.length);
  for (int i=0; i < dimensionInfo.length; i++) {
    documentObject.writeString(dimensionInfo[i].dimensionName);
    documentObject.writeInt(dimensionInfo[i].dimensionLength);
  }
  documentObject.writeInt(measureInfo.length + calculatedMeasureInfo.length);
  for (int i=0; i < measureInfo.length; i++) {
    documentObject.writeString(measureInfo[i].getMeasureName());
    documentObject.writeInt(measureInfo[i].getDataType());
  }
  for (int i=0; i < calculatedMeasureInfo.length; i++) {
    documentObject.writeString(calculatedMeasureInfo[i].getMeasureName());
    documentObject.writeInt(calculatedMeasureInfo[i].getDataType());
  }
  documentObject.writeInt(segmentNumber);
  documentObject.close();
}
Program: 65935
Project: 65935
Buggy source:
public FactTable saveFactTable(String factTableName,String[][] factTableJointColumnNames,String[][] DimJointColumnNames,IDatasetIterator iterator,Dimension[] dimensions,String[] measureColumnName,StopSign stopSign) throws BirtException, IOException {
  return this.saveFactTable(factTableName,factTableJointColumnNames,DimJointColumnNames,iterator,dimensions,measureColumnName,null,stopSign);
}

Fixed version (ground truth):
public FactTable saveFactTable(String factTableName,String[][] factTableJointColumnNames,String[][] DimJointColumnNames,IDatasetIterator iterator,Dimension[] dimensions,String[] measureColumnName,StopSign stopSign) throws BirtException, IOException {
  return this.saveFactTable(factTableName,factTableJointColumnNames,DimJointColumnNames,iterator,dimensions,measureColumnName,null,null,stopSign);
}
Program: 65936
Project: 65936
Buggy source:
public String getDefaultAnalysisType(String columnName,String dataType){
  String defaultAnalysisType=null;
  if (dataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_INTEGER) || dataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_FLOAT) || dataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_DECIMAL)) {
    defaultAnalysisType=DesignChoiceConstants.ANALYSIS_TYPE_MEASURE;
  }
 else   if (dataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_STRING)) {
    defaultAnalysisType=DesignChoiceConstants.ANALYSIS_TYPE_ATTRIBUTE;
  }
 else   if (dataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_TIME) || dataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_DATE) || dataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_DATETIME)) {
    defaultAnalysisType=DesignChoiceConstants.ANALYSIS_TYPE_DIMENSION;
  }
  if (columnName.length() >= 3) {
    String lastThreeLetters=columnName.substring(columnName.length() - 3);
    if (lastThreeLetters.equalsIgnoreCase("String_Node_Str")) {
      defaultAnalysisType=DesignChoiceConstants.ANALYSIS_TYPE_DIMENSION;
    }
  }
  if (columnName.length() >= 2) {
    String lastTwoLetters=columnName.substring(columnName.length() - 2);
    if (lastTwoLetters.equalsIgnoreCase("String_Node_Str")) {
      defaultAnalysisType=DesignChoiceConstants.ANALYSIS_TYPE_DIMENSION;
    }
  }
  return defaultAnalysisType;
}

Fixed version (ground truth):
public String getDefaultAnalysisType(String columnName,String dataType){
  String defaultAnalysisType=null;
  if (dataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_INTEGER) || dataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_FLOAT) || dataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_DECIMAL)|| DesignChoiceConstants.COLUMN_DATA_TYPE_JAVA_OBJECT.equals(dataType)) {
    defaultAnalysisType=DesignChoiceConstants.ANALYSIS_TYPE_MEASURE;
  }
 else   if (DesignChoiceConstants.COLUMN_DATA_TYPE_TIME.equals(dataType) || DesignChoiceConstants.COLUMN_DATA_TYPE_DATE.equals(dataType) || DesignChoiceConstants.COLUMN_DATA_TYPE_DATETIME.equals(dataType)|| DesignChoiceConstants.COLUMN_DATA_TYPE_STRING.equals(dataType)|| DesignChoiceConstants.COLUMN_DATA_TYPE_BOOLEAN.equals(dataType)) {
    defaultAnalysisType=DesignChoiceConstants.ANALYSIS_TYPE_DIMENSION;
  }
  return defaultAnalysisType;
}
Program: 65938
Project: 65938
Buggy source:
/** 
 * Reusable 'strokes' for rendering lines may be obtained from here
 * @param ls
 * @return stroke
 */
public final Stroke getCachedStroke(LineAttributes lia){
  if (lia == null)   return null;
  Stroke s=_htLineStyles.get(lia);
  if (s == null) {
    BasicStroke bs=null;
    final int thickness=lia.getThickness();
    if (lia.getStyle().getValue() == LineStyle.DASHED) {
      float[] faStyle=new float[]{6 * thickness,4 * thickness};
      bs=new BasicStroke(thickness,BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND,0,faStyle,0);
    }
 else     if (lia.getStyle().getValue() == LineStyle.DOTTED) {
      float[] faStyle=new float[]{thickness,4 * thickness};
      bs=new BasicStroke(thickness,BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND,0,faStyle,0);
    }
 else     if (lia.getStyle().getValue() == LineStyle.DASH_DOTTED) {
      float[] faStyle=new float[]{6 * thickness,4 * thickness,thickness,4 * thickness};
      bs=new BasicStroke(thickness,BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND,0,faStyle,0);
    }
 else     if (lia.getStyle().getValue() == LineStyle.SOLID) {
      bs=new BasicStroke(thickness,BasicStroke.CAP_SQUARE,BasicStroke.JOIN_ROUND);
    }
    if (bs != null) {
      _htLineStyles.put(lia,bs);
    }
    return bs;
  }
  return s;
}

Fixed version (ground truth):
/** 
 * Reusable 'strokes' for rendering lines may be obtained from here
 * @param ls
 * @return stroke
 */
public final Stroke getCachedStroke(LineAttributes lia){
  if (lia == null)   return null;
  Stroke s=_htLineStyles.get(lia);
  if (s == null) {
    BasicStroke bs=null;
    int thickness=lia.getThickness();
    if (thickness == 0) {
      thickness=1;
    }
    if (lia.getStyle().getValue() == LineStyle.DASHED) {
      float[] faStyle=new float[]{6 * thickness,4 * thickness};
      bs=new BasicStroke(lia.getThickness(),BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND,0,faStyle,0);
    }
 else     if (lia.getStyle().getValue() == LineStyle.DOTTED) {
      float[] faStyle=new float[]{thickness,4 * thickness};
      bs=new BasicStroke(lia.getThickness(),BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND,0,faStyle,0);
    }
 else     if (lia.getStyle().getValue() == LineStyle.DASH_DOTTED) {
      float[] faStyle=new float[]{6 * thickness,4 * thickness,thickness,4 * thickness};
      bs=new BasicStroke(lia.getThickness(),BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND,0,faStyle,0);
    }
 else     if (lia.getStyle().getValue() == LineStyle.SOLID) {
      bs=new BasicStroke(lia.getThickness(),BasicStroke.CAP_SQUARE,BasicStroke.JOIN_ROUND);
    }
    if (bs != null) {
      _htLineStyles.put(lia,bs);
    }
    return bs;
  }
  return s;
}
Program: 65939
Project: 65939
Buggy source:
/** 
 * Constructor for the BufferedRandomAccessFile object
 * @param file Description of Parameter
 * @param mode Description of Parameter
 * @param bufferSize Description of Parameter
 * @exception IOException Description of Exception
 */
public AbstractBufferedRandomAccessObject(int bufferSize) throws IOException {
  if (bufferSize < 1) {
    throw new Error("String_Node_Str");
  }
  currBuf=new FileBufferStruct();
  altBuf=new FileBufferStruct();
  currBuf.bytes=new byte[bufferSize];
  currBuf.modified=false;
  altBuf.bytes=new byte[bufferSize];
  altBuf.filePos=-1;
}

Fixed version (ground truth):
/** 
 * Constructor for the BufferedRandomAccessFile object
 * @param file Description of Parameter
 * @param mode Description of Parameter
 * @param bufferSize Description of Parameter
 * @exception IOException Description of Exception
 */
public AbstractBufferedRandomAccessObject(int bufferSize) throws IOException {
  if (bufferSize < 1) {
    throw new Error("String_Node_Str");
  }
  currBuf=new FileBufferStruct();
  currBuf.bytes=new byte[8192];
  currBuf.modified=false;
}
Program: 65940
Project: 65940
Buggy source:
public DocumentObjectCache(IDocumentManager documentManager,int cachedSize){
  this.documentManager=documentManager;
  this.cachedSize=cachedSize;
  linkedList=new LinkedList();
  map=new HashMap();
}

Fixed version (ground truth):
public DocumentObjectCache(IDocumentManager documentManager,long cachedSize){
  this.documentManager=documentManager;
  this.cachedSize=cachedSize;
  linkedList=new LinkedList();
  map=new HashMap();
}
Program: 65941
Project: 65941
Buggy source:
/** 
 * Close all cached document objects.
 * @throws IOException
 */
public void closeAll() throws IOException {
  Iterator allOjbects=map.values().iterator();
  while (allOjbects.hasNext()) {
    ((IDocumentObject)allOjbects.next()).close();
  }
}

Fixed version (ground truth):
/** 
 * Close all cached document objects.
 * @throws IOException
 */
public void closeAll() throws IOException {
  Iterator allOjbects=map.values().iterator();
  while (allOjbects.hasNext()) {
    ((IDocumentObject)allOjbects.next()).close();
  }
  map.clear();
}
Program: 65942
Project: 65942
Buggy source:
/** 
 * Get the instance of IDocumentObject by name.
 * @param name
 * @return
 * @throws IOException
 */
public IDocumentObject getIDocumentObject(String name) throws IOException {
  Object cachedObject=map.get(name);
  if (cachedObject != null) {
    return (IDocumentObject)cachedObject;
  }
  if (linkedList.size() >= cachedSize) {
    String lastName=(String)linkedList.getLast();
    linkedList.removeLast();
    ((IDocumentObject)map.get(lastName)).close();
    map.remove(lastName);
  }
  IDocumentObject newDocumentObject=documentManager.openDocumentObject(name);
  if (newDocumentObject == null) {
    newDocumentObject=documentManager.createDocumentObject(name);
  }
  newDocumentObject.seek(newDocumentObject.length());
  map.put(name,newDocumentObject);
  linkedList.addFirst(name);
  return newDocumentObject;
}

Fixed version (ground truth):
/** 
 * Get the instance of IDocumentObject by name.
 * @param name
 * @return
 * @throws IOException
 */
public IDocumentObject getIDocumentObject(String name) throws IOException {
  Object cachedObject=map.get(name);
  if (cachedObject != null) {
    return (IDocumentObject)cachedObject;
  }
  if (cachedSize != 0) {
    long size=calculateDocumentObjectsSize();
    if (size >= cachedSize) {
      String lastName=(String)linkedList.getLast();
      linkedList.removeLast();
      ((IDocumentObject)map.get(lastName)).close();
      map.remove(lastName);
    }
  }
  IDocumentObject newDocumentObject=documentManager.openDocumentObject(name);
  if (newDocumentObject == null) {
    newDocumentObject=documentManager.createDocumentObject(name);
  }
  newDocumentObject.seek(newDocumentObject.length());
  map.put(name,newDocumentObject);
  linkedList.addFirst(name);
  return newDocumentObject;
}
Program: 65943
Project: 65943
Buggy source:
private int caculateBufferSize(IDatasetIterator iterator,String[][] keyColumnNames,String[] measureColumnNames) throws BirtException {
  int[][] levelKeyColumnDataType=new int[keyColumnNames.length][];
  int[] measureColumnType=new int[measureColumnNames.length];
  for (int i=0; i < keyColumnNames.length; i++) {
    levelKeyColumnDataType[i]=new int[keyColumnNames[i].length];
    for (int j=0; j < keyColumnNames[i].length; j++) {
      levelKeyColumnDataType[i][j]=iterator.getFieldType(keyColumnNames[i][j]);
    }
  }
  for (int i=0; i < measureColumnType.length; i++) {
    measureColumnType[i]=iterator.getFieldType(measureColumnNames[i]);
  }
  int levelSize=0;
  for (int i=0; i < levelKeyColumnDataType.length; i++) {
    levelSize+=getObjectSize(levelKeyColumnDataType[i]);
  }
  int measureSize=getObjectSize(measureColumnType);
  int rowSize=16 + (4 + (levelSize + measureSize) - 1) / 8 * 8;
  return (int)(memoryCacheSize / rowSize);
}

Fixed version (ground truth):
private int caculateBufferSize(IDatasetIterator iterator,String[][] keyColumnNames,String[] measureColumnNames) throws BirtException {
  int[][] levelKeyColumnDataType=new int[keyColumnNames.length][];
  int[] measureColumnType=new int[measureColumnNames.length];
  for (int i=0; i < keyColumnNames.length; i++) {
    levelKeyColumnDataType[i]=new int[keyColumnNames[i].length];
    for (int j=0; j < keyColumnNames[i].length; j++) {
      levelKeyColumnDataType[i][j]=iterator.getFieldType(keyColumnNames[i][j]);
    }
  }
  for (int i=0; i < measureColumnType.length; i++) {
    measureColumnType[i]=iterator.getFieldType(measureColumnNames[i]);
  }
  int levelSize=0;
  for (int i=0; i < levelKeyColumnDataType.length; i++) {
    levelSize+=getObjectSize(levelKeyColumnDataType[i]);
  }
  int measureSize=getObjectSize(measureColumnType);
  int rowSize=16 + (4 + (levelSize + measureSize) - 1) / 8 * 8;
  return (int)((memoryCacheSize * 0.75) / rowSize);
}
Program: 65945
Project: 65945
Buggy source:
/** 
 * Returns all cached labels.
 * @return all cached labels.
 */
public List getAllLabels(){
  return alLabels;
}

Fixed version (ground truth):
/** 
 * Returns all cached labels.
 * @return all cached labels.
 */
public List<TextRenderEvent> getAllLabels(){
  return alLabels;
}
Program: 65946
Project: 65946
Buggy source:
/** 
 * Returns all cached markers.
 * @return all cached markers.
 */
public List getAllMarkers(){
  return alMarkers;
}

Fixed version (ground truth):
/** 
 * Returns all cached markers.
 * @return all cached markers.
 */
public List<MarkerInstruction> getAllMarkers(){
  return alMarkers;
}
Program: 65947
Project: 65947
Buggy source:
/** 
 * Flush specified blocks.
 * @param options
 * @throws ChartException
 */
public void flushOptions(int options) throws ChartException {
  fFirstDC.flushOptions(options);
  for (java.util.Iterator iter=fDeferredCacheList.iterator(); iter.hasNext(); ) {
    Object obj=iter.next();
    if (obj instanceof DeferredCache) {
      ((DeferredCache)obj).flushOptions(options);
    }
  }
  fLastDC.flushOptions(options);
}

Fixed version (ground truth):
/** 
 * Flush specified blocks.
 * @param options
 * @throws ChartException
 */
public void flushOptions(int options) throws ChartException {
  fFirstDC.flushOptions(options);
  for (java.util.Iterator<DeferredCache> iter=fDeferredCacheList.iterator(); iter.hasNext(); ) {
    Object obj=iter.next();
    if (obj instanceof DeferredCache) {
      ((DeferredCache)obj).flushOptions(options);
    }
  }
  fLastDC.flushOptions(options);
}
Program: 65948
Project: 65948
Buggy source:
/** 
 * Flush markers and lables in all caches.
 * @throws ChartException
 */
void flushMarkersNLabels() throws ChartException {
  List allMarkers=new ArrayList();
  List allLabels=new ArrayList();
  getMarkersNLabels(allMarkers,allLabels);
  DeferredCache.flushMarkers(fDeviceRenderer,allMarkers);
  DeferredCache.flushLabels(fDeviceRenderer,allLabels);
}

Fixed version (ground truth):
/** 
 * Flush markers and lables in all caches.
 * @throws ChartException
 */
void flushMarkersNLabels() throws ChartException {
  List<IRenderInstruction> allMarkers=new ArrayList<IRenderInstruction>();
  List<TextRenderEvent> allLabels=new ArrayList<TextRenderEvent>();
  getMarkersNLabels(allMarkers,allLabels);
  DeferredCache.flushMarkers(fDeviceRenderer,allMarkers);
  DeferredCache.flushLabels(fDeviceRenderer,allLabels);
}
Program: 65949
Project: 65949
Buggy source:
/** 
 * Pre-process all the 3D rendering events. This must be called before  {@link #flushAll()}.
 * @param deferredCache specified deferred cache instance.
 * @param engine
 * @param xOffset
 * @param yOffset
 * @since 2.3
 */
public void process3DEvent(DeferredCache deferredCache,Engine3D engine,double xOffset,double yOffset){
  if (deferredCache != null) {
    deferredCache.process3DEvent(engine,xOffset,yOffset);
  }
 else {
    fFirstDC.process3DEvent(engine,xOffset,yOffset);
    for (java.util.Iterator iter=fDeferredCacheList.iterator(); iter.hasNext(); ) {
      Object obj=iter.next();
      if (obj instanceof DeferredCache) {
        ((DeferredCache)obj).process3DEvent(engine,xOffset,yOffset);
      }
    }
    fLastDC.process3DEvent(engine,xOffset,yOffset);
  }
}

Fixed version (ground truth):
/** 
 * Pre-process all the 3D rendering events. This must be called before  {@link #flushAll()}.
 * @param deferredCache specified deferred cache instance.
 * @param engine
 * @param xOffset
 * @param yOffset
 * @since 2.3
 */
public void process3DEvent(DeferredCache deferredCache,Engine3D engine,double xOffset,double yOffset){
  if (deferredCache != null) {
    deferredCache.process3DEvent(engine,xOffset,yOffset);
  }
 else {
    fFirstDC.process3DEvent(engine,xOffset,yOffset);
    for (java.util.Iterator<DeferredCache> iter=fDeferredCacheList.iterator(); iter.hasNext(); ) {
      Object obj=iter.next();
      if (obj instanceof DeferredCache) {
        ((DeferredCache)obj).process3DEvent(engine,xOffset,yOffset);
      }
    }
    fLastDC.process3DEvent(engine,xOffset,yOffset);
  }
}
Program: 65950
Project: 65950
Buggy source:
/** 
 * Get markers and labels from all caches.
 * @param allMarkers
 * @param allLabels
 */
public void getMarkersNLabels(List allMarkers,List allLabels){
  allMarkers.addAll(fFirstDC.getAllMarkers());
  fFirstDC.getAllMarkers().clear();
  allLabels.addAll(fFirstDC.getAllLabels());
  fFirstDC.getAllLabels().clear();
  for (java.util.Iterator iter=fDeferredCacheList.iterator(); iter.hasNext(); ) {
    Object obj=iter.next();
    if (obj instanceof DeferredCache) {
      allMarkers.addAll(((DeferredCache)obj).getAllMarkers());
      ((DeferredCache)obj).getAllMarkers().clear();
      allLabels.addAll(((DeferredCache)obj).getAllLabels());
      ((DeferredCache)obj).getAllLabels().clear();
    }
 else     if (obj instanceof List) {
      Collections.sort((List)obj);
      for (java.util.Iterator iter1=((List)obj).iterator(); iter1.hasNext(); ) {
        DeferredCache dc=(DeferredCache)iter1.next();
        allMarkers.addAll(dc.getAllMarkers());
        dc.getAllMarkers().clear();
        allLabels.addAll(dc.getAllLabels());
        dc.getAllLabels().clear();
      }
    }
  }
  allMarkers.addAll(fLastDC.getAllMarkers());
  fLastDC.getAllMarkers().clear();
  allLabels.addAll(fLastDC.getAllLabels());
  fLastDC.getAllLabels().clear();
}

Fixed version (ground truth):
/** 
 * Get markers and labels from all caches.
 * @param allMarkers
 * @param allLabels
 */
public void getMarkersNLabels(List<IRenderInstruction> allMarkers,List<TextRenderEvent> allLabels){
  allMarkers.addAll(fFirstDC.getAllMarkers());
  fFirstDC.getAllMarkers().clear();
  allLabels.addAll(fFirstDC.getAllLabels());
  fFirstDC.getAllLabels().clear();
  for (java.util.Iterator<DeferredCache> iter=fDeferredCacheList.iterator(); iter.hasNext(); ) {
    Object obj=iter.next();
    if (obj instanceof DeferredCache) {
      allMarkers.addAll(((DeferredCache)obj).getAllMarkers());
      ((DeferredCache)obj).getAllMarkers().clear();
      allLabels.addAll(((DeferredCache)obj).getAllLabels());
      ((DeferredCache)obj).getAllLabels().clear();
    }
 else     if (obj instanceof List) {
      Collections.sort((List)obj);
      for (java.util.Iterator iter1=((List)obj).iterator(); iter1.hasNext(); ) {
        DeferredCache dc=(DeferredCache)iter1.next();
        allMarkers.addAll(dc.getAllMarkers());
        dc.getAllMarkers().clear();
        allLabels.addAll(dc.getAllLabels());
        dc.getAllLabels().clear();
      }
    }
  }
  allMarkers.addAll(fLastDC.getAllMarkers());
  fLastDC.getAllMarkers().clear();
  allLabels.addAll(fLastDC.getAllLabels());
  fLastDC.getAllLabels().clear();
}
Program: 65951
Project: 65951
Buggy source:
protected void createEditPolicies(){
  installEditPolicy(EditPolicy.COMPONENT_ROLE,new ReportComponentEditPolicy());
  installEditPolicy(EditPolicy.LAYOUT_ROLE,new ReportFlowLayoutEditPolicy(){
    @Override protected Command getAddCommand(    Request req){
      return UnexecutableCommand.INSTANCE;
    }
  }
);
}

Fixed version (ground truth):
protected void createEditPolicies(){
  installEditPolicy(EditPolicy.COMPONENT_ROLE,new ReportComponentEditPolicy());
  installEditPolicy(EditPolicy.LAYOUT_ROLE,new ReportFlowLayoutEditPolicy(){
    @Override protected Command getAddCommand(    Request req){
      return UnexecutableCommand.INSTANCE;
    }
    @Override public EditPart getTargetEditPart(    Request request){
      if (REQ_CREATE.equals(request.getType())) {
        if (((ReportItemHandle)getHost().getModel()).getCurrentView() != null) {
          return null;
        }
      }
      return super.getTargetEditPart(request);
    }
  }
);
}
Program: 65953
Project: 65953
Buggy source:
protected void updateReverseStateByCategoryAxisUI(){
  int state=btnCategoryAxis.getSelectionState();
  boolean enabledUI=getContext().getUIFactory().canEnableUI(btnCategoryAxis);
  btnReverse.setEnabled(enabledUI);
  updateReverseUI(enabledUI);
  if (state == ChartCheckbox.STATE_GRAYED) {
    btnReverse.setSelectionState(ChartCheckbox.STATE_GRAYED);
    ((ChartWithAxes)getChart()).unsetReverseCategory();
  }
 else   if (state == ChartCheckbox.STATE_UNSELECTED) {
    btnReverse.setSelectionState(ChartCheckbox.STATE_UNSELECTED);
    ((ChartWithAxes)getChart()).setReverseCategory(false);
  }
}

Fixed version (ground truth):
protected void updateReverseStateByCategoryAxisUI(){
  int state=btnCategoryAxis.getSelectionState();
  boolean enabledUI=getContext().getUIFactory().canEnableUI(btnCategoryAxis);
  updateReverseUI(enabledUI);
  if (state == ChartCheckbox.STATE_GRAYED) {
    btnReverse.setSelectionState(ChartCheckbox.STATE_GRAYED);
    ((ChartWithAxes)getChart()).unsetReverseCategory();
  }
 else   if (state == ChartCheckbox.STATE_UNSELECTED) {
    btnReverse.setSelectionState(ChartCheckbox.STATE_UNSELECTED);
    ((ChartWithAxes)getChart()).setReverseCategory(false);
  }
}
Program: 65955
Project: 65955
Buggy source:
protected void setStateOfTitle(){
  boolean isTitleEnabled=getAxisForProcessing().getTitle().isVisible();
  txtTitle.setEnabled(isTitleEnabled);
  setToggleButtonEnabled(BUTTON_TITLE,isTitleEnabled);
}

Fixed version (ground truth):
protected void setStateOfTitle(){
  boolean isTitleEnabled=isTitleEnabled();
  txtTitle.setEnabled(isTitleEnabled);
  setToggleButtonEnabled(BUTTON_TITLE,isTitleEnabled);
}
Program: 65960
Project: 65960
Buggy source:
/** 
 * Updates chart element AxisOrigin.
 * @param eObj chart element object.
 * @param eRefObj reference chart element object.
 * @param eDefObj default chart element object.
 * @param eDefOverride indicates if using default object to override target object if target is null.
 * @param checkVisible indicates if still checking visible of chart element before updating properties of chart element.
 * @generated Don't change this method manually.
 */
public void updateAxisOrigin(String name,EObject eParentObj,AxisOrigin eObj,AxisOrigin eRefObj,AxisOrigin eDefObj,boolean eDefOverride,boolean checkVisible){
  if (eObj == null) {
    if (eRefObj != null) {
      eObj=eRefObj.copyInstance();
      ChartElementUtil.setEObjectAttribute(eParentObj,name,eObj,false);
    }
 else     if (eDefOverride && eDefObj != null) {
      eObj=eDefObj.copyInstance();
      ChartElementUtil.setEObjectAttribute(eParentObj,name,eObj,false);
      return;
    }
  }
  if (eObj == null || (eRefObj == null && eDefObj == null)) {
    return;
  }
  if (!eObj.isSetType()) {
    if (eRefObj != null && eRefObj.isSetType()) {
      eObj.setType(eRefObj.getType());
    }
 else     if (eDefObj != null && eDefObj.isSetType()) {
      eObj.setType(eDefObj.getType());
    }
  }
  if (eRefObj != null && eRefObj.getValue() != null) {
    eObj.setValue(eRefObj.getValue());
  }
 else   if (eDefObj != null && eDefObj.getValue() != null) {
    eObj.setValue(eDefObj.getValue());
  }
}

Fixed version (ground truth):
/** 
 * Updates chart element AxisOrigin.
 * @param eObj chart element object.
 * @param eRefObj reference chart element object.
 * @param eDefObj default chart element object.
 * @param eDefOverride indicates if using default object to override target object if target is null.
 * @param checkVisible indicates if still checking visible of chart element before updating properties of chart element.
 * @generated Don't change this method manually.
 */
public void updateAxisOrigin(String name,EObject eParentObj,AxisOrigin eObj,AxisOrigin eRefObj,AxisOrigin eDefObj,boolean eDefOverride,boolean checkVisible){
  if (eObj == null) {
    if (eRefObj != null) {
      eObj=eRefObj.copyInstance();
      ChartElementUtil.setEObjectAttribute(eParentObj,name,eObj,false);
    }
 else     if (eDefOverride && eDefObj != null) {
      eObj=eDefObj.copyInstance();
      ChartElementUtil.setEObjectAttribute(eParentObj,name,eObj,false);
      return;
    }
  }
  if (eObj == null || (eRefObj == null && eDefObj == null)) {
    return;
  }
  if (!eObj.isSetType()) {
    if (eRefObj != null && eRefObj.isSetType()) {
      eObj.setType(eRefObj.getType());
    }
 else     if (eDefObj != null && eDefObj.isSetType()) {
      eObj.setType(eDefObj.getType());
    }
  }
  if (eObj.getValue() == null) {
    if (eRefObj != null && eRefObj.getValue() != null) {
      eObj.setValue(eRefObj.getValue().copyInstance());
    }
 else     if (eDefObj != null && eDefObj.getValue() != null) {
      eObj.setValue(eDefObj.getValue().copyInstance());
    }
  }
}
Program: 65962
Project: 65962
Buggy source:
/** 
 * Updates the dimension combo according to chart type and axes number
 * @param sSelectedType Chart type
 * @return whether the dimension is changed after updating
 */
protected boolean updateDimensionCombo(String sSelectedType){
  boolean isOldExist=false;
  IChartType chartType=ChartUIUtil.getChartType(sSelectedType);
  String[] dimensionArray=chartType.getSupportedDimensions();
  int axesNum=ChartUIUtil.getOrthogonalAxisNumber(chartModel);
  cbDimension.removeAll();
  boolean bAreaSeriesMixed=isAreaSeriesMixed();
  for (int i=0; i < dimensionArray.length; i++) {
    boolean isSupported=chartType.isDimensionSupported(dimensionArray[i],(ChartWizardContext)context,axesNum,0);
    if (isSupported) {
      if (bAreaSeriesMixed && dimensionArray[i].equals(IChartType.TWO_DIMENSION_WITH_DEPTH_TYPE)) {
        continue;
      }
      cbDimension.add(dimensionArray[i]);
    }
  }
  cbDimension.setDefualtItem(chartType.getDefaultDimension());
  cbDimension.setItemData(cbDimension.getItems());
  String cache=ChartCacheManager.getInstance().getDimension(sSelectedType);
  String availableCache=getAvailableDimension(chartType,cache);
  String thisDimension=getAvailableDimension(chartType,sDimension);
  if (availableCache != thisDimension) {
    isOldExist=true;
  }
  sDimension=cache;
  cbDimension.setText(sDimension);
  return !isOldExist;
}

Fixed version (ground truth):
/** 
 * Updates the dimension combo according to chart type and axes number
 * @param sSelectedType Chart type
 * @return whether the dimension is changed after updating
 */
protected boolean updateDimensionCombo(String sSelectedType){
  cbDimension.setEObjectParent(getContext().getModel());
  boolean isOldExist=false;
  IChartType chartType=ChartUIUtil.getChartType(sSelectedType);
  String[] dimensionArray=chartType.getSupportedDimensions();
  int axesNum=ChartUIUtil.getOrthogonalAxisNumber(chartModel);
  cbDimension.removeAll();
  boolean bAreaSeriesMixed=isAreaSeriesMixed();
  for (int i=0; i < dimensionArray.length; i++) {
    boolean isSupported=chartType.isDimensionSupported(dimensionArray[i],(ChartWizardContext)context,axesNum,0);
    if (isSupported) {
      if (bAreaSeriesMixed && dimensionArray[i].equals(IChartType.TWO_DIMENSION_WITH_DEPTH_TYPE)) {
        continue;
      }
      cbDimension.add(dimensionArray[i]);
    }
  }
  cbDimension.setDefualtItem(chartType.getDefaultDimension());
  cbDimension.setItemData(cbDimension.getItems());
  String cache=ChartCacheManager.getInstance().getDimension(sSelectedType);
  String availableCache=getAvailableDimension(chartType,cache);
  String thisDimension=getAvailableDimension(chartType,sDimension);
  if (availableCache != thisDimension) {
    isOldExist=true;
  }
  sDimension=cache;
  cbDimension.setText(sDimension);
  return !isOldExist;
}
Program: 65964
Project: 65964
Buggy source:
private void toggleDropDown(){
  if (bJustFocusLost) {
    bJustFocusLost=false;
    return;
  }
  if (cmpDropDown == null || cmpDropDown.isDisposed() || !cmpDropDown.isVisible()) {
    fireDropDownEvent();
    Point pLoc=UIHelper.getScreenLocation(this);
    createDropDownComponent(pLoc.x,pLoc.y + this.getSize().y);
  }
 else {
    cmpDropDown.getShell().close();
  }
}

Fixed version (ground truth):
private void toggleDropDown(){
  if (bJustFocusLost) {
    bJustFocusLost=false;
    return;
  }
  if (cmpDropDown == null || cmpDropDown.isDisposed() || !cmpDropDown.isVisible()) {
    fireDropDownEvent();
    Point pLoc=UIHelper.getScreenLocation(this);
    if (Platform.OS_MACOSX.equals(Platform.getOS())) {
      createDropDownComponent(pLoc.x,pLoc.y);
    }
 else {
      createDropDownComponent(pLoc.x,pLoc.y + this.getSize().y);
    }
  }
 else {
    cmpDropDown.getShell().close();
  }
}
Program: 65966
Project: 65966
Buggy source:
public static CalculatedMember[] createCalculatedMembersByAggrOnList(int startRsId,CubeAggrDefn[] cubeAggrs,Scriptable scope,ScriptContext cx) throws DataException {
}

Fixed version (ground truth):
private static CalculatedMember[] createCalculatedMembersByAggrOnList(int startRsId,CalculatedMember[] calculatedMembers1,CubeAggrDefn[] cubeAggrs,Scriptable scope,ScriptContext cx) throws DataException {
}
Program: 65967
Project: 65967
Buggy source:
/** 
 * Populate all aggregation member in CubeQueryDefinition. For initial implementation: we only consider IMeasureDefintion we will take into consider to handle the aggregation definition in binding expression;
 * @param queryDefn
 * @param measureMapping 
 * @return
 * @throws DataException 
 */
static CalculatedMember[] getCalculatedMembers(ICubeQueryDefinition queryDefn,Scriptable scope,Map measureMapping,ScriptContext cx) throws DataException {
  CubeAggrDefn[] cubeAggrs=OlapExpressionUtil.getAggrDefns(queryDefn.getBindings());
  populateMeasureFromBinding(queryDefn,cx);
  populateMeasureFromFilter(queryDefn,cx);
  populateMeasureFromSort(queryDefn,cx);
  CalculatedMember[] calculatedMembers1=extractMeasure(queryDefn,measureMapping);
  int startRsId=calculatedMembers1.length == 0 ? 0 : 1;
  CalculatedMember[] calculatedMembers2=createCalculatedMembersByAggrOnList(startRsId,cubeAggrs,scope,cx);
  return uniteCalculatedMember(calculatedMembers1,calculatedMembers2);
}

Fixed version (ground truth):
/** 
 * Populate all aggregation member in CubeQueryDefinition. For initial implementation: we only consider IMeasureDefintion we will take into consider to handle the aggregation definition in binding expression;
 * @param queryDefn
 * @param measureMapping 
 * @return
 * @throws DataException 
 */
static CalculatedMember[] getCalculatedMembers(ICubeQueryDefinition queryDefn,Scriptable scope,Map measureMapping,ScriptContext cx) throws DataException {
  CubeAggrDefn[] cubeAggrs=OlapExpressionUtil.getAggrDefns(queryDefn.getBindings());
  populateMeasureFromBinding(queryDefn,cx);
  populateMeasureFromFilter(queryDefn,cx);
  populateMeasureFromSort(queryDefn,cx);
  CalculatedMember[] calculatedMembers1=extractMeasure(queryDefn,measureMapping);
  int startRsId=calculatedMembers1.length == 0 ? 0 : 1;
  CalculatedMember[] calculatedMembers2=createCalculatedMembersByAggrOnList(startRsId,calculatedMembers1,cubeAggrs,scope,cx);
  return uniteCalculatedMember(calculatedMembers1,calculatedMembers2);
}
Program: 65968
Project: 65968
Buggy source:
/** 
 * Returns instance of category series definition.
 * @param chart
 * @return
 * @since 3.7
 */
public static SeriesDefinition getCategorySeriesDefinition(Chart chart){
  return getBaseSeriesDefinitions(chart).get(0);
}

Fixed version (ground truth):
/** 
 * Returns instance of category series definition.
 * @param chart
 * @return instance of category series definition.
 * @since 3.7
 */
public static SeriesDefinition getCategorySeriesDefinition(Chart chart){
  return getBaseSeriesDefinitions(chart).get(0);
}
Program: 65969
Project: 65969
Buggy source:
/** 
 * Returns a value series definitions of chart.
 * @param chart
 * @return
 * @since 3.7
 */
public static SeriesDefinition[] getValueSeriesDefinitions(Chart chart){
  SeriesDefinition[] sds=null;
  if (chart instanceof ChartWithAxes) {
    sds=((ChartWithAxes)chart).getSeriesForLegend();
  }
 else   if (chart instanceof ChartWithoutAxes) {
    sds=((ChartWithoutAxes)chart).getSeriesDefinitions().get(0).getSeriesDefinitions().toArray(new SeriesDefinition[]{});
  }
  return sds;
}

Fixed version (ground truth):
/** 
 * Returns a value series definitions of chart.
 * @param chart
 * @return a value series definitions of chart.
 * @since 3.7
 */
public static SeriesDefinition[] getValueSeriesDefinitions(Chart chart){
  SeriesDefinition[] sds=null;
  if (chart instanceof ChartWithAxes) {
    sds=((ChartWithAxes)chart).getSeriesForLegend();
  }
 else   if (chart instanceof ChartWithoutAxes) {
    sds=((ChartWithoutAxes)chart).getSeriesDefinitions().get(0).getSeriesDefinitions().toArray(new SeriesDefinition[]{});
  }
  return sds;
}
Program: 65970
Project: 65970
Buggy source:
/** 
 * Returns number of orthogonal axes.
 * @param chart
 * @return
 * @since 3.7
 */
public static int getOrthogonalAxisNumber(Chart chart){
  if (chart instanceof ChartWithAxes) {
    EList<Axis> axisList=((ChartWithAxes)chart).getAxes().get(0).getAssociatedAxes();
    return axisList.size();
  }
 else   if (chart instanceof ChartWithoutAxes) {
    return 1;
  }
  return 0;
}

Fixed version (ground truth):
/** 
 * Returns number of orthogonal axes.
 * @param chart
 * @return number of orthogonal axes.
 * @since 3.7
 */
public static int getOrthogonalAxisNumber(Chart chart){
  if (chart instanceof ChartWithAxes) {
    EList<Axis> axisList=((ChartWithAxes)chart).getAxes().get(0).getAssociatedAxes();
    return axisList.size();
  }
 else   if (chart instanceof ChartWithoutAxes) {
    return 1;
  }
  return 0;
}
Program: 65971
Project: 65971
Buggy source:
/** 
 * Returns specified query.
 * @param seriesDefn
 * @param queryIndex
 * @return
 * @since 3.7
 */
public static Query getDataQuery(SeriesDefinition seriesDefn,int queryIndex){
  if (seriesDefn.getDesignTimeSeries().getDataDefinition().size() <= queryIndex) {
    Query query=QueryImpl.create("String_Node_Str");
    query.eAdapters().addAll(seriesDefn.eAdapters());
    seriesDefn.getDesignTimeSeries().getDataDefinition().add(query);
    return query;
  }
  return seriesDefn.getDesignTimeSeries().getDataDefinition().get(queryIndex);
}

Fixed version (ground truth):
/** 
 * Returns specified query.
 * @param seriesDefn
 * @param queryIndex
 * @return query object.
 * @since 3.7
 */
public static Query getDataQuery(SeriesDefinition seriesDefn,int queryIndex){
  if (seriesDefn.getDesignTimeSeries().getDataDefinition().size() <= queryIndex) {
    Query query=QueryImpl.create("String_Node_Str");
    query.eAdapters().addAll(seriesDefn.eAdapters());
    seriesDefn.getDesignTimeSeries().getDataDefinition().add(query);
    return query;
  }
  return seriesDefn.getDesignTimeSeries().getDataDefinition().get(queryIndex);
}
Program: 65972
Project: 65972
Buggy source:
AbstractLineStyleChooserComposite createLineStyleChooserComposite(Composite parent,int style,int iLineStyle,Integer[] lineStyleItems,EObject eParent,String sProperty);

Fixed version (ground truth):
/** 
 * Create instance of combo list for editing list style.
 * @param parent
 * @param style
 * @param iLineStyle
 * @param lineStyleItems
 * @param eParent
 * @param sProperty
 * @return instance of combo list for editing list style.
 */
AbstractLineStyleChooserComposite createLineStyleChooserComposite(Composite parent,int style,int iLineStyle,Integer[] lineStyleItems,EObject eParent,String sProperty);
Program: 65973
Project: 65973
Buggy source:
private void dataFileSeek() throws IOException {
  int blockIndex=(int)(position / FileDocumentManager.BLOCK_SIZE);
  int posInBlock=(int)(position % FileDocumentManager.BLOCK_SIZE);
  int dataFilePosition=((Integer)blockList.get(blockIndex)).intValue() * FileDocumentManager.BLOCK_SIZE + posInBlock;
  dataFile.seek(dataFilePosition);
}

Fixed version (ground truth):
private void dataFileSeek() throws IOException {
  int blockIndex=(int)(position / FileDocumentManager.BLOCK_SIZE);
  int posInBlock=(int)(position % FileDocumentManager.BLOCK_SIZE);
  long dataFilePosition=(long)(((Integer)blockList.get(blockIndex)).intValue()) * FileDocumentManager.BLOCK_SIZE + posInBlock;
  dataFile.seek(dataFilePosition);
}
Program: 65975
Project: 65975
Buggy source:
/** 
 * @param iterator
 * @param levelDefs
 * @return
 * @throws BirtException
 * @throws IOException
 */
private static DiskSortedStack getSortedDimRows(IDatasetIterator iterator,ILevelDefn[] levelDefs) throws BirtException, IOException {
  DiskSortedStack result=new DiskSortedStack(Constants.LIST_BUFFER_SIZE,true,true,DimensionRow.getCreator());
  int[][] levelKeyColumnIndex=new int[levelDefs.length][];
  int[][] levelAttributesIndex=new int[levelDefs.length][];
  for (int i=0; i < levelDefs.length; i++) {
    levelKeyColumnIndex[i]=new int[levelDefs[i].getKeyColumns().length];
    for (int j=0; j < levelDefs[i].getKeyColumns().length; j++) {
      levelKeyColumnIndex[i][j]=iterator.getFieldIndex(levelDefs[i].getKeyColumns()[j]);
    }
    String[] attributeColumns=levelDefs[i].getAttributeColumns();
    if (attributeColumns != null) {
      levelAttributesIndex[i]=new int[attributeColumns.length];
      for (int j=0; j < attributeColumns.length; j++) {
        levelAttributesIndex[i][j]=iterator.getFieldIndex(attributeColumns[j]);
      }
    }
  }
  Member[] levelMembers=null;
  while (iterator.next()) {
    levelMembers=new Member[levelDefs.length];
    for (int i=0; i < levelDefs.length; i++) {
      levelMembers[i]=getLevelMember(iterator,levelKeyColumnIndex[i],levelAttributesIndex[i],levelDefs[i]);
    }
    result.push(new DimensionRow(levelMembers));
  }
  return result;
}

Fixed version (ground truth):
/** 
 * @param iterator
 * @param levelDefs
 * @return
 * @throws BirtException
 * @throws IOException
 */
private static DiskSortedStack getSortedDimRows(IDatasetIterator iterator,ILevelDefn[] levelDefs) throws BirtException, IOException {
  DiskSortedStack result=new DiskSortedStack(Constants.MAX_DIMENSION_LENGTH / 2,true,true,DimensionRow.getCreator());
  int[][] levelKeyColumnIndex=new int[levelDefs.length][];
  int[][] levelAttributesIndex=new int[levelDefs.length][];
  for (int i=0; i < levelDefs.length; i++) {
    levelKeyColumnIndex[i]=new int[levelDefs[i].getKeyColumns().length];
    for (int j=0; j < levelDefs[i].getKeyColumns().length; j++) {
      levelKeyColumnIndex[i][j]=iterator.getFieldIndex(levelDefs[i].getKeyColumns()[j]);
    }
    String[] attributeColumns=levelDefs[i].getAttributeColumns();
    if (attributeColumns != null) {
      levelAttributesIndex[i]=new int[attributeColumns.length];
      for (int j=0; j < attributeColumns.length; j++) {
        levelAttributesIndex[i][j]=iterator.getFieldIndex(attributeColumns[j]);
      }
    }
  }
  Member[] levelMembers=null;
  while (iterator.next()) {
    levelMembers=new Member[levelDefs.length];
    for (int i=0; i < levelDefs.length; i++) {
      levelMembers[i]=getLevelMember(iterator,levelKeyColumnIndex[i],levelAttributesIndex[i],levelDefs[i]);
    }
    result.push(new DimensionRow(levelMembers));
  }
  return result;
}
Program: 65977
Project: 65977
Buggy source:
private Row4Aggregation retrieveOneDetailRow() throws IOException {
  Row4Aggregation row=null;
  if (this.existReferenceDate) {
    row=(Row4Aggregation)this.sortedFactRows.pop();
  }
  return row;
}

Fixed version (ground truth):
private Row4Aggregation retrieveOneDetailRow() throws IOException {
  Row4Aggregation row=null;
  if (!avoidExtraSort && this.existReferenceDate) {
    row=(Row4Aggregation)this.sortedFactRows.pop();
  }
 else {
    row=this.retrieveOneFactRow();
  }
  return row;
}
Program: 65978
Project: 65978
Buggy source:
public void onRow(Row4Aggregation row) throws IOException, DataException {
  Row4Aggregation newRow=new Row4Aggregation();
  if (row.getLevelMembers().length != newMemberSize || orignalLevelCount != newMemberSize) {
    Member[] nMembers=new Member[newMemberSize];
    System.arraycopy(row.getLevelMembers(),0,nMembers,0,firstTimeLevel);
    Member[] timeMember=cubeDimensionReader.getLevelMembers(timeDimensionIndex,endLevelIndex,row.getDimPos()[timeDimensionIndex]);
    System.arraycopy(timeMember,0,nMembers,firstTimeLevel,timeMember.length);
    if ((orignalLevelCount - (lowestTimeLevel + 1)) > 0) {
      System.arraycopy(row.getLevelMembers(),lowestTimeLevel + 1,nMembers,firstTimeLevel + timeMember.length,orignalLevelCount - (lowestTimeLevel + 1));
    }
    newRow.setLevelMembers(nMembers);
    newRow.setDimPos(row.getDimPos());
    newRow.setMeasures(row.getMeasures());
    newRow.setMeasureList(row.getMeasureList());
    newRow.setParameterValues(row.getParameterValues());
  }
 else {
    newRow=row;
  }
  if (this.existReferenceDate) {
    sortedFactRows.push(newRow);
  }
  if (this.existLastDate) {
    factRows.add(newRow);
  }
}

Fixed version (ground truth):
public void onRow(Row4Aggregation row) throws IOException, DataException {
  Row4Aggregation newRow=new Row4Aggregation();
  if (row.getLevelMembers().length != newMemberSize || orignalLevelCount != newMemberSize) {
    Member[] nMembers=new Member[newMemberSize];
    System.arraycopy(row.getLevelMembers(),0,nMembers,0,firstTimeLevel);
    Member[] timeMember=cubeDimensionReader.getLevelMembers(timeDimensionIndex,endLevelIndex,row.getDimPos()[timeDimensionIndex]);
    System.arraycopy(timeMember,0,nMembers,firstTimeLevel,timeMember.length);
    if ((orignalLevelCount - (lowestTimeLevel + 1)) > 0) {
      System.arraycopy(row.getLevelMembers(),lowestTimeLevel + 1,nMembers,firstTimeLevel + timeMember.length,orignalLevelCount - (lowestTimeLevel + 1));
    }
    newRow.setLevelMembers(nMembers);
    newRow.setDimPos(row.getDimPos());
    newRow.setMeasures(row.getMeasures());
    newRow.setMeasureList(row.getMeasureList());
    newRow.setParameterValues(row.getParameterValues());
  }
 else {
    newRow=row;
  }
  if (this.existReferenceDate && !this.avoidExtraSort) {
    sortedFactRows.push(newRow);
  }
  if (this.existLastDate || this.avoidExtraSort) {
    factRows.add(newRow);
  }
}