nus-yam/ex-repair huggingface dataset:
Program: 65654
Project: 65654
Buggy source:
/** 
 * @param dsAndDs
 * @return
 */
boolean doesLoadFromCache(DataSourceAndDataSet dsAndDs,int requiredCapability){
synchronized (cacheMap) {
    IDataSetCacheObject cacheObject=(IDataSetCacheObject)cacheMap.get(dsAndDs);
    if (cacheObject != null) {
      boolean reusable=cacheObject.isCachedDataReusable(requiredCapability);
      if (!reusable) {
        cacheObject.release();
        cacheMap.remove(dsAndDs);
      }
      return reusable;
    }
 else {
      return false;
    }
  }
}

Fixed version (ground truth):
/** 
 * @param dsAndDs
 * @return
 */
boolean doesLoadFromCache(DataSourceAndDataSet dsAndDs,int requiredCapability){
synchronized (cacheMap) {
    IDataSetCacheObject cacheObject=(IDataSetCacheObject)cacheMap.get(dsAndDs);
    if (cacheObject != null) {
      boolean reusable=cacheObject.isCachedDataReusable(requiredCapability);
      if (!reusable) {
        cacheObject.release();
        tempDataSetCacheMap.remove(dsAndDs);
        cacheMap.remove(dsAndDs);
      }
      return reusable;
    }
 else {
      return false;
    }
  }
}
Program: 65655
Project: 65655
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)|| 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;
}

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;
  }
 else   if (DesignChoiceConstants.COLUMN_DATA_TYPE_BLOB.equals(dataType)) {
    defaultAnalysisType=DesignChoiceConstants.ANALYSIS_TYPE_ATTRIBUTE;
  }
  return defaultAnalysisType;
}
Program: 65657
Project: 65657
Buggy source:
/** 
 * Returns the trigger instance according to current UI values.
 * @return trigger from UI values
 */
public Trigger getTrigger(){
  if (cmbActionType.getSelectionIndex() == 0) {
    return null;
  }
  ActionValue value=null;
switch (getTriggerIndex()) {
case INDEX_1_URL_REDIRECT:
    value=multiHyperlinksComposite.getURLValues();
  break;
case INDEX_2_TOOLTIP:
value=TooltipValueImpl.create(200,"String_Node_Str");
((TooltipValue)value).setText(btnTooltipExpBuilder.getExpression());
break;
case INDEX_3_TOOGLE_VISABILITY:
value=AttributeFactory.eINSTANCE.createSeriesValue();
((SeriesValue)value).setName("String_Node_Str");
break;
case INDEX_4_SCRIPT:
value=AttributeFactory.eINSTANCE.createScriptValue();
((ScriptValue)value).setScript(btnScriptExpBuilder.getExpression());
break;
case INDEX_5_HIGHLIGHT:
value=AttributeFactory.eINSTANCE.createSeriesValue();
((SeriesValue)value).setName("String_Node_Str");
break;
case INDEX_7_TOOGLE_DATAPOINT:
value=AttributeFactory.eINSTANCE.createSeriesValue();
((SeriesValue)value).setName("String_Node_Str");
default :
break;
}
Action action=ActionImpl.create(ActionType.getByName(LiteralHelper.actionTypeSet.getNameByDisplayName(cmbActionType.getText())),value);
return TriggerImpl.create(TriggerCondition.getByName(LiteralHelper.triggerConditionSet.getNameByDisplayName(lastTriggerType == null ? cmbTriggerType.getText() : lastTriggerType)),action);
}

Fixed version (ground truth):
/** 
 * Returns the trigger instance according to current UI values.
 * @return trigger from UI values
 */
public Trigger getTrigger(){
  if (cmbActionType.getSelectionIndex() == 0) {
    return null;
  }
  ActionValue value=null;
switch (getTriggerIndex()) {
case INDEX_1_URL_REDIRECT:
    value=multiHyperlinksComposite.getURLValues().copyInstance();
  break;
case INDEX_2_TOOLTIP:
value=TooltipValueImpl.create(200,"String_Node_Str");
((TooltipValue)value).setText(btnTooltipExpBuilder.getExpression());
break;
case INDEX_3_TOOGLE_VISABILITY:
value=AttributeFactory.eINSTANCE.createSeriesValue();
((SeriesValue)value).setName("String_Node_Str");
break;
case INDEX_4_SCRIPT:
value=AttributeFactory.eINSTANCE.createScriptValue();
((ScriptValue)value).setScript(btnScriptExpBuilder.getExpression());
break;
case INDEX_5_HIGHLIGHT:
value=AttributeFactory.eINSTANCE.createSeriesValue();
((SeriesValue)value).setName("String_Node_Str");
break;
case INDEX_7_TOOGLE_DATAPOINT:
value=AttributeFactory.eINSTANCE.createSeriesValue();
((SeriesValue)value).setName("String_Node_Str");
default :
break;
}
Action action=ActionImpl.create(ActionType.getByName(LiteralHelper.actionTypeSet.getNameByDisplayName(cmbActionType.getText())),value);
return TriggerImpl.create(TriggerCondition.getByName(LiteralHelper.triggerConditionSet.getNameByDisplayName(lastTriggerType == null ? cmbTriggerType.getText() : lastTriggerType)),action);
}
Program: 65658
Project: 65658
Buggy source:
protected AxisType getAxisType(DataPointComponentType dpct){
  if (dpct == DataPointComponentType.BASE_VALUE_LITERAL) {
    if (context.getModel() instanceof ChartWithAxes) {
      ChartWithAxes chart=(ChartWithAxes)context.getModel();
      if (chart.getPrimaryBaseAxes().length > 0) {
        return chart.getPrimaryBaseAxes()[0].getType();
      }
    }
  }
 else   if (dpct == DataPointComponentType.ORTHOGONAL_VALUE_LITERAL) {
    if (context.getModel() instanceof ChartWithAxes) {
      ChartWithAxes chart=(ChartWithAxes)context.getModel();
      if (chart.getPrimaryBaseAxes().length > 0) {
        Axis ax=chart.getPrimaryOrthogonalAxis(chart.getPrimaryBaseAxes()[0]);
        if (ax != null) {
          return ax.getType();
        }
      }
    }
  }
 else   if (dpct == DataPointComponentType.PERCENTILE_ORTHOGONAL_VALUE_LITERAL) {
    return AxisType.LOGARITHMIC_LITERAL;
  }
  return null;
}

