nus-yam/ex-repair huggingface dataset:
Program: 76472
Project: 76472
Buggy source:
public void testSearchStringStringInt(){
  assertEquals(((Integer)cx.evaluateString(scope,"String_Node_Str","String_Node_Str",1,null)),new Integer(6));
  assertEquals(((Integer)cx.evaluateString(scope,"String_Node_Str","String_Node_Str",1,null)),new Integer(6));
  assertEquals(((Integer)cx.evaluateString(scope,"String_Node_Str","String_Node_Str",1,null)),new Integer(6));
  assertEquals(((Integer)cx.evaluateString(scope,"String_Node_Str","String_Node_Str",1,null)),new Integer(-1));
  assertEquals(((Integer)cx.evaluateString(scope,"String_Node_Str","String_Node_Str",1,null)),new Integer(0));
  assertEquals(((Integer)cx.evaluateString(scope,"String_Node_Str","String_Node_Str",1,null)),new Integer(21));
  assertEquals(((Integer)cx.evaluateString(scope,"String_Node_Str","String_Node_Str",1,null)),new Integer(2));
}

Fixed version (ground truth):
public void testSearchStringStringInt(){
  assertEquals(((Integer)cx.evaluateString(scope,"String_Node_Str","String_Node_Str",1,null)),new Integer(6));
  assertEquals(((Integer)cx.evaluateString(scope,"String_Node_Str","String_Node_Str",1,null)),new Integer(6));
  assertEquals(((Integer)cx.evaluateString(scope,"String_Node_Str","String_Node_Str",1,null)),new Integer(6));
  assertEquals(((Integer)cx.evaluateString(scope,"String_Node_Str","String_Node_Str",1,null)),new Integer(-1));
  assertEquals(((Integer)cx.evaluateString(scope,"String_Node_Str","String_Node_Str",1,null)),new Integer(0));
  assertEquals(((Integer)cx.evaluateString(scope,"String_Node_Str","String_Node_Str",1,null)),new Integer(21));
  assertEquals(((Integer)cx.evaluateString(scope,"String_Node_Str","String_Node_Str",1,null)),new Integer(2));
  assertEquals(((Integer)cx.evaluateString(scope,"String_Node_Str","String_Node_Str",1,null)),new Integer(0));
}
Program: 76473
Project: 76473
Buggy source:
public int getGroupLevel(){
  if (generateBy instanceof GroupDesign) {
    GroupDesign design=(GroupDesign)generateBy;
    return design.getGroupLevel();
  }
  return -1;
}

Fixed version (ground truth):
public int getGroupLevel(){
  if (groupLevel == -1) {
    if (generateBy instanceof GroupDesign) {
      GroupDesign design=(GroupDesign)generateBy;
      groupLevel=design.getGroupLevel();
    }
 else     if (parent instanceof GroupContent) {
      groupLevel=((GroupContent)parent).getGroupLevel();
    }
 else {
      return 0;
    }
  }
  return groupLevel;
}
Program: 76474
Project: 76474
Buggy source:
/** 
 * populate all available value in selectValueList
 */