Fixed version (ground truth):
protected AxisType getAxisType(DataPointComponentType dpct){
  if (dpct == DataPointComponentType.BASE_VALUE_LITERAL) {
    if (context.getModel() instanceof ChartWithAxes) {
      ChartWithAxes chart=(ChartWithAxes)context.getModel();
      if (chart.getPrimaryBaseAxes().length > 0) {
        return chart.getPrimaryBaseAxes()[0].getType();
      }
    }
  }
 else   if (dpct == DataPointComponentType.ORTHOGONAL_VALUE_LITERAL) {
    if (context.getModel() instanceof ChartWithAxes) {
      Axis ax=ChartUtil.getAxisFromSeries(series);
      if (ax == null) {
        ChartWithAxes chart=(ChartWithAxes)context.getModel();
        if (chart.getPrimaryBaseAxes().length > 0) {
          ax=chart.getPrimaryOrthogonalAxis(chart.getPrimaryBaseAxes()[0]);
        }
      }
      return ax.getType();
    }
  }
 else   if (dpct == DataPointComponentType.PERCENTILE_ORTHOGONAL_VALUE_LITERAL) {
    return AxisType.LOGARITHMIC_LITERAL;
  }
  return null;
}
Program: 65659
Project: 65659
Buggy source:
public IEditorInput getEditorInput(){
  return instance.getEditorInput();
}

Fixed version (ground truth):
public IEditorInput getEditorInput(){
  if (instance != null) {
    return instance.getEditorInput();
  }
  return null;
}
Program: 65660
Project: 65660
Buggy source:
private static NumberFormat createDefaultNumberFormat(Number value,ULocale locale){
  NumberFormat df;
  double doubleValue=Math.abs(value.doubleValue());
  if (ChartUtil.mathGT(doubleValue,0d) && ChartUtil.mathLT(doubleValue,1d)) {
    df=new DecimalFormat(DECIMAL_FORMAT_PATTERN,new DecimalFormatSymbols(locale));
    ((DecimalFormat)df).setSignificantDigitsUsed(true);
    ((DecimalFormat)df).setMaximumSignificantDigits(3);
  }
 else {
    df=DecimalFormat.getInstance(locale);
  }
  return df;
}

Fixed version (ground truth):
private static NumberFormat createDefaultNumberFormat(Number value,ULocale locale){
  NumberFormat df;
  double doubleValue=Math.abs(value.doubleValue());
  if (ChartUtil.mathGT(doubleValue,0d) && ChartUtil.mathLT(doubleValue,1d)) {
    df=new DecimalFormat(DECIMAL_FORMAT_PATTERN,new DecimalFormatSymbols(locale));
  }
 else {
    df=DecimalFormat.getInstance(locale);
  }
  return df;
}
Program: 65661
Project: 65661
Buggy source:
public void testConstructorPrecise(){
  Fraction f=FractionApproximator.getExactFraction(0.02);
  assertEquals(f.getNumerator(),1);
  assertEquals(f.getDenominator(),50);
  f=FractionApproximator.getExactFraction(0.333333333333);
  assertEquals(f.getNumerator(),333);
  assertEquals(f.getDenominator(),1000);
  f=FractionApproximator.getExactFraction(-0.333333333333);
  assertEquals(f.getNumerator(),-333);
  assertEquals(f.getDenominator(),1000);
  f=FractionApproximator.getExactFraction(-0.33);
  assertEquals(f.getNumerator(),-33);
  assertEquals(f.getDenominator(),100);
}

Fixed version (ground truth):
public void testConstructorPrecise(){
  Fraction f=FractionApproximator.getExactFraction(0.02);
  assertEquals(f.getNumerator(),1);
  assertEquals(f.getDenominator(),50);
  f=FractionApproximator.getExactFraction(0.333333333333);
  assertEquals(f.getNumerator(),33333333);
  assertEquals(f.getDenominator(),100000000);
  f=FractionApproximator.getExactFraction(-0.333333333333);
  assertEquals(f.getNumerator(),-33333333);
  assertEquals(f.getDenominator(),100000000);
  f=FractionApproximator.getExactFraction(-0.33);
  assertEquals(f.getNumerator(),-33);
  assertEquals(f.getDenominator(),100);
}
Program: 65662
Project: 65662
Buggy source:
/** 
 * construction
 */
CacheMapManager(boolean useJVMLevelCache){
  if (useJVMLevelCache) {
    cacheMap=JVMLevelCacheMap;
  }
 else {
    cacheMap=new HashMap();
  }
  tempDataSetCacheMap=new HashMap<DataSourceAndDataSet,IDataSetCacheObject>();
}

Fixed version (ground truth):
/** 
 * construction
 */
CacheMapManager(boolean useJVMLevelCache){
  this.useJVMLevelCache=useJVMLevelCache;
  if (useJVMLevelCache) {
    cacheMap=JVMLevelCacheMap;
  }
 else {
    cacheMap=new HashMap();
  }
  tempDataSetCacheMap=new HashMap<DataSourceAndDataSet,IDataSetCacheObject>();
}
Program: 65663
Project: 65663
Buggy source:
/** 
 * @param dsAndDs
 * @return
 */
boolean doesLoadFromCache(DataSourceAndDataSet dsAndDs,int requiredCapability){
synchronized (cacheMap) {
    IDataSetCacheObject cacheObject=(IDataSetCacheObject)cacheMap.get(dsAndDs);
    if (cacheObject != null) {
      boolean reusable=cacheObject.isCachedDataReusable(requiredCapability);
      if (!reusable) {
        cacheObject.release();
        tempDataSetCacheMap.remove(dsAndDs);
        cacheMap.remove(dsAndDs);
      }
      return reusable;
    }
 else {
      return false;
    }
  }
}

Fixed version (ground truth):
/** 
 * @param dsAndDs
 * @return
 */
boolean doesLoadFromCache(DataSourceAndDataSet dsAndDs,int requiredCapability){
synchronized (cacheMap) {
    IDataSetCacheObject cacheObject=(IDataSetCacheObject)cacheMap.get(dsAndDs);
    if (cacheObject != null) {
      boolean reusable=cacheObject.isCachedDataReusable(requiredCapability);
      if (!reusable) {
        if (useJVMLevelCache) {
synchronized (lockedDataSetCacheMap) {
            if (lockedDataSetCacheMap.containsKey(dsAndDs)) {
              try {
                lockedDataSetCacheMap.wait(60000);
              }
 catch (              InterruptedException e) {
              }
              lockedDataSetCacheMap.remove(dsAndDs);
            }
          }
        }
        cacheObject.release();
        tempDataSetCacheMap.remove(dsAndDs);
        cacheMap.remove(dsAndDs);
      }
 else       if (this.useJVMLevelCache) {
        if (!lockedDataSetCacheMap.containsKey(dsAndDs)) {
          lockedDataSetCacheMap.put(dsAndDs,0);
        }
      }
      return reusable;
    }
 else {
      return false;
    }
  }
}
Program: 65664
Project: 65664
Buggy source:
/** 
 * @return
 */
IDataSetCacheObject getSavedCacheObject(DataSourceAndDataSet dsAndDs){
  return tempDataSetCacheMap.get(dsAndDs);
}

Fixed version (ground truth):
/** 
 * @return
 */
IDataSetCacheObject getSavedCacheObject(DataSourceAndDataSet dsAndDs){
synchronized (cacheMap) {
    return tempDataSetCacheMap.get(dsAndDs);
  }
}
Program: 65665
Project: 65665
Buggy source:
/** 
 * @throws DataException 
 */
public void close() throws DataException {
  if (loadUtil != null) {
    loadUtil.close();
    loadUtil=null;
  }
}

Fixed version (ground truth):
/** 
 * @throws DataException 
 */
public void close() throws DataException {
  if (loadUtil != null) {
    session.getDataSetCacheManager().loadFinished();
    loadUtil.close();
    loadUtil=null;
  }
}
Program: 65666
Project: 65666
Buggy source:
public DataSetFromCache(DataEngineSession session){
  this.session=session;
  try {
    countLimit=session.getDataSetCacheManager().getCacheCapability();
  }
 catch (  DataException e) {
  }
}

Fixed version (ground truth):
public DataSetFromCache(DataEngineSession session){
  this.session=session;
  try {
    countLimit=session.getDataSetCacheManager().getCacheCapability();
    session.getDataSetCacheManager().loadStart();
  }
 catch (  DataException e) {
  }
}
Program: 65667
Project: 65667
Buggy source:
public static void clearCache(Set<String> cacheIDs){
  List<IDataSetCacheObject> removed=new ArrayList<IDataSetCacheObject>();
  Object[] keyArray=JVMLevelCacheMap.keySet().toArray(new DataSourceAndDataSet[]{});
  for (  Object dsAndDs : keyArray) {
    if (cacheIDs.contains(((DataSourceAndDataSet)dsAndDs).getCacheScopeID())) {
      IDataSetCacheObject cacheObj=(IDataSetCacheObject)JVMLevelCacheMap.remove(dsAndDs);
      if (cacheObj != null)       removed.add(cacheObj);
    }
  }
  for (  IDataSetCacheObject dataSetCacheObject : removed) {
    dataSetCacheObject.release();
  }
}

Fixed version (ground truth):
void clearCache(){
  List cacheObjects=new ArrayList();
synchronized (cacheMap) {
    for (    DataSourceAndDataSet dataSetAndSource : cacheMap.keySet().toArray(new DataSourceAndDataSet[0])) {
      cacheObjects.add(cacheMap.remove(dataSetAndSource));
      tempDataSetCacheMap.remove(dataSetAndSource);
    }
  }
  for (int i=0; i < cacheObjects.size(); i++) {
    IDataSetCacheObject cacheObject=(IDataSetCacheObject)cacheObjects.get(i);
    cacheObject.release();
  }
}
Program: 65668
Project: 65668
Buggy source:
/** 
 * @param appContext 
 * @param collection 
 * @param baseDataSetDesign 
 * @param baseDataSourceDesign 
 * @return
 * @throws DataException 
 */
boolean doesSaveToCache(DataSourceAndDataSet dsAndDs,DataSetCacheConfig dscc) throws DataException {
synchronized (cacheMap) {
    IDataSetCacheObject cacheObject=(IDataSetCacheObject)cacheMap.get(dsAndDs);
    if (cacheObject != null) {
      return cacheObject.needUpdateCache(dscc.getCacheCapability());
    }
 else {
      IDataSetCacheObject dsco=dscc.createDataSetCacheObject();
      tempDataSetCacheMap.put(dsAndDs,dsco);
      return true;
    }
  }
}

Fixed version (ground truth):
/** 
 * @param appContext 
 * @param collection 
 * @param baseDataSetDesign 
 * @param baseDataSourceDesign 
 * @return
 * @throws DataException 
 */
boolean doesSaveToCache(DataSourceAndDataSet dsAndDs,DataSetCacheConfig dscc) throws DataException {
synchronized (cacheMap) {
    IDataSetCacheObject cacheObject=(IDataSetCacheObject)cacheMap.get(dsAndDs);
    if (cacheObject != null) {
      return cacheObject.needUpdateCache(dscc.getCacheCapability());
    }
 else {
      if (!tempDataSetCacheMap.containsKey(dsAndDs)) {
        IDataSetCacheObject dsco=dscc.createDataSetCacheObject();
        tempDataSetCacheMap.put(dsAndDs,dsco);
      }
      return true;
    }
  }
}
Program: 65669
Project: 65669
Buggy source:
/** 
 * Construction
 */
public DataSetCacheManager(DataEngineSession session){
  this.session=session;
  this.context=session.getEngineContext();
  this.queryExecutionHints=((DataEngineImpl)session.getEngine()).getExecutionHints();
  this.jvmLevelCacheMapManager=new CacheMapManager(true);
  this.dteLevelCacheMapManager=new CacheMapManager(false);
}

Fixed version (ground truth):
/** 
 * Construction
 */
public DataSetCacheManager(DataEngineSession session){
  this.session=session;
  this.context=session.getEngineContext();
  this.queryExecutionHints=((DataEngineImpl)session.getEngine()).getExecutionHints();
  this.jvmLevelCacheMapManager=new CacheMapManager(true);
  this.dteLevelCacheMapManager=new CacheMapManager(false);
  session.getEngine().addShutdownListener(new IShutdownListener(){
    public void dataEngineShutdown(){
      try {
        dteLevelCacheMapManager.clearCache();
      }
 catch (      Exception e) {
      }
    }
  }
);
}
Program: 65671
Project: 65671
Buggy source:
public void close() throws BirtException {
  it.close();
}

Fixed version (ground truth):
public void close() throws BirtException {
  if (this.queryResult != null)   this.queryResult.close();
  if (it != null)   it.close();
}
Program: 65672
Project: 65672
Buggy source:
/** 
 * @param session
 * @param query
 * @param appContext
 * @throws AdapterException
 */
private void executeQuery(DataRequestSessionImpl session,IQueryDefinition query,Map appContext) throws AdapterException {
  try {
    Scriptable scope=session.getScope();
    TempDateTransformer tt=new TempDateTransformer(session.getDataSessionContext().getDataEngineContext().getLocale());
    ScriptableObject.putProperty(scope,tt.getClassName(),tt);
    this.it=session.prepare(query,appContext).execute(scope).getResultIterator();
  }
 catch (  BirtException e) {
    throw new AdapterException(e.getLocalizedMessage(),e);
  }
}

Fixed version (ground truth):
/** 
 * @param session
 * @param query
 * @param appContext
 * @throws AdapterException
 */