private void populateList(){
  try {
    getOkButton().setEnabled(false);
    selectValueList.removeAll();
    viewerValueList.clear();
    if (modelValueList != null && modelValueList.size() > 0) {
      Iterator iter=modelValueList.iterator();
      while (iter.hasNext()) {
        Object candiateValue=iter.next();
        if (candiateValue != null) {
          String displayCandiateValue;
          if (candiateValue instanceof Date) {
            DateFormatter formatter=new DateFormatter(ULocale.US);
            formatter.applyPattern("String_Node_Str");
            displayCandiateValue=formatter.format((Date)candiateValue);
          }
 else           displayCandiateValue=DataTypeUtil.toString(candiateValue);
          viewerValueList.add(displayCandiateValue);
          selectValueList.add(displayCandiateValue);
        }
      }
    }
 else {
      selectValueList.removeAll();
      modelValueList.clear();
      viewerValueList.clear();
      ExceptionHandler.openErrorMessageBox(Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    }
    if (selectValueList.getItemCount() > 0) {
      selectValueList.select(0);
      getOkButton().setEnabled(true);
    }
  }
 catch (  Exception e) {
    ExceptionHandler.handle(e);
  }
}

Fixed version (ground truth):
/** 
 * populate all available value in selectValueList
 */
private void populateList(){
  try {
    getOkButton().setEnabled(false);
    selectValueList.removeAll();
    viewerValueList.clear();
    if (modelValueList != null) {
      Iterator iter=modelValueList.iterator();
      while (iter.hasNext()) {
        Object candiateValue=iter.next();
        if (candiateValue != null) {
          String displayCandiateValue;
          if (candiateValue instanceof Date) {
            DateFormatter formatter=new DateFormatter(ULocale.US);
            formatter.applyPattern("String_Node_Str");
            displayCandiateValue=formatter.format((Date)candiateValue);
          }
 else           displayCandiateValue=DataTypeUtil.toString(candiateValue);
          viewerValueList.add(displayCandiateValue);
          selectValueList.add(displayCandiateValue);
        }
      }
    }
 else {
      selectValueList.removeAll();
      modelValueList.clear();
      viewerValueList.clear();
      ExceptionHandler.openErrorMessageBox(Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    }
    if (selectValueList.getItemCount() > 0) {
      selectValueList.select(0);
      getOkButton().setEnabled(true);
    }
  }
 catch (  Exception e) {
    ExceptionHandler.handle(e);
  }
}
Program: 76475
Project: 76475
Buggy source:
public Collection getColumnValueSet(DataSetHandle dataSet,Iterator inputParamBindings,Iterator columnBindings,String boundColumnName,IRequestInfo requestInfo) throws BirtException {
  IQueryResults queryResults=getGroupingQueryResults(dataSet,inputParamBindings,columnBindings,boundColumnName);
  IResultIterator resultIt=queryResults.getResultIterator();
  int maxRowCount=-1;
  if (requestInfo != null) {
    resultIt.moveTo(requestInfo.getStartRow());
    maxRowCount=requestInfo.getMaxRow();
  }
  ArrayList values=new ArrayList();
  while (resultIt.next() && maxRowCount != 0) {
    Object value=resultIt.getValue(boundColumnName);
    values.add(value);
    resultIt.skipToEnd(1);
    maxRowCount--;
  }
  resultIt.close();
  queryResults.close();
  return values;
}

Fixed version (ground truth):
public Collection getColumnValueSet(DataSetHandle dataSet,Iterator inputParamBindings,Iterator columnBindings,String boundColumnName,IRequestInfo requestInfo) throws BirtException {
  ArrayList temp=new ArrayList();
  while (columnBindings.hasNext()) {
    temp.add(columnBindings.next());
  }
  if (referToAggregation(temp,boundColumnName))   return new ArrayList();
  IQueryResults queryResults=getGroupingQueryResults(dataSet,inputParamBindings,temp.iterator(),boundColumnName);
  IResultIterator resultIt=queryResults.getResultIterator();
  int maxRowCount=-1;
  if (requestInfo != null) {
    resultIt.moveTo(requestInfo.getStartRow());
    maxRowCount=requestInfo.getMaxRow();
  }
  ArrayList values=new ArrayList();
  while (resultIt.next() && maxRowCount != 0) {
    Object value=resultIt.getValue(boundColumnName);
    values.add(value);
    resultIt.skipToEnd(1);
    maxRowCount--;
  }
  resultIt.close();
  queryResults.close();
  return values;
}
Program: 76476
Project: 76476
Buggy source:
/** 
 * This method returns a list of ICubeAggrDefn instances which describes the aggregations that need to be calcualted in cube query.
 * @param bindings
 * @return
 */
public static ICubeAggrDefn[] getAggrDefns(List bindings){
  if (bindings == null || bindings.size() == 0)   return new ICubeAggrDefn[0];
  List cubeAggrDefns=new ArrayList();
  for (Iterator it=bindings.iterator(); it.hasNext(); ) {
    IBinding binding=((IBinding)it.next());
    String measure=getMeasure(binding.getExpression());
    if (measure != null)     cubeAggrDefns.add(new CubeAggrDefn(binding.getBindingName(),measure,binding.getAggregatOns(),binding.getAggrFunction()));
  }
  ICubeAggrDefn[] result=new ICubeAggrDefn[cubeAggrDefns.size()];
  for (int i=0; i < result.length; i++) {
    result[i]=(ICubeAggrDefn)cubeAggrDefns.get(i);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * This method returns a list of ICubeAggrDefn instances which describes the aggregations that need to be calcualted in cube query.
 * @param bindings
 * @return
 */
public static ICubeAggrDefn[] getAggrDefns(List bindings){
  if (bindings == null || bindings.size() == 0)   return new ICubeAggrDefn[0];
  List cubeAggrDefns=new ArrayList();
  for (Iterator it=bindings.iterator(); it.hasNext(); ) {
    IBinding binding=((IBinding)it.next());
    if (binding.getExpression() instanceof IScriptExpression) {
      String measure=getMeasure(((IScriptExpression)binding.getExpression()).getText());
      if (measure != null)       cubeAggrDefns.add(new CubeAggrDefn(binding.getBindingName(),measure,binding.getAggregatOns(),binding.getAggrFunction()));
    }
  }
  ICubeAggrDefn[] result=new ICubeAggrDefn[cubeAggrDefns.size()];
  for (int i=0; i < result.length; i++) {
    result[i]=(ICubeAggrDefn)cubeAggrDefns.get(i);
  }
  return result;
}
Program: 76477
Project: 76477
Buggy source:
/** 
 * Inserts a dimension view to given row/column axis in the specified position.
 * @param crosstab
 * @param dimensionView
 * @param axisType
 * @param index
 * @param measureListMap
 * @param functionMap
 * @throws SemanticException
 */
public static void insertDimension(CrosstabReportItemHandle crosstab,DimensionViewHandle dimensionView,int axisType,int index,Map measureListMap,Map functionMap) throws SemanticException {
  if (crosstab == null || dimensionView == null || !isValidAxisType(axisType))   return;
  CommandStack stack=crosstab.getCommandStack();
  stack.startTrans(null);
  try {
    CrosstabViewHandle crosstabView=crosstab.getCrosstabView(axisType);
    if (crosstabView == null) {
      crosstabView=crosstab.addCrosstabView(axisType);
    }
    crosstabView.getViewsProperty().add(dimensionView.getModelHandle(),index);
    String dimensionName=dimensionView.getCubeDimensionName();
    for (int i=0; i < dimensionView.getLevelCount(); i++) {
      LevelViewHandle levelView=dimensionView.getLevel(i);
      String levelName=levelView.getCubeLevelName();
      List measures=(List)(measureListMap == null ? null : measureListMap.get(levelName));
      List functions=(List)(functionMap == null ? null : functionMap.get(levelName));
      addMeasureAggregations(crosstab,axisType,levelView,dimensionName,levelView.getCubeLevelName(),false,functions,measures,true);
    }
  }
 catch (  SemanticException e) {
    stack.rollback();
    throw e;
  }
  stack.commit();
}

Fixed version (ground truth):
/** 
 * Inserts a dimension view to given row/column axis in the specified position.
 * @param crosstab
 * @param dimensionView
 * @param axisType
 * @param index
 * @param measureListMap
 * @param functionMap
 * @throws SemanticException
 */
public static void insertDimension(CrosstabReportItemHandle crosstab,DimensionViewHandle dimensionView,int axisType,int index,Map measureListMap,Map functionMap) throws SemanticException {
  if (crosstab == null || dimensionView == null || !isValidAxisType(axisType))   return;
  CommandStack stack=crosstab.getCommandStack();
  stack.startTrans(null);
  try {
    CrosstabViewHandle crosstabView=crosstab.getCrosstabView(axisType);
    if (crosstabView == null) {
      crosstabView=crosstab.addCrosstabView(axisType);
    }
    crosstabView.getViewsProperty().add(dimensionView.getModelHandle(),index);
    String dimensionName=dimensionView.getCubeDimensionName();
    for (int i=0; i < dimensionView.getLevelCount(); i++) {
      LevelViewHandle levelView=dimensionView.getLevel(i);
      String levelName=levelView.getCubeLevelName();
      List measures=(List)(measureListMap == null ? null : measureListMap.get(levelName));
      List functions=(List)(functionMap == null ? null : functionMap.get(levelName));
      insertLevel(crosstab,levelView,dimensionName,levelView.getCubeLevelName(),axisType,measures,functions);
    }
  }
 catch (  SemanticException e) {
    stack.rollback();
    throw e;
  }
  stack.commit();
}
Program: 76479
Project: 76479
Buggy source:
/** 
 * @param crosstab
 * @param levelView
 * @param dimensionName
 * @param levelName
 * @param axisType
 * @param isAdd
 * @throws SemanticException
 */
private static void insertLevel(CrosstabReportItemHandle crosstab,LevelViewHandle levelView,String dimensionName,String levelName,int axisType) throws SemanticException {
}

Fixed version (ground truth):
/** 
 * @param crosstab
 * @param levelView
 * @param dimensionName
 * @param levelName
 * @param axisType
 * @param isAdd
 * @throws SemanticException
 */
private static void insertLevel(CrosstabReportItemHandle crosstab,LevelViewHandle levelView,String dimensionName,String levelName,int axisType,List measures,List functions) throws SemanticException {
}
Program: 76480
Project: 76480
Buggy source:
public IParameterMetaData getParameterMetaData() throws OdaException {
  assertNotNull(callStat);
  int[] positionArray=paramUtil.getParameterPositions();
  List paramMetaList1=this.getCallableParamMetaData();
  List paramMetaList2=new ArrayList();
  for (int i=0; i < positionArray.length; i++) {
    int index=positionArray[i];
    paramMetaList2.add(paramMetaList1.get(index - 1));
  }
  return new SPParameterMetaData(paramMetaList2);
}

Fixed version (ground truth):
public IParameterMetaData getParameterMetaData() throws OdaException {
  assertNotNull(callStat);
  int[] positionArray=paramUtil.getParameterPositions();
  List paramMetaList1=this.getCallableParamMetaData();
  List paramMetaList2=new ArrayList();
  if (positionArray.length != paramMetaList1.size())   throw new OdaException("String_Node_Str");
  for (int i=0; i < positionArray.length; i++) {
    int index=positionArray[i];
    paramMetaList2.add(paramMetaList1.get(index - 1));
  }
  return new SPParameterMetaData(paramMetaList2);
}
Program: 76481
Project: 76481
Buggy source:
public IResultSetMetaData getMetaData() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,CallStatement.class.getName(),"String_Node_Str","String_Node_Str");
  java.sql.ResultSetMetaData resultmd=null;
  try {
    assertNotNull(callStat);
    resultmd=callStat.getMetaData();
  }
 catch (  NullPointerException e) {
    resultmd=null;
  }
catch (  SQLException e) {
  }
  IResultSetMetaData pstmtResultMetaData=null;
  if (resultmd != null) {
    pstmtResultMetaData=new ResultSetMetaData(resultmd);
  }
 else {
    IResultSet mdRs=null;
    try {
      mdRs=executeQuery();
    }
 catch (    OdaException e) {
      mdRs=null;
    }
    try {
      if (mdRs != null)       pstmtResultMetaData=mdRs.getMetaData();
 else       pstmtResultMetaData=new SPResultSetMetaData(null);
    }
 catch (    OdaException e) {
    }
  }
  return pstmtResultMetaData;
}

Fixed version (ground truth):
public IResultSetMetaData getMetaData() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,CallStatement.class.getName(),"String_Node_Str","String_Node_Str");
  java.sql.ResultSetMetaData resultmd=null;
  try {
    assertNotNull(callStat);
    resultmd=callStat.getMetaData();
  }
 catch (  NullPointerException e) {
    resultmd=null;
  }
catch (  SQLException e) {
  }
  IResultSetMetaData pstmtResultMetaData=null;
  if (resultmd != null) {
    pstmtResultMetaData=new ResultSetMetaData(resultmd);
  }
 else {
    IResultSet mdRs=null;
    try {
      mdRs=executeQuery();
    }
 catch (    OdaException e) {
      throw e;
    }
    try {
      if (mdRs != null)       pstmtResultMetaData=mdRs.getMetaData();
 else       pstmtResultMetaData=new SPResultSetMetaData(null);
    }
 catch (    OdaException e) {
    }
  }
  return pstmtResultMetaData;
}
Program: 76482
Project: 76482
Buggy source:
/** 
 * This method will return NULL if the named data set is not cached. Otherwise, it will return a IResultMetaData instance which provides at least the ColumnName and ColumnType information for all cached columns. Please note that the ParameterHint information will usually essential to the result of data set design is omitted for it has nothing to do with the metadata.
 * @param dataSource
 * @param dataSet
 * @param parameterHints
 * @return
 * @throws BirtException
 */