private void executeQuery(DataRequestSessionImpl session,IQueryDefinition query,Map appContext) throws AdapterException {
  try {
    Scriptable scope=session.getScope();
    TempDateTransformer tt=new TempDateTransformer(session.getDataSessionContext().getDataEngineContext().getLocale());
    ScriptableObject.putProperty(scope,tt.getClassName(),tt);
    queryResult=session.prepare(query,appContext).execute(scope);
    this.it=queryResult.getResultIterator();
  }
 catch (  BirtException e) {
    throw new AdapterException(e.getLocalizedMessage(),e);
  }
}
Program: 65673
Project: 65673
Buggy source:
private boolean isRowEdgeNeedStart(ColumnEvent ev){
  if (rowEdgeStarted || ev.type != ColumnEvent.ROW_EDGE_CHANGE || !isSubTotalBefore) {
    return false;
  }
  if (ev.dimensionIndex > dimensionIndex || (ev.dimensionIndex == dimensionIndex && (isLayoutDownThenOver ? (ev.levelIndex >= levelIndex) : (ev.levelIndex > levelIndex)))) {
    return false;
  }
  if (ev.dimensionIndex != dimensionIndex || ev.levelIndex != levelIndex) {
    DimensionViewHandle dv=crosstabItem.getDimension(ROW_AXIS_TYPE,ev.dimensionIndex);
    LevelViewHandle lv=dv.getLevel(ev.levelIndex);
    if (!isLayoutDownThenOver && lv.getAggregationHeader() != null && AGGREGATION_HEADER_LOCATION_BEFORE.equals(lv.getAggregationHeaderLocation())) {
      return false;
    }
    int gdx=GroupUtil.getGroupIndex(rowGroups,ev.dimensionIndex,ev.levelIndex);
    if (gdx != -1) {
      try {
        EdgeCursor rowEdgeCursor=getRowEdgeCursor();
        if (rowEdgeCursor != null) {
          DimensionCursor dc=(DimensionCursor)rowEdgeCursor.getDimensionCursor().get(gdx);
          if (rowEdgeCursor.getPosition() != dc.getEdgeStart()) {
            return false;
          }
        }
      }
 catch (      OLAPException e) {
        logger.log(Level.SEVERE,Messages.getString("String_Node_Str"),e);
      }
    }
  }
  return rowIndex == 0;
}

Fixed version (ground truth):
private boolean isRowEdgeNeedStart(ColumnEvent ev){
  if (rowEdgeStarted || ev.type != ColumnEvent.ROW_EDGE_CHANGE || !isSubTotalBefore) {
    return false;
  }
  if (ev.dimensionIndex > dimensionIndex || (ev.dimensionIndex == dimensionIndex && (isLayoutDownThenOver ? (ev.levelIndex >= levelIndex) : (ev.levelIndex > levelIndex)))) {
    return false;
  }
  if (ev.dimensionIndex != dimensionIndex || ev.levelIndex != levelIndex) {
    DimensionViewHandle dv=crosstabItem.getDimension(ROW_AXIS_TYPE,ev.dimensionIndex);
    LevelViewHandle lv=dv.getLevel(ev.levelIndex);
    if (!isLayoutDownThenOver && lv.getAggregationHeader() != null && AGGREGATION_HEADER_LOCATION_BEFORE.equals(lv.getAggregationHeaderLocation())) {
      return false;
    }
    int gdx=GroupUtil.getGroupIndex(rowGroups,ev.dimensionIndex,ev.levelIndex);
    if (gdx != -1) {
      try {
        EdgeCursor rowEdgeCursor=getRowEdgeCursor();
        if (rowEdgeCursor != null) {
          DimensionCursor dc=(DimensionCursor)rowEdgeCursor.getDimensionCursor().get(gdx);
          if (rowEdgeCursor.getPosition() != dc.getEdgeStart()) {
            return false;
          }
        }
      }
 catch (      OLAPException e) {
        logger.log(Level.SEVERE,Messages.getString("String_Node_Str"),e);
      }
    }
  }
  return isFirstTotalRow;
}
Program: 65674
Project: 65674
Buggy source:
public Fraction getExactFraction(){
  int lastIndex=integerList.size() - 1;
  return getFraction(lastIndex,new Fraction(((Long)integerList.get(lastIndex)).intValue(),1));
}

Fixed version (ground truth):
public Fraction getExactFraction(){
  int lastIndex=integerList.size() - 1;
  return getFraction(lastIndex,new Fraction((integerList.get(lastIndex)).intValue(),1));
}
Program: 65675
Project: 65675
Buggy source:
public Fraction getFractionWithMaxDigits(int maxDigitsForDenominator){
  int lastIndex=integerList.size();
  Fraction previousFraction=null;
  for (int i=0; i < lastIndex; i++) {
    Fraction fraction=getFraction(i,new Fraction(((Long)integerList.get(i)).intValue(),1));
    if (fraction.getDenominatorDigits() > maxDigitsForDenominator)     return previousFraction;
    previousFraction=fraction;
  }
  return previousFraction;
}

Fixed version (ground truth):
public Fraction getFractionWithMaxDigits(int maxDigitsForDenominator){
  int lastIndex=integerList.size();
  Fraction previousFraction=null;
  for (int i=0; i < lastIndex; i++) {
    Fraction fraction=getFraction(i,new Fraction((integerList.get(i)).intValue(),1));
    if (fraction.getDenominatorDigits() > maxDigitsForDenominator)     return previousFraction;
    previousFraction=fraction;
  }
  return previousFraction;
}
Program: 65676
Project: 65676
Buggy source:
public ContinuedFraction(double decimal){
  this.decimal=decimal;
  computeList();
}

Fixed version (ground truth):
public ContinuedFraction(double decimal){
  this.decimal=ValueFormatter.normalizeDouble(decimal).doubleValue();
  computeList();
}
Program: 65677
Project: 65677
Buggy source:
private Fraction getFraction(int index,Fraction fraction){
  if (index > 0)   return getFraction(index - 1,(fraction.invert()).add((Long)integerList.get(index - 1)));
 else   return fraction;
}

Fixed version (ground truth):
private Fraction getFraction(int index,Fraction fraction){
  if (index > 0) {
    return getFraction(index - 1,(fraction.invert()).add(integerList.get(index - 1)));
  }
  return fraction;
}
Program: 65678
Project: 65678
Buggy source:
public void endListBand(IListBandContent listBand) throws BirtException {
  while (!(current instanceof ListArea)) {
    current.close();
    current=current.getParent();
  }
  int bandType=listBand.getBandType();
  if (bandType == IBandContent.BAND_HEADER || bandType == IBandContent.BAND_GROUP_HEADER) {
    ContainerArea container=current;
    while (container != null && !(container instanceof ListArea) && !(container instanceof ListGroupArea)) {
      container=container.getParent();
    }
    if (container instanceof RepeatableArea) {
      ((RepeatableArea)container).setInHeaderBand(false);
    }
  }
}