abstract public IResultMetaData getCachedDataSetMetaData(IBaseDataSourceDesign dataSource,IBaseDataSetDesign dataSet) throws BirtException ;

Fixed version (ground truth):
/** 
 * This method will return NULL if the named data set is not cached. Otherwise, it will return an IResultMetaData instance which provides at least the ColumnName and ColumnType information for all cached columns. Please note that the ParameterHint information will usually essential to the result of data set design is omitted for it has nothing to do with the metadata.
 * @param dataSource
 * @param dataSet
 * @param parameterHints
 * @return
 * @throws BirtException
 */
abstract public IResultMetaData getCachedDataSetMetaData(IBaseDataSourceDesign dataSource,IBaseDataSetDesign dataSet) throws BirtException ;
Program: 76483
Project: 76483
Buggy source:
/** 
 * Removes grand total from crosstab if it is not empty, otherwise do nothing.
 */
public void removeGrandTotal(){
  PropertyHandle propHandle=getGrandTotalProperty();
  if (propHandle.getContentCount() > 0) {
    CommandStack stack=getCommandStack();
    stack.startTrans(null);
    try {
      propHandle.drop(0);
      CrosstabReportItemHandle crosstab=getCrosstab();
      if (crosstab != null) {
        CrosstabUtil.adjustMeasureAggregations(crosstab,getAxisType(),null,null,null,false,false);
      }
    }
 catch (    SemanticException e) {
      logger.log(Level.INFO,e.getMessage(),e);
      stack.rollback();
    }
    stack.commit();
  }
}

Fixed version (ground truth):
/** 
 * Removes grand total from crosstab if it is not empty, otherwise do nothing.
 */
public void removeGrandTotal(){
  PropertyHandle propHandle=getGrandTotalProperty();
  if (propHandle.getContentCount() > 0) {
    CommandStack stack=getCommandStack();
    stack.startTrans(null);
    try {
      CrosstabReportItemHandle crosstab=getCrosstab();
      if (crosstab != null) {
        CrosstabUtil.adjustMeasureAggregations(crosstab,getAxisType(),null,null,null,false,false);
      }
      propHandle.drop(0);
    }
 catch (    SemanticException e) {
      logger.log(Level.INFO,e.getMessage(),e);
      stack.rollback();
    }
    stack.commit();
  }
}
Program: 76484
Project: 76484
Buggy source:
/** 
 * Removes the aggregation header cell if it is not empty, otherwise do nothing.
 */
public void removeAggregationHeader(){
  if (getAggregationHeaderProperty().getContentCount() > 0) {
    CommandStack stack=getCommandStack();
    stack.startTrans(null);
    try {
      getAggregationHeaderProperty().drop(0);
      CrosstabReportItemHandle crosstab=getCrosstab();
      if (crosstab != null) {
        CrosstabUtil.adjustMeasureAggregations(crosstab,getAxisType(),this,((DimensionViewHandle)getContainer()).getCubeDimensionName(),getCubeLevelName(),isInnerMost(),false);
      }
    }
 catch (    SemanticException e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      stack.rollback();
    }
    stack.commit();
  }
}