Fixed version (ground truth):
public void endListBand(IListBandContent listBand) throws BirtException {
  while (!(current instanceof ListArea || current instanceof ListGroupArea)) {
    current.close();
    current=current.getParent();
  }
  int bandType=listBand.getBandType();
  if (bandType == IBandContent.BAND_HEADER || bandType == IBandContent.BAND_GROUP_HEADER) {
    ContainerArea container=current;
    while (container != null && !(container instanceof ListArea) && !(container instanceof ListGroupArea)) {
      container=container.getParent();
    }
    if (container instanceof RepeatableArea) {
      ((RepeatableArea)container).setInHeaderBand(false);
    }
  }
}
Program: 65679
Project: 65679
Buggy source:
private boolean isRowEdgeNeedStart(ColumnEvent ev){
  if (rowEdgeStarted || ev.type != ColumnEvent.ROW_EDGE_CHANGE || !isSubTotalBefore) {
    return false;
  }
  if (ev.dimensionIndex > dimensionIndex || (ev.dimensionIndex == dimensionIndex && (isLayoutDownThenOver ? (ev.levelIndex >= levelIndex) : (ev.levelIndex > levelIndex)))) {
    return false;
  }
  if (ev.dimensionIndex != dimensionIndex || ev.levelIndex != levelIndex) {
    DimensionViewHandle dv=crosstabItem.getDimension(ROW_AXIS_TYPE,ev.dimensionIndex);
    LevelViewHandle lv=dv.getLevel(ev.levelIndex);
    if (!isLayoutDownThenOver && lv.getAggregationHeader() != null && AGGREGATION_HEADER_LOCATION_BEFORE.equals(lv.getAggregationHeaderLocation())) {
      return false;
    }
    int gdx=GroupUtil.getGroupIndex(rowGroups,ev.dimensionIndex,ev.levelIndex);
    if (gdx != -1) {
      try {
        EdgeCursor rowEdgeCursor=getRowEdgeCursor();
        if (rowEdgeCursor != null) {
          DimensionCursor dc=(DimensionCursor)rowEdgeCursor.getDimensionCursor().get(gdx);
          if (rowEdgeCursor.getPosition() != dc.getEdgeStart()) {
            return false;
          }
        }
      }
 catch (      OLAPException e) {
        logger.log(Level.SEVERE,Messages.getString("String_Node_Str"),e);
      }
    }
  }
  return rowIndex == 0;
}

Fixed version (ground truth):
private boolean isRowEdgeNeedStart(ColumnEvent ev){
  if (rowEdgeStarted || ev.type != ColumnEvent.ROW_EDGE_CHANGE || !isSubTotalBefore) {
    return false;
  }
  if (ev.dimensionIndex > dimensionIndex || (ev.dimensionIndex == dimensionIndex && (isLayoutDownThenOver ? (ev.levelIndex >= levelIndex) : (ev.levelIndex > levelIndex)))) {
    return false;
  }
  if (ev.dimensionIndex != dimensionIndex || ev.levelIndex != levelIndex) {
    DimensionViewHandle dv=crosstabItem.getDimension(ROW_AXIS_TYPE,ev.dimensionIndex);
    LevelViewHandle lv=dv.getLevel(ev.levelIndex);
    if (!isLayoutDownThenOver && lv.getAggregationHeader() != null && AGGREGATION_HEADER_LOCATION_BEFORE.equals(lv.getAggregationHeaderLocation())) {
      return false;
    }
    int gdx=GroupUtil.getGroupIndex(rowGroups,ev.dimensionIndex,ev.levelIndex);
    if (gdx != -1) {
      try {
        EdgeCursor rowEdgeCursor=getRowEdgeCursor();
        if (rowEdgeCursor != null) {
          DimensionCursor dc=(DimensionCursor)rowEdgeCursor.getDimensionCursor().get(gdx);
          if (rowEdgeCursor.getPosition() != dc.getEdgeStart()) {
            return false;
          }
        }
      }
 catch (      OLAPException e) {
        logger.log(Level.SEVERE,Messages.getString("String_Node_Str"),e);
      }
    }
  }
  return isFirstTotalRow;
}
Program: 65680
Project: 65680
Buggy source:
private static IReportEngine createReportEngine(EngineConfig config) throws BirtException {
  return new ReportEngineFactory().createReportEngine(config);
}

Fixed version (ground truth):
private static IReportEngine createReportEngine(EngineConfig config) throws BirtException {
  return ReportEngineCreator.createReportEngine(config);
}
Program: 65682
Project: 65682
Buggy source:
public void endListBand(IListBandContent listBand) throws BirtException {
  int bandType=listBand.getBandType();
  if (bandType == IBandContent.BAND_HEADER || bandType == IBandContent.BAND_GROUP_HEADER) {
    ContainerArea container=current;
    while (container != null && !(container instanceof ListArea) && !(container instanceof ListGroupArea)) {
      container=container.getParent();
    }
    if (container instanceof RepeatableArea) {
      ((RepeatableArea)container).setInHeaderBand(false);
    }
  }
}

Fixed version (ground truth):
public void endListBand(IListBandContent listBand) throws BirtException {
  while (!(current instanceof ListArea)) {
    current.close();
    current=current.getParent();
  }
  int bandType=listBand.getBandType();
  if (bandType == IBandContent.BAND_HEADER || bandType == IBandContent.BAND_GROUP_HEADER) {
    ContainerArea container=current;
    while (container != null && !(container instanceof ListArea) && !(container instanceof ListGroupArea)) {
      container=container.getParent();
    }
    if (container instanceof RepeatableArea) {
      ((RepeatableArea)container).setInHeaderBand(false);
    }
  }
}
Program: 65683
Project: 65683
Buggy source:
private void doEdit(Object structureOrHandle){
  FilterConditionBuilder dlg=new FilterConditionBuilder(((DataSetEditor)getContainer()).getShell(),this.getTitle(structureOrHandle),this.getTitle(structureOrHandle));
  dlg.setDataSetHandle((DataSetHandle)getContainer().getModel(),new DataSetExpressionProvider((DataSetHandle)getContainer().getModel()));
  dlg.setBindingParams(getParamBindingHandleArray());
  dlg.setInput(structureOrHandle);
  if (dlg.open() == Window.OK) {
    update(structureOrHandle);
  }
}

Fixed version (ground truth):
private void doEdit(Object structureOrHandle){
  FilterConditionBuilder dlg=new FilterConditionBuilder(((DataSetEditor)getContainer()).getShell(),this.getTitle(structureOrHandle),this.getTitle(structureOrHandle));
  dlg.setDataSetHandle((DataSetHandle)getContainer().getModel(),new DataSetExpressionProvider((DataSetHandle)getContainer().getModel()));
  dlg.showUpdateAggregationButton(false);
  dlg.setBindingParams(getParamBindingHandleArray());
  dlg.setInput(structureOrHandle);
  if (dlg.open() == Window.OK) {
    update(structureOrHandle);
  }
}
Program: 65684
Project: 65684
Buggy source:
public Object read(BufferedRandomAccessFile file) throws IOException {
  return file.readBigDecimal();
}