Fixed version (ground truth):
/** 
 * Removes the aggregation header cell if it is not empty, otherwise do nothing.
 */
public void removeAggregationHeader(){
  if (getAggregationHeaderProperty().getContentCount() > 0) {
    CommandStack stack=getCommandStack();
    stack.startTrans(null);
    try {
      CrosstabReportItemHandle crosstab=getCrosstab();
      if (crosstab != null) {
        CrosstabUtil.adjustMeasureAggregations(crosstab,getAxisType(),this,((DimensionViewHandle)getContainer()).getCubeDimensionName(),getCubeLevelName(),isInnerMost(),false);
      }
      getAggregationHeaderProperty().drop(0);
    }
 catch (    SemanticException e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      stack.rollback();
    }
    stack.commit();
  }
}
Program: 76486
Project: 76486
Buggy source:
/** 
 * Test case: <br> To read a design file, uses adapter to create a data source design. Checks values of the created data source design.
 * @throws Exception
 */
public void testROMDataSourceToODADataSource() throws Exception {
  openDesign(INPUT_FILE);
  OdaDataSourceHandle sourceHandle=(OdaDataSourceHandle)designHandle.findDataSource("String_Node_Str");
  DataSourceDesign sourceDesign=new ModelOdaAdapter().createDataSourceDesign(sourceHandle);
  assertEquals("String_Node_Str",sourceDesign.getName());
  assertEquals(DATA_SOURCE_EXTENSIONID,sourceDesign.getOdaExtensionId());
  assertEquals("String_Node_Str",sourceDesign.getDisplayName());
  Properties props=sourceDesign.getPublicProperties();
  assertEquals(5,props.getProperties().size());
  assertEquals("String_Node_Str",props.findProperty("String_Node_Str").getValue());
  assertEquals("String_Node_Str",props.findProperty("String_Node_Str").getValue());
  assertNull(props.findProperty("String_Node_Str").getValue());
  assertNull(props.findProperty("String_Node_Str").getValue());
  props=sourceDesign.getPrivateProperties();
  assertEquals(2,props.getProperties().size());
  assertEquals("String_Node_Str",props.findProperty("String_Node_Str").getValue());
  assertEquals("String_Node_Str",props.findProperty("String_Node_Str").getValue());
}

Fixed version (ground truth):
/** 
 * Test case: <br> To read a design file, uses adapter to create a data source design. Checks values of the created data source design.
 * @throws Exception
 */
public void testROMDataSourceToODADataSource() throws Exception {
  openDesign(INPUT_FILE);
  OdaDataSourceHandle sourceHandle=(OdaDataSourceHandle)designHandle.findDataSource("String_Node_Str");
  DataSourceDesign sourceDesign=new ModelOdaAdapter().createDataSourceDesign(sourceHandle);
  assertEquals("String_Node_Str",sourceDesign.getName());
  assertEquals(DATA_SOURCE_EXTENSIONID,sourceDesign.getOdaExtensionId());
  assertEquals("String_Node_Str",sourceDesign.getDisplayName());
  Properties props=sourceDesign.getPublicProperties();
  assertEquals(7,props.getProperties().size());
  assertEquals("String_Node_Str",props.findProperty("String_Node_Str").getValue());
  assertEquals("String_Node_Str",props.findProperty("String_Node_Str").getValue());
  assertNull(props.findProperty("String_Node_Str").getValue());
  assertNull(props.findProperty("String_Node_Str").getValue());
  props=sourceDesign.getPrivateProperties();
  assertEquals(2,props.getProperties().size());
  assertEquals("String_Node_Str",props.findProperty("String_Node_Str").getValue());
  assertEquals("String_Node_Str",props.findProperty("String_Node_Str").getValue());
}
Program: 76488
Project: 76488
Buggy source:
public void widgetSelected(SelectionEvent e){
  TreeItem item=(TreeItem)e.item;
  if (item != null) {
    if (item.getData() instanceof ReportDesignHandle) {
      String reportname=item.getText().substring(0,item.getText().lastIndexOf("String_Node_Str"));
      description.setText(DescriptionMessages.getDescription(reportname));
      previewSampleReport(reportname);
      setSelectedElement(item);
    }
 else     if (item.getText().equals("String_Node_Str")) {
      description.setText(DescriptionMessages.getDescription("String_Node_Str"));
      setSelectedElement(item.getData());
    }
 else {
      description.setText(Messages.getString("String_Node_Str"));
      setSelectedElement(item.getData());
    }
  }
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  TreeItem item=(TreeItem)e.item;
  if (item != null) {
    if (item.getData() instanceof ReportDesignHandle) {
      String reportname=item.getText().substring(0,item.getText().lastIndexOf("String_Node_Str"));
      description.setText(DescriptionMessages.getDescription(reportname));
      previewSampleReport(reportname);
      setSelectedElement(item);
    }
 else     if (item.getText().equals("String_Node_Str")) {
      description.setText(DescriptionMessages.getDescription("String_Node_Str"));
      setSelectedElement(item);
    }
 else {
      description.setText(Messages.getString("String_Node_Str"));
      setSelectedElement(item);
    }
  }
}
Program: 76489
Project: 76489
Buggy source:
/** 
 * Test feature of whether cache will be used
 * @throws BirtException
 */
public void testUseAppContextCacheRowLimit3() throws BirtException, Exception {
  this.dataSet.setCacheRowCount(100);
  DataEngineContext dec=DataEngineContext.newInstance(DataEngineContext.DIRECT_PRESENTATION,null,null,null);
  DataEngineImpl myDataEngine=(DataEngineImpl)DataEngine.newDataEngine(dec);
  myDataEngine.defineDataSource(this.dataSource);
  myDataEngine.defineDataSet(this.dataSet);
  this.appContextMap.put(DataEngine.DATA_SET_CACHE_ROW_LIMIT,new Integer(4));
  this.testUseCache1();
}

Fixed version (ground truth):
/** 
 * @throws BirtException
 */
public void testUseAppContextCacheRowLimit3() throws BirtException, Exception {
  this.dataSet.setCacheRowCount(100);
  DataEngineContext dec=DataEngineContext.newInstance(DataEngineContext.DIRECT_PRESENTATION,null,null,null);
  DataEngineImpl myDataEngine=(DataEngineImpl)DataEngine.newDataEngine(dec);
  myDataEngine.defineDataSource(this.dataSource);
  myDataEngine.defineDataSet(this.dataSet);
  this.appContextMap.put(DataEngine.DATA_SET_CACHE_ROW_LIMIT,new Integer(4));
  this.testUseCache1();
}
Program: 76490
Project: 76490
Buggy source:
/** 
 * Test feature of whether cache will be used
 * @throws BirtException
 */
public void testUseAppContextCacheRowLimit2() throws BirtException, Exception {
  this.dataSet.setCacheRowCount(2);
  DataEngineContext dec=DataEngineContext.newInstance(DataEngineContext.DIRECT_PRESENTATION,null,null,null);
  dec.setCacheOption(DataEngineContext.CACHE_USE_ALWAYS,3);
  DataEngineImpl myDataEngine=(DataEngineImpl)DataEngine.newDataEngine(dec);
  myDataEngine.defineDataSource(this.dataSource);
  myDataEngine.defineDataSet(this.dataSet);
  this.appContextMap.put(DataEngine.DATA_SET_CACHE_ROW_LIMIT,new Integer(-1));
  this.testUseCache1();
}

Fixed version (ground truth):
/** 
 * @throws BirtException
 */
public void testUseAppContextCacheRowLimit2() throws BirtException, Exception {
  this.dataSet.setCacheRowCount(2);
  DataEngineContext dec=DataEngineContext.newInstance(DataEngineContext.DIRECT_PRESENTATION,null,null,null);
  dec.setCacheOption(DataEngineContext.CACHE_USE_ALWAYS,3);
  DataEngineImpl myDataEngine=(DataEngineImpl)DataEngine.newDataEngine(dec);
  myDataEngine.defineDataSource(this.dataSource);
  myDataEngine.defineDataSet(this.dataSet);
  this.appContextMap.put(DataEngine.DATA_SET_CACHE_ROW_LIMIT,new Integer(-1));
  this.testUseCache1();
}
Program: 76491
Project: 76491
Buggy source:
/** 
 * Test feature of whether cache will be used
 * @throws BirtException
 */
public void testUseAppContextCacheRowLimit1() throws BirtException, Exception {
  this.dataSet.setCacheRowCount(100);
  DataEngineContext dec=DataEngineContext.newInstance(DataEngineContext.DIRECT_PRESENTATION,null,null,null);
  dec.setCacheOption(DataEngineContext.CACHE_USE_ALWAYS,100);
  DataEngineImpl myDataEngine=(DataEngineImpl)DataEngine.newDataEngine(dec);
  myDataEngine.defineDataSource(this.dataSource);
  myDataEngine.defineDataSet(this.dataSet);
  this.appContextMap.put(DataEngine.DATA_SET_CACHE_ROW_LIMIT,new Integer(0));
  this.testUseCache1();
}

Fixed version (ground truth):
/** 
 * @throws BirtException
 */
public void testUseAppContextCacheRowLimit1() throws BirtException, Exception {
  this.dataSet.setCacheRowCount(100);
  DataEngineContext dec=DataEngineContext.newInstance(DataEngineContext.DIRECT_PRESENTATION,null,null,null);
  dec.setCacheOption(DataEngineContext.CACHE_USE_ALWAYS,100);
  DataEngineImpl myDataEngine=(DataEngineImpl)DataEngine.newDataEngine(dec);
  myDataEngine.defineDataSource(this.dataSource);
  myDataEngine.defineDataSet(this.dataSet);
  this.appContextMap.put(DataEngine.DATA_SET_CACHE_ROW_LIMIT,new Integer(0));
  this.testUseCache1();
}
Program: 76492
Project: 76492
Buggy source:
/** 
 * @param dataSourceDesign2
 * @param dataSetDesign2
 */
void clearCache(DataSourceAndDataSet dsAndDs){
  Object cacheDir=null;
synchronized (cacheMap) {
    cacheDir=cacheMap.remove(dsAndDs);
  }
  if (cacheDir != null) {
    folderUtil.deleteDir((String)cacheDir);
  }
}

Fixed version (ground truth):
/** 
 * @param dataSourceDesign2
 * @param dataSetDesign2
 */
void clearCache(DataSourceAndDataSet dsAndDs){
  List cacheDir=new ArrayList();
synchronized (cacheMap) {
    while (getKey(dsAndDs) != null) {
      cacheDir.add(cacheMap.remove(getKey(dsAndDs)));
    }
  }
  for (int i=0; i < cacheDir.size(); i++) {
    folderUtil.deleteDir(cacheDir.get(i).toString());
  }
}
Program: 76493
Project: 76493
Buggy source:
public boolean equals(Object obj){
  if (obj == null || obj instanceof DataSourceAndDataSet == false)   return false;
  if (this == obj)   return true;
  IBaseDataSourceDesign dataSourceDesign2=((DataSourceAndDataSet)obj).dataSourceDesign;
  IBaseDataSetDesign dataSetDesign2=((DataSourceAndDataSet)obj).dataSetDesign;
  Collection paramterHints2=((DataSourceAndDataSet)obj).paramterHints;
  if (this.dataSourceDesign == dataSourceDesign2) {
    if (this.dataSetDesign == dataSetDesign2) {
      if (isEqualParamterHints(this.paramterHints,paramterHints2))       return true;
    }
 else     if (this.dataSetDesign == null || dataSetDesign2 == null) {
      return false;
    }
  }
 else   if (this.dataSourceDesign == null || dataSourceDesign2 == null) {
    return false;
  }
 else {
    if ((this.dataSetDesign != dataSetDesign2) && (this.dataSetDesign == null || dataSetDesign2 == null))     return false;
  }
  if (isEqualDataSourceDesign(dataSourceDesign,dataSourceDesign2) == false)   return false;
  if (isEqualDataSetDesign(dataSetDesign,dataSetDesign2) == false)   return false;
  if (this.isEqualParamterHints(this.paramterHints,paramterHints2) == false)   return false;
  return true;
}

Fixed version (ground truth):
public boolean equals(Object obj){
  if (obj == null || obj instanceof DataSourceAndDataSet == false)   return false;
  if (this == obj)   return true;
  return this.isDataSourceDataSetEqual((DataSourceAndDataSet)obj,true);
}
Program: 76494
Project: 76494
Buggy source:
public void setUp() throws Exception {
  super.setUp();
  Context context=Context.enter();
  scope=context.initStandardObjects();
  Context.exit();
  expectedValue=new ArrayList();
  appContextMap.put(DataEngine.DATASET_CACHE_OPTION,"String_Node_Str");
  DataEngine myDataEngine=newDataEngine();
  myDataEngine.clearCache(this.dataSource,this.dataSet);
}