Fixed version (ground truth):
public Object read(BufferedRandomAccessFile file) throws IOException {
  return file.readObject();
}
Program: 65685
Project: 65685
Buggy source:
public static IObjectWriter getRandomWriter(int dataType){
switch (dataType) {
case DataType.BOOLEAN_TYPE:
    return new BooleanRandomWriter();
case DataType.INTEGER_TYPE:
  return new IntegerRandomWriter();
case DataType.BYTES_TYPE:
return new BytesRandomWriter();
case DataType.DOUBLE_TYPE:
return new DoubleRandomWriter();
case DataType.STRING_TYPE:
return new StringRandomWriter();
case DataType.DATE_TYPE:
return new DateRandomWriter();
case DataType.BLOB_TYPE:
return new BlobRandomWriter();
case DataType.BIGDECIMAL_TYPE:
return new BigDecimalRandomWriter();
case DataType.SQL_DATE_TYPE:
return new DateRandomWriter();
case DataType.SQL_TIME_TYPE:
return new DateRandomWriter();
default :
return null;
}
}

Fixed version (ground truth):
public static IObjectWriter getRandomWriter(int dataType){
switch (dataType) {
case DataType.BOOLEAN_TYPE:
    return new BooleanRandomWriter();
case DataType.INTEGER_TYPE:
  return new IntegerRandomWriter();
case DataType.BYTES_TYPE:
return new BytesRandomWriter();
case DataType.DOUBLE_TYPE:
return new DoubleRandomWriter();
case DataType.STRING_TYPE:
return new StringRandomWriter();
case DataType.DATE_TYPE:
return new DateRandomWriter();
case DataType.BLOB_TYPE:
return new BlobRandomWriter();
case DataType.BIGDECIMAL_TYPE:
return new BigDecimalRandomWriter();
case DataType.SQL_DATE_TYPE:
return new DateRandomWriter();
case DataType.SQL_TIME_TYPE:
return new DateRandomWriter();
case DataType.JAVA_OBJECT_TYPE:
return new ObjectRandomWriter();
default :
return new ObjectRandomWriter();
}
}
Program: 65686
Project: 65686
Buggy source:
public void write(BufferedRandomAccessFile file,Object obj) throws IOException {
  try {
    file.writeBigDecimal((BigDecimal)obj);
  }
 catch (  ClassCastException ce) {
    logger.log(Level.FINE,ce.getMessage(),ce);
  }
}

Fixed version (ground truth):
public void write(BufferedRandomAccessFile file,Object obj) throws IOException {
  try {
    file.writeObject(obj);
  }
 catch (  ClassCastException ce) {
    logger.log(Level.FINE,ce.getMessage(),ce);
  }
}
Program: 65687
Project: 65687
Buggy source:
public static IObjectReader getRandomReader(int dataType){
switch (dataType) {
case DataType.BOOLEAN_TYPE:
    return new BooleanRandomReader();
case DataType.INTEGER_TYPE:
  return new IntegerRandomReader();
case DataType.BYTES_TYPE:
return new BytesRandomReader();
case DataType.DOUBLE_TYPE:
return new DoubleRandomReader();
case DataType.STRING_TYPE:
return new StringRandomReader();
case DataType.DATE_TYPE:
return new DateTimeRandomReader();
case DataType.BLOB_TYPE:
return new BlobRandomReader();
case DataType.BIGDECIMAL_TYPE:
return new BigDecimalRandomReader();
case DataType.SQL_DATE_TYPE:
return new DateRandomReader();
case DataType.SQL_TIME_TYPE:
return new TimeRandomReader();
default :
return null;
}
}

Fixed version (ground truth):
public static IObjectReader getRandomReader(int dataType){
switch (dataType) {
case DataType.BOOLEAN_TYPE:
    return new BooleanRandomReader();
case DataType.INTEGER_TYPE:
  return new IntegerRandomReader();
case DataType.BYTES_TYPE:
return new BytesRandomReader();
case DataType.DOUBLE_TYPE:
return new DoubleRandomReader();
case DataType.STRING_TYPE:
return new StringRandomReader();
case DataType.DATE_TYPE:
return new DateTimeRandomReader();
case DataType.BLOB_TYPE:
return new BlobRandomReader();
case DataType.BIGDECIMAL_TYPE:
return new BigDecimalRandomReader();
case DataType.SQL_DATE_TYPE:
return new DateRandomReader();
case DataType.SQL_TIME_TYPE:
return new TimeRandomReader();
case DataType.JAVA_OBJECT_TYPE:
return new ObjectRandomReader();
default :
return new ObjectRandomReader();
}
}
Program: 65689
Project: 65689
Buggy source:
/** 
 * construction
 */
CacheMapManager(boolean useJVMLevelCache){
  if (useJVMLevelCache) {
    cacheMap=JVMLevelCacheMap;
  }
 else {
    cacheMap=new HashMap();
  }
}

Fixed version (ground truth):
/** 
 * construction
 */
CacheMapManager(boolean useJVMLevelCache){
  if (useJVMLevelCache) {
    cacheMap=JVMLevelCacheMap;
  }
 else {
    cacheMap=new HashMap();
  }
  tempDataSetCacheMap=new HashMap<DataSourceAndDataSet,IDataSetCacheObject>();
}
Program: 65690
Project: 65690
Buggy source:
/** 
 * Reset for test case
 */
void resetForTest(){
synchronized (this) {
    cacheMap.clear();
  }
}

Fixed version (ground truth):
/** 
 * Reset for test case
 */
void resetForTest(){
synchronized (this) {
    cacheMap.clear();
    tempDataSetCacheMap.clear();
  }
}
Program: 65691
Project: 65691
Buggy source:
/** 
 * @param appContext 
 * @param collection 
 * @param baseDataSetDesign 
 * @param baseDataSourceDesign 
 * @return
 * @throws DataException 
 */
boolean doesSaveToCache(DataSourceAndDataSet dsAndDs,DataSetCacheConfig dscc) throws DataException {
synchronized (cacheMap) {
    IDataSetCacheObject cacheObject=(IDataSetCacheObject)cacheMap.get(dsAndDs);
    if (cacheObject != null) {
      return cacheObject.needUpdateCache(dscc.getCacheCapability());
    }
 else {
      IDataSetCacheObject dsco=dscc.createDataSetCacheObject();
      cacheMap.put(dsAndDs,dsco);
      return true;
    }
  }
}

Fixed version (ground truth):
/** 
 * @param appContext 
 * @param collection 
 * @param baseDataSetDesign 
 * @param baseDataSourceDesign 
 * @return
 * @throws DataException 
 */