Fixed version (ground truth):
public void setUp() throws Exception {
  super.setUp();
  Context context=Context.enter();
  scope=context.initStandardObjects();
  Context.exit();
  expectedValue=new ArrayList();
  appContextMap.put(DataEngine.DATASET_CACHE_OPTION,"String_Node_Str");
  this.appContextMap.put(DataEngine.DATA_SET_CACHE_ROW_LIMIT,null);
  DataEngine myDataEngine=newDataEngine();
  myDataEngine.clearCache(this.dataSource,this.dataSet);
}
Program: 76495
Project: 76495
Buggy source:
/** 
 * Test feature of whether cache will be used
 * @throws BirtException
 */
public void testUseCache1() throws BirtException, Exception {
  this.dataSet.setCacheRowCount(100);
  DataEngineImpl myDataEngine=newDataEngine();
  assertFalse(getDataSetCacheManager(myDataEngine).doesLoadFromCache());
  assertFalse(getDataSetCacheManager(myDataEngine).doesSaveToCache());
  QueryDefinition qd=this.newReportQuery();
  rowBeArray=getRowExpr();
  totalBeArray=getAggrExpr();
  bindingNameRow=getRowExprName();
  bindingExprRow=getAggrExprName();
  prepareExprNameAndQuery(rowBeArray,bindingNameRow,totalBeArray,bindingExprRow,qd);
  IQueryResults qr=myDataEngine.prepare(qd,appContextMap).execute(null);
  qr.getResultIterator().next();
  qr.close();
  String[] bindingNameGroup=new String[1];
  bindingNameGroup[0]="String_Node_Str";
  IBaseExpression[] bindingExprGroup=new IBaseExpression[1];
  bindingExprGroup[0]=new ScriptExpression("String_Node_Str");
  GroupDefinition[] groupDefn=new GroupDefinition[]{new GroupDefinition("String_Node_Str")};
  groupDefn[0].setKeyExpression("String_Node_Str");
  groupDefn[0].setInterval(IGroupDefinition.STRING_PREFIX_INTERVAL);
  qd.addResultSetExpression(bindingNameGroup[0],bindingExprGroup[0]);
  qd.addGroup(groupDefn[0]);
  String[] columnStr=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  String outputStr=getOutputStrForGroupTest(30,qd,0,bindingNameRow,columnStr);
  testPrint(outputStr);
  this.checkOutputFile();
  getDataSetCacheManager(myDataEngine).resetForTest();
}

Fixed version (ground truth):
/** 
 * Test feature of whether cache will be used
 * @throws BirtException
 */
public void testUseCache1() throws BirtException, Exception {
  this.dataSet.setCacheRowCount(100);
  DataEngineImpl myDataEngine=newDataEngine();
  assertFalse(getDataSetCacheManager(myDataEngine).doesLoadFromCache());
  assertFalse(getDataSetCacheManager(myDataEngine).doesSaveToCache());
  executeQuery(myDataEngine);
}
Program: 76496
Project: 76496
Buggy source:
/** 
 * This method will return NULL if the named data set is not cached. Otherwise, it will return a IResultMetaData instance which provides at least the ColumnName and ColumnType information for all cached columns. Please that the ParameterHint information
 * @param dataSource
 * @param dataSet
 * @param parameterHints
 * @return
 * @throws BirtException
 */
abstract public IResultMetaData getCachedDataSetMetaData(IBaseDataSourceDesign dataSource,IBaseDataSetDesign dataSet) throws BirtException ;

Fixed version (ground truth):
/** 
 * This method will return NULL if the named data set is not cached. Otherwise, it will return a IResultMetaData instance which provides at least the ColumnName and ColumnType information for all cached columns. Please note that the ParameterHint information will usually essential to the result of data set design is omitted for it has nothing to do with the metadata.
 * @param dataSource
 * @param dataSet
 * @param parameterHints
 * @return
 * @throws BirtException
 */
abstract public IResultMetaData getCachedDataSetMetaData(IBaseDataSourceDesign dataSource,IBaseDataSetDesign dataSet) throws BirtException ;
Program: 76499
Project: 76499
Buggy source:
private void loadFromDisk() throws IOException, DataException {
  documentObj=documentManager.openDocumentObject(NamingUtil.getDimensionDocName(name));
  if (documentObj == null) {
    throw new DataException(ResourceConstants.DIMENSION_NOT_EXIST,name);
  }
  isTime=documentObj.readBoolean();
  hierarchy=new Hierarchy(documentManager,name);
  hierarchy.loadFromDisk();
  length=hierarchy.size();
  documentObj.close();
  documentObj=null;
}

Fixed version (ground truth):
private void loadFromDisk() throws IOException, DataException {
  documentObj=documentManager.openDocumentObject(NamingUtil.getDimensionDocName(name));
  if (documentObj == null) {
    throw new DataException(ResourceConstants.DIMENSION_NOT_EXIST,name);
  }
  isTime=documentObj.readBoolean();
  String hierarchyName=documentObj.readString();
  hierarchy=new Hierarchy(documentManager,hierarchyName);
  hierarchy.loadFromDisk();
  length=hierarchy.size();
  documentObj.close();
  documentObj=null;
}
Program: 76500
Project: 76500
Buggy source:
/** 
 * Constructor
 * @param sourceHandle
 * @param newContainer
 * @param afterHandle
 */