boolean doesSaveToCache(DataSourceAndDataSet dsAndDs,DataSetCacheConfig dscc) throws DataException {
synchronized (cacheMap) {
    IDataSetCacheObject cacheObject=(IDataSetCacheObject)cacheMap.get(dsAndDs);
    if (cacheObject != null) {
      return cacheObject.needUpdateCache(dscc.getCacheCapability());
    }
 else {
      IDataSetCacheObject dsco=dscc.createDataSetCacheObject();
      tempDataSetCacheMap.put(dsAndDs,dsco);
      return true;
    }
  }
}
Program: 65692
Project: 65692
Buggy source:
/** 
 * @return
 * @throws DataException 
 */
private IDataSetCacheObject getCacheObject() throws DataException {
  return session.getDataSetCacheManager().getCacheObject();
}

Fixed version (ground truth):
/** 
 * @return
 * @throws DataException 
 */
private IDataSetCacheObject getCacheObject() throws DataException {
  return session.getDataSetCacheManager().getLoadedCacheObject();
}
Program: 65693
Project: 65693
Buggy source:
/** 
 * @return
 * @throws DataException 
 */
private IDataSetCacheObject getCacheObject() throws DataException {
  return getDataSetCacheManager().getCacheObject();
}

Fixed version (ground truth):
/** 
 * @return
 * @throws DataException 
 */
private IDataSetCacheObject getCacheObject() throws DataException {
  return getDataSetCacheManager().getSavedCacheObject();
}
Program: 65694
Project: 65694
Buggy source:
public void saveDataSetResult(IResultIterator itr) throws DataException {
  try {
    int saved=0;
    IResultObject resultObject=null;
    this.saveInit();
    itr.first(0);
    while (itr.getCurrentResult() != null) {
      resultObject=itr.getCurrentResult();
      saveUtil.saveObject(resultObject);
      saved++;
      if (increCacheMode == null && saved >= cacheCount) {
        break;
      }
      if (session.getStopSign().isStopped()) {
        removeCacheObject();
        break;
      }
      itr.next();
    }
    this.saveClose();
  }
 catch (  DataException de) {
    removeCacheObject();
    throw de;
  }
 finally {
    try {
      itr.first(0);
    }
 catch (    DataException e) {
    }
  }
}

Fixed version (ground truth):
public void saveDataSetResult(IResultIterator itr) throws DataException {
  try {
    int saved=0;
    IResultObject resultObject=null;
    IDataSetCacheObject dataSetCachedObject=getCacheObject();
    this.saveInit(dataSetCachedObject);
    itr.first(0);
    while (itr.getCurrentResult() != null) {
      resultObject=itr.getCurrentResult();
      saveUtil.saveObject(resultObject);
      saved++;
      if (increCacheMode == null && saved >= cacheCount) {
        break;
      }
      if (session.getStopSign().isStopped()) {
        removeCacheObject();
        break;
      }
      itr.next();
    }
    this.saveClose(dataSetCachedObject);
  }
 catch (  DataException de) {
    removeCacheObject();
    throw de;
  }
 finally {
    try {
      itr.first(0);
    }
 catch (    DataException e) {
    }
  }
}
Program: 65695
Project: 65695
Buggy source:
/** 
 * @throws DataException
 */
private void saveClose() throws DataException {
  if (saveUtil != null) {
    saveUtil.close();
    saveUtil=null;
  }
}

Fixed version (ground truth):
/** 
 * @throws DataException
 */
private void saveClose(IDataSetCacheObject dataSetCachedObject) throws DataException {
  if (saveUtil != null) {
    getDataSetCacheManager().saveFinished(dataSetCachedObject);
    saveUtil.close();
    saveUtil=null;
  }
}
Program: 65696
Project: 65696
Buggy source:
/** 
 * Init save util
 * @throws DataException 
 */
private void saveInit() throws DataException {
  saveUtil=CacheUtilFactory.createSaveUtil(getCacheObject(),this.rsMeta,this.session);
}

Fixed version (ground truth):
/** 
 * Init save util
 * @throws DataException 
 */
private void saveInit(IDataSetCacheObject dataSetCachedObject) throws DataException {
  saveUtil=CacheUtilFactory.createSaveUtil(dataSetCachedObject,this.rsMeta,this.session);
}
Program: 65700
Project: 65700
Buggy source:
/** 
 * @return
 * @throws DataException
 * @throws IOException
 */
private IDiskArray[] getFilterResult() throws DataException, IOException {
  IDimension[] dimensions=cube.getDimesions();
  IDiskArray[] dimPosition=new IDiskArray[dimensions.length];
  for (int i=0; i < dimPosition.length; i++) {
    Dimension dimension=(Dimension)dimensions[i];
    List jsFilters=getDimensionJSFilterList(dimension.getName());
    LevelFilterHelper filterHelper=new LevelFilterHelper(dimension,simpleLevelFilters,levelFilters);
    dimPosition[i]=filterHelper.getJSFilterResult(jsFilters,isBreakHierarchy);
  }
  return dimPosition;
}

Fixed version (ground truth):
/** 
 * @return
 * @throws DataException
 * @throws IOException
 */
public IDiskArray[] getFilterResult() throws DataException, IOException {
  IDimension[] dimensions=cube.getDimesions();
  IDiskArray[] dimPosition=new IDiskArray[dimensions.length];
  for (int i=0; i < dimPosition.length; i++) {
    Dimension dimension=(Dimension)dimensions[i];
    List jsFilters=getDimensionJSFilterList(dimension.getName());
    LevelFilterHelper filterHelper=new LevelFilterHelper(dimension,simpleLevelFilters,levelFilters);
    dimPosition[i]=filterHelper.getJSFilterResult(jsFilters,isBreakHierarchy);
  }
  return dimPosition;
}
Program: 65702
Project: 65702
Buggy source:
private ICubeCursor createCursor(IBindingValueFetcher fetcher) throws DataException, IOException, OLAPException {
  ICubeCursor cursor;
  CubeQueryExecutor executor=new CubeQueryExecutor(this.outResults,cubeQueryDefinition,this.session,this.scope,this.context);
  executor.getdimensionSimpleFilter().addAll(this.preparedQuery.getInternalFilters());
  IDocumentManager documentManager=getDocumentManager(executor);
  ICube cube=null;
  try {
    if (!isStandAloneQuery(cubeQueryDefinition,session.getEngineContext()))     cube=loadCube(documentManager,executor);
  }
 catch (  Exception ex) {
    throw new DataException(ResourceConstants.FAIL_LOAD_CUBE,ex);
  }
  BirtCubeView bcv=new BirtCubeView(executor,cube,appContext,fetcher);
  CubeCursor cubeCursor=bcv.getCubeCursor(stopSign,cube);
  if (cube != null)   cube.close();
  String newResultSetId=executor.getQueryResultsId();
  if (newResultSetId != null) {
    this.queryResultsId=newResultSetId;
  }
  this.scope.put(ScriptConstants.MEASURE_SCRIPTABLE,this.scope,new JSMeasureAccessor(cubeCursor,bcv.getMeasureMapping()));
  this.scope.put(ScriptConstants.DIMENSION_SCRIPTABLE,this.scope,new JSLevelAccessor(this.cubeQueryDefinition,bcv));
  cursor=new CubeCursorImpl(outResults,cubeCursor,this.scope,session.getEngineContext().getScriptContext(),cubeQueryDefinition,bcv);
  return cursor;
}