public CrosstabPasterCommand(DesignElementHandle sourceHandle,DesignElementHandle newContainer,DesignElementHandle afterHandle){
  this.sourceHandle=sourceHandle;
  this.newContainer=newContainer;
  this.afterHandle=afterHandle;
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param sourceHandle
 * @param newContainer
 * @param afterHandle
 */
public CrosstabPasterCommand(DesignElementHandle sourceHandle,DesignElementHandle newContainer,DesignElementHandle afterHandle){
  this.sourceHandle=sourceHandle;
  this.cloneElement=sourceHandle.copy();
  this.newContainer=newContainer;
  this.afterHandle=afterHandle;
}
Program: 76501
Project: 76501
Buggy source:
/** 
 * Executes the Command.
 */
public void execute(){
  try {
    calculatePositionAndSlotId();
    ModuleHandle currentDesignHandle=SessionHandleAdapter.getInstance().getReportDesignHandle();
    DesignElementHandle newHandle=copyNewHandle(sourceHandle.copy(),currentDesignHandle);
    addHandleToReport(newHandle);
  }
 catch (  Exception e) {
    if (DesignerConstants.TRACING_COMMANDS) {
      System.out.println("String_Node_Str");
    }
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Executes the Command.
 */
public void execute(){
  try {
    calculatePositionAndSlotId();
    ModuleHandle currentDesignHandle=SessionHandleAdapter.getInstance().getReportDesignHandle();
    DesignElementHandle newHandle=copyNewHandle(cloneElement,currentDesignHandle);
    addHandleToReport(newHandle);
  }
 catch (  Exception e) {
    if (DesignerConstants.TRACING_COMMANDS) {
      System.out.println("String_Node_Str");
    }
    e.printStackTrace();
  }
}
Program: 76502
Project: 76502
Buggy source:
AbstractRunTask(IReportEngine engine,IReportRunnable runnable){
  super(engine,runnable);
}

Fixed version (ground truth):
AbstractRunTask(IReportEngine engine,IReportRunnable runnable,int taskType){
  super(engine,runnable,taskType);
}
Program: 76503
Project: 76503
Buggy source:
public DataExtractionTask(IReportEngine engine,IReportRunnable runnable,IReportDocument reader) throws EngineException {
  super(engine,runnable);
  this.report=((ReportRunnable)runnable).getReportIR();
  this.reportDocReader=reader;
  executionContext.setReportDocument(reportDocReader);
  executionContext.setFactoryMode(false);
  executionContext.setPresentationMode(true);
}

Fixed version (ground truth):
public DataExtractionTask(IReportEngine engine,IReportRunnable runnable,IReportDocument reader) throws EngineException {
  super(engine,runnable,IEngineTask.TASK_DATAEXTRACTION);
  this.report=((ReportRunnable)runnable).getReportIR();
  this.reportDocReader=reader;
  executionContext.setReportDocument(reportDocReader);
  executionContext.setFactoryMode(false);
  executionContext.setPresentationMode(true);
}
Program: 76504
Project: 76504
Buggy source:
/** 
 * @param engine reference to report engine
 * @param appContext a user-defined object that capsulates the context for running a task. The context object is passed to callback functions (i.e., functions in image handlers, action handlers, etc. ) that are written by those who embeds engine in their applications
 */
protected EngineTask(IReportEngine engine,IReportRunnable runnable){
  taskID=id++;
  this.engine=engine;
  executionContext=new ExecutionContext(this);
  executionContext.setReportContext(new ReportContextImpl(executionContext));
  setReportRunnable(runnable);
  executionContext.setAppContext(engine.getConfig().getAppContext());
  cancelFlag=false;
  runningStatus=RUNNING_STATUS_START;
}

Fixed version (ground truth):
protected EngineTask(IReportEngine engine,IReportRunnable runnable,int taskType){
  this(engine,runnable);
  this.taskType=taskType;
}
Program: 76505
Project: 76505
Buggy source:
/** 
 * @param engine reference to the report engine
 * @param runnable the runnable report design
 */
public GetParameterDefinitionTask(IReportEngine engine,IReportRunnable runnable){
  super(engine,runnable);
}

Fixed version (ground truth):
/** 
 * @param engine reference to the report engine
 * @param runnable the runnable report design
 */
public GetParameterDefinitionTask(IReportEngine engine,IReportRunnable runnable){
  super(engine,runnable,IEngineTask.TASK_GETPARAMETERDEFINITION);
}
Program: 76506
Project: 76506
Buggy source:
/** 
 * @param engine the report engine
 * @param runnable the report runnable object
 * @param reportDoc the report document instance
 */
public RenderTask(IReportEngine engine,IReportRunnable runnable,IReportDocument reportDoc){
  super(engine,runnable);
  executionContext.setFactoryMode(false);
  executionContext.setPresentationMode(true);
  openReportDocument(reportDoc);
  loadDesign();
  innerRender=new PageRangeRender(new long[]{1,this.reportDoc.getPageCount()});
}

Fixed version (ground truth):
/** 
 * @param engine the report engine
 * @param runnable the report runnable object
 * @param reportDoc the report document instance
 */
public RenderTask(IReportEngine engine,IReportRunnable runnable,IReportDocument reportDoc){
  super(engine,runnable,IEngineTask.TASK_RENDER);
  executionContext.setFactoryMode(false);
  executionContext.setPresentationMode(true);
  openReportDocument(reportDoc);
  loadDesign();
  innerRender=new PageRangeRender(new long[]{1,this.reportDoc.getPageCount()});
}
Program: 76507
Project: 76507
Buggy source:
/** 
 * @param engine reference to the report engine
 * @param runnable the runnable report design reference
 */
public RunAndRenderTask(IReportEngine engine,IReportRunnable runnable){
  super(engine,runnable);
}

Fixed version (ground truth):
/** 
 * @param engine reference to the report engine
 * @param runnable the runnable report design reference
 */
public RunAndRenderTask(IReportEngine engine,IReportRunnable runnable){
  super(engine,runnable,IEngineTask.TASK_RUNANDRENDER);
}
Program: 76508
Project: 76508
Buggy source:
/** 
 * @param engine the report engine
 * @param runnable the report runnable instance
 */
public RunTask(IReportEngine engine,IReportRunnable runnable){
  super(engine,runnable);
  executionContext.setFactoryMode(true);
  executionContext.setPresentationMode(false);
}

Fixed version (ground truth):
/** 
 * @param engine the report engine
 * @param runnable the report runnable instance
 */
public RunTask(IReportEngine engine,IReportRunnable runnable){
  super(engine,runnable,IEngineTask.TASK_RUN);
  executionContext.setFactoryMode(true);
  executionContext.setPresentationMode(false);
}
Program: 76509
Project: 76509
Buggy source:
/** 
 * is in factory mode
 * @return true, factory mode, false not in factory mode
 */
public boolean isInFactory(){
  return true;
}

Fixed version (ground truth):
/** 
 * is in factory mode
 * @return true, factory mode, false not in factory mode
 */
public boolean isInFactory(){
  return factoryMode;
}
Program: 76512
Project: 76512
Buggy source:
/** 
 * Sets the cache option. This function only available for MODE_DIRECT_PRESENTATION mode. In other cases, exception will be thrown.
 */
public void setCacheOption(int option,int cacheCount) throws BirtException {
  if (!(option == CACHE_USE_DEFAULT || option == CACHE_USE_DISABLE || option == CACHE_USE_ALWAYS))   throw new AdapterException(ResourceConstants.INVALID_CAHCE_OPTION,new Integer(option));
  this.cacheOption=option;
  this.cacheCount=cacheCount;
}

Fixed version (ground truth):
/** 
 * Sets the cache option. This function only available for MODE_DIRECT_PRESENTATION mode. In other cases, exception will be thrown.
 */
public void setCacheOption(int option,int cacheCount) throws BirtException {
  if (!(option == CACHE_USE_DEFAULT || option == CACHE_USE_DISABLE || option == CACHE_USE_ALWAYS))   throw new AdapterException(ResourceConstants.INVALID_CAHCE_OPTION,new Integer(option));
  this.cacheSet=true;
  this.cacheOption=option;
  this.cacheCount=cacheCount;
}
Program: 76513
Project: 76513
Buggy source:
/** 
 * Gets a DataEngineContext for use to initialize data engine
 */
public DataEngineContext getDataEngineContext() throws BirtException {
  DataEngineContext context=DataEngineContext.newInstance(mode,getTopScope(),docReader,docWriter);
  context.setCacheOption(cacheOption,cacheCount);
  return context;
}

Fixed version (ground truth):
/** 
 * Gets a DataEngineContext for use to initialize data engine
 */
public DataEngineContext getDataEngineContext() throws BirtException {
  DataEngineContext context=DataEngineContext.newInstance(mode,getTopScope(),docReader,docWriter);
  if (cacheSet)   context.setCacheOption(cacheOption,cacheCount);
  return context;
}
Program: 76514
Project: 76514
Buggy source:
public void execute(){
  transStart(NAME);
  CrosstabReportItemHandle reportHandle=(CrosstabReportItemHandle)handleAdpter.getCrosstabItemHandle();
  try {
    int position=reportHandle.getDimensionCount(getType());
    DimensionViewHandle viewHandle=reportHandle.insertDimension(getDimensionHandle(),getType(),position);
    HierarchyHandle hierarchyHandle=getDimensionHandle().getDefaultHierarchy();
    int count=hierarchyHandle.getLevelCount();
    if (count == 0) {
      rollBack();
      return;
    }
    LevelHandle levelHandle=hierarchyHandle.getLevel(0);
    ComputedColumn bindingColumn=CrosstabAdaptUtil.createComputedColumn((ExtendedItemHandle)reportHandle.getModelHandle(),levelHandle);
    ((ExtendedItemHandle)reportHandle.getModelHandle()).addColumnBinding(bindingColumn,false);
    LevelViewHandle levelViewHandle=viewHandle.insertLevel(levelHandle,0);
    CrosstabCellHandle cellHandle=levelViewHandle.getCell();
    DataItemHandle dataHandle=DesignElementFactory.getInstance().newDataItem(levelHandle.getName());
    dataHandle.setResultSetColumn(bindingColumn.getName());
    cellHandle.addContent(dataHandle);
  }
 catch (  SemanticException e) {
    rollBack();
    e.printStackTrace();
  }
  transEnd();
}

Fixed version (ground truth):
public void execute(){
  transStart(NAME);
  CrosstabReportItemHandle reportHandle=(CrosstabReportItemHandle)handleAdpter.getCrosstabItemHandle();
  try {
    int position=reportHandle.getDimensionCount(getType());
    DimensionViewHandle viewHandle=reportHandle.insertDimension(getDimensionHandle(),getType(),position);
    HierarchyHandle hierarchyHandle=getDimensionHandle().getDefaultHierarchy();
    int count=hierarchyHandle.getLevelCount();
    if (count == 0) {
      rollBack();
      return;
    }
    LevelHandle levelHandle=hierarchyHandle.getLevel(0);
    ComputedColumn bindingColumn=CrosstabAdaptUtil.createComputedColumn((ExtendedItemHandle)reportHandle.getModelHandle(),levelHandle);
    ((ExtendedItemHandle)reportHandle.getModelHandle()).addColumnBinding(bindingColumn,false);
    LevelViewHandle levelViewHandle=CrosstabUtil.insertLevel(viewHandle,levelHandle,0);
    CrosstabCellHandle cellHandle=levelViewHandle.getCell();
    DataItemHandle dataHandle=DesignElementFactory.getInstance().newDataItem(levelHandle.getName());
    dataHandle.setResultSetColumn(bindingColumn.getName());
    cellHandle.addContent(dataHandle);
  }
 catch (  SemanticException e) {
    rollBack();
    e.printStackTrace();
  }
  transEnd();
}
Program: 76515
Project: 76515
Buggy source:
public void execute(){
  transStart(NAME);
  CrosstabReportItemHandle reportHandle=(CrosstabReportItemHandle)handleAdpter.getCrosstabItemHandle();
  try {
    DimensionViewHandle viewHandle=reportHandle.insertDimension(getDimensionHandle(),getType(),0);
    HierarchyHandle hierarchyHandle=getDimensionHandle().getDefaultHierarchy();
    int count=hierarchyHandle.getLevelCount();
    if (count == 0) {
      rollBack();
      return;
    }
    LevelHandle levelHandle=hierarchyHandle.getLevel(0);
    ComputedColumn bindingColumn=CrosstabAdaptUtil.createComputedColumn((ExtendedItemHandle)reportHandle.getModelHandle(),levelHandle);
    ((ExtendedItemHandle)reportHandle.getModelHandle()).addColumnBinding(bindingColumn,false);
    LevelViewHandle levelViewHandle=viewHandle.insertLevel(levelHandle,0);
    CrosstabCellHandle cellHandle=levelViewHandle.getCell();
    DataItemHandle dataHandle=DesignElementFactory.getInstance().newDataItem(levelHandle.getName());
    dataHandle.setResultSetColumn(bindingColumn.getName());
    cellHandle.addContent(dataHandle);
  }
 catch (  SemanticException e) {
    rollBack();
    e.printStackTrace();
  }
  transEnd();
}

Fixed version (ground truth):
public void execute(){
  transStart(NAME);
  CrosstabReportItemHandle reportHandle=(CrosstabReportItemHandle)handleAdpter.getCrosstabItemHandle();
  try {
    DimensionViewHandle viewHandle=reportHandle.insertDimension(getDimensionHandle(),getType(),0);
    HierarchyHandle hierarchyHandle=getDimensionHandle().getDefaultHierarchy();
    int count=hierarchyHandle.getLevelCount();
    if (count == 0) {
      rollBack();
      return;
    }
    LevelHandle levelHandle=hierarchyHandle.getLevel(0);
    ComputedColumn bindingColumn=CrosstabAdaptUtil.createComputedColumn((ExtendedItemHandle)reportHandle.getModelHandle(),levelHandle);
    ((ExtendedItemHandle)reportHandle.getModelHandle()).addColumnBinding(bindingColumn,false);
    LevelViewHandle levelViewHandle=CrosstabUtil.insertLevel(viewHandle,levelHandle,0);
    CrosstabCellHandle cellHandle=levelViewHandle.getCell();
    DataItemHandle dataHandle=DesignElementFactory.getInstance().newDataItem(levelHandle.getName());
    dataHandle.setResultSetColumn(bindingColumn.getName());
    cellHandle.addContent(dataHandle);
  }
 catch (  SemanticException e) {
    rollBack();
    e.printStackTrace();
  }
  transEnd();
}