Fixed version (ground truth):
private ICubeCursor createCursor(IBindingValueFetcher fetcher) throws DataException, IOException, OLAPException {
  ICubeCursor cursor;
  executor=new CubeQueryExecutor(this.outResults,cubeQueryDefinition,this.session,this.scope,this.context);
  executor.getdimensionSimpleFilter().addAll(this.preparedQuery.getInternalFilters());
  IDocumentManager documentManager=getDocumentManager(executor);
  ICube cube=null;
  try {
    if (!isStandAloneQuery(cubeQueryDefinition,session.getEngineContext()))     cube=loadCube(documentManager,executor);
  }
 catch (  Exception ex) {
    throw new DataException(ResourceConstants.FAIL_LOAD_CUBE,ex);
  }
  BirtCubeView bcv=new BirtCubeView(executor,cube,appContext,fetcher);
  CubeCursor cubeCursor=bcv.getCubeCursor(stopSign,cube);
  if (cube != null)   cube.close();
  String newResultSetId=executor.getQueryResultsId();
  if (newResultSetId != null) {
    this.queryResultsId=newResultSetId;
  }
  this.scope.put(ScriptConstants.MEASURE_SCRIPTABLE,this.scope,new JSMeasureAccessor(cubeCursor,bcv.getMeasureMapping()));
  this.scope.put(ScriptConstants.DIMENSION_SCRIPTABLE,this.scope,new JSLevelAccessor(this.cubeQueryDefinition,bcv));
  cursor=new CubeCursorImpl(outResults,cubeCursor,this.scope,session.getEngineContext().getScriptContext(),cubeQueryDefinition,bcv);
  return cursor;
}
Program: 65703
Project: 65703
Buggy source:
public ArgumentInfo(String name,String displayName,String description,boolean isOptinal){
  this.name=name;
  this.displayName=displayName;
  this.description=description;
  this.isOptional=isOptional;
}

Fixed version (ground truth):
public ArgumentInfo(String name,String displayName,String description,boolean isOptional){
  this.name=name;
  this.displayName=displayName;
  this.description=description;
  this.isOptional=isOptional;
}
Program: 65705
Project: 65705
Buggy source:
public TextCombo(Composite parent,int style){
  super(parent,style);
  GC gc=new GC(this);
  itemHeight=gc.getFontMetrics().getHeight() + 2;
  addDisposeListener(new DisposeListener(){
    public void widgetDisposed(    DisposeEvent e){
      fontBold.dispose();
      choiceMarkerMap.clear();
    }
  }
);
}

Fixed version (ground truth):
public TextCombo(Composite parent,int style){
  super(parent,style);
  GC gc=new GC(this);
  itemHeight=gc.getFontMetrics().getHeight() + 2;
  if (gc.getFont().getFontData() == null || gc.getFont().getFontData().length == 0) {
    fontBold=new Font(Display.getCurrent(),"String_Node_Str",9,SWT.BOLD);
  }
 else {
    FontData fd=gc.getFont().getFontData()[0];
    fontBold=new Font(gc.getDevice(),fd.getName(),fd.getHeight(),fd.getStyle() | SWT.BOLD);
  }
  addDisposeListener(new DisposeListener(){
    public void widgetDisposed(    DisposeEvent e){
      fontBold.dispose();
      choiceMarkerMap.clear();
    }
  }
);
}
Program: 65706
Project: 65706
Buggy source:
public TextCombo(Composite parent,int style){
  super(parent,style);
  GC gc=new GC(this);
  itemHeight=gc.getFontMetrics().getHeight() + 2;
  if (gc.getFont().getFontData() == null || gc.getFont().getFontData().length == 0) {
    fontBold=new Font(Display.getCurrent(),"String_Node_Str",9,SWT.BOLD);
  }
 else {
    FontData fd=gc.getFont().getFontData()[0];
    fontBold=new Font(gc.getDevice(),fd.getName(),fd.getHeight(),fd.getStyle() | SWT.BOLD);
  }
  addDisposeListener(new DisposeListener(){
    public void widgetDisposed(    DisposeEvent e){
      fontBold.dispose();
      choiceMarkerMap.clear();
    }
  }
);
}

Fixed version (ground truth):
public TextCombo(Composite parent,int style){
  super(parent,style);
  GC gc=new GC(this);
  itemHeight=gc.getFontMetrics().getHeight() + 2;
  addDisposeListener(new DisposeListener(){
    public void widgetDisposed(    DisposeEvent e){
      fontBold.dispose();
      choiceMarkerMap.clear();
    }
  }
);
}
Program: 65707
Project: 65707
Buggy source:
public boolean add(Object o) throws IOException {
  if (size >= currentCacheStartIndex && size < (currentCacheStartIndex + bufferSize)) {
    buffer[size - currentCacheStartIndex]=o;
  }
  writeObject(o);
  size++;
  if (size % bufferSize == 0) {
    segmentOffsets.add(Integer.valueOf(getOffset()));
  }
  return true;
}

Fixed version (ground truth):
public boolean add(Object o) throws IOException {
  if (size >= currentCacheStartIndex && size < (currentCacheStartIndex + bufferSize)) {
    buffer[size - currentCacheStartIndex]=o;
  }
  writeObject(o);
  size++;
  if (size % bufferSize == 0) {
    segmentOffsets.add(getOffset());
  }
  return true;
}
Program: 65708
Project: 65708
Buggy source:
/** 
 * @return
 * @throws IOException
 */
private int getOffset() throws IOException {
  return (int)(randomAccessFile.getFilePointer());
}

Fixed version (ground truth):
/** 
 * @return
 * @throws IOException
 */
private long getOffset() throws IOException {
  return randomAccessFile.getFilePointer();
}
Program: 65709
Project: 65709
Buggy source:
public void clear() throws IOException {
  this.currentCacheStartIndex=-1;
  this.size=0;
  clearDiskFile();
  this.segmentOffsets.clear();
  this.segmentOffsets.add(Integer.valueOf(0));
  createRandomAccessFile();
}

Fixed version (ground truth):
public void clear() throws IOException {
  this.currentCacheStartIndex=-1;
  this.size=0;
  clearDiskFile();
  this.segmentOffsets.clear();
  this.segmentOffsets.add(Long.valueOf(0L));
  createRandomAccessFile();
}