nus-yam/ex-repair huggingface dataset:
Program: 66859
Project: 66859
Buggy source:
/** 
 * @return
 * @throws SemanticException
 */
private boolean modifyJointCondition() throws SemanticException {
  JointDataSetHandle handle=null;
  if (leftDataSetName == null || rightDataSetName == null)   return false;
  if (propertyPageContainer instanceof DataSetEditor) {
    handle=(JointDataSetHandle)((DataSetEditor)propertyPageContainer).getModel();
    List datasetName=handle.getDataSetNames();
    for (int i=0; i < datasetName.size(); i++) {
      try {
        handle.removeDataSet((String)datasetName.get(i));
      }
 catch (      SemanticException e) {
      }
    }
    if (leftDataSetName.equals(rightDataSetName))     handle.addDataSet(leftDataSetName);
 else {
      handle.addDataSet(leftDataSetName);
      handle.addDataSet(rightDataSetName);
    }
    setParameters(handle);
  }
  addColumnHints(handle);
  if (propertyHandle != null) {
    JoinCondition condition=createJoinCondition();
    propertyHandle.removeItem(0);
    propertyHandle.addItem(condition);
    return true;
  }
 else   return false;
}

Fixed version (ground truth):
/** 
 * @return
 * @throws SemanticException
 */
private boolean modifyJointCondition() throws SemanticException {
  JointDataSetHandle handle=null;
  if (leftDataSetName == null || rightDataSetName == null)   return false;
  if (propertyPageContainer instanceof DataSetEditor) {
    boolean selectionChanged=true;
    handle=(JointDataSetHandle)((DataSetEditor)propertyPageContainer).getModel();
    Iterator iter=handle.getPropertyHandle(JointDataSet.JOIN_CONDITONS_PROP).iterator();
    while (iter.hasNext()) {
      JoinConditionHandle condition=(JoinConditionHandle)iter.next();
      if ((condition.getLeftDataSet() != null && condition.getLeftDataSet().equals(this.leftDataSetName)) && (condition.getLeftDataSet() != null && condition.getRightDataSet().equals(this.rightDataSetName))) {
        selectionChanged=false;
      }
    }
    if (selectionChanged) {
      List datasetName=handle.getDataSetNames();
      for (int i=0; i < datasetName.size(); i++) {
        try {
          handle.removeDataSet((String)datasetName.get(i));
        }
 catch (        SemanticException e) {
        }
      }
      if (leftDataSetName.equals(rightDataSetName))       handle.addDataSet(leftDataSetName);
 else {
        handle.addDataSet(leftDataSetName);
        handle.addDataSet(rightDataSetName);
      }
      setParameters(handle);
      addColumnHints(handle);
      if (propertyHandle != null) {
        JoinCondition condition=createJoinCondition();
        propertyHandle.removeItem(0);
        propertyHandle.addItem(condition);
        return true;
      }
 else       return false;
    }
  }
  return true;
}
Program: 66860
Project: 66860
Buggy source:
public boolean needOutputInMasterPage(IContent headerFooter){
  if (headerFooter != null) {
    Collection list=headerFooter.getChildren();
    Iterator iter=list.iterator();
    while (iter.hasNext()) {
      Object child=iter.next();
      if (child instanceof ITableContent) {
        int columncount=((ITableContent)child).getColumnCount();
        int rowcount=((ITableContent)child).getChildren().size();
        if (columncount > 3 || rowcount > 1) {
          logger.log(Level.WARNING,"String_Node_Str");
          return false;
        }
        if (isEmbededTable((ITableContent)child)) {
          logger.log(Level.WARNING,"String_Node_Str");
          return false;
        }
      }
      if (isHtmlText(child)) {
        logger.log(Level.WARNING,"String_Node_Str");
        return false;
      }
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean needOutputInMasterPage(IContent headerFooter){
  if (headerFooter != null) {
    Collection list=headerFooter.getChildren();
    Iterator iter=list.iterator();
    while (iter.hasNext()) {
      Object child=iter.next();
      if (child instanceof ITableContent) {
        int columncount=((ITableContent)child).getColumnCount();
        int rowcount=((ITableContent)child).getChildren().size();
        if (columncount > 3 || rowcount > 1) {
          logger.log(Level.WARNING,"String_Node_Str");
          return false;
        }
        if (isEmbededTable((ITableContent)child)) {
          logger.log(Level.WARNING,"String_Node_Str");
          return false;
        }
      }
      if (isHtmlText(child)) {
        logger.log(Level.WARNING,"String_Node_Str");
        return false;
      }
      if (child instanceof IImageContent) {
        logger.log(Level.WARNING,"String_Node_Str");
        return false;
      }
    }
  }
  return true;
}
Program: 66861
Project: 66861
Buggy source:
/** 
 * Draws a container's border, and its background color/image if there is any.
 * @param container the containerArea whose border and background need to be drew
 */
protected void drawContainer(IContainerArea container){
  BoxStyle style=container.getBoxStyle();
  if (null == style || style == BoxStyle.DEFAULT) {
    return;
  }
  Color bc=style.getBackgroundColor();
  BackgroundImageInfo bi=style.getBackgroundImage();
  if (bc != null || bi != null || container.getHelpText() != null) {
    int startX=currentX + getX(container);
    int startY=currentY + getY(container);
    int width=getWidth(container);
    int height=getHeight(container);
    if (bc != null) {
      pageGraphic.drawBackgroundColor(bc,startX,startY,width,height);
    }
    if (bi != null) {
      drawBackgroundImage(bi,startX,startY,width,height);
    }
    if (container.getHelpText() != null) {
      pageGraphic.showHelpText(container.getHelpText(),startX,startY,width,height);
    }
  }
}

Fixed version (ground truth):
/** 
 * Draws a container's border, and its background color/image if there is any.
 * @param container the containerArea whose border and background need to be drew
 */
protected void drawContainer(IContainerArea container){
  BoxStyle style=container.getBoxStyle();
  if ((null == style || style == BoxStyle.DEFAULT) && container.getHelpText() == null) {
    return;
  }
  Color bc=style.getBackgroundColor();
  BackgroundImageInfo bi=style.getBackgroundImage();
  int startX=currentX + getX(container);
  int startY=currentY + getY(container);
  int width=getWidth(container);
  int height=getHeight(container);
  if (bc != null) {
    pageGraphic.drawBackgroundColor(bc,startX,startY,width,height);
  }
  if (bi != null) {
    drawBackgroundImage(bi,startX,startY,width,height);
  }
  if (container.getHelpText() != null) {
    pageGraphic.showHelpText(container.getHelpText(),startX,startY,width,height);
  }
}
Program: 66862
Project: 66862
Buggy source:
/** 
 * @param paramBindingIt
 * @return
 */
private List convertParamterBindings(Iterator paramBindingIt){
  if (paramBindingIt == null)   return null;
  List parameterBindings=new ArrayList();
  while (paramBindingIt.hasNext()) {
    Object paramObj=paramBindingIt.next();
    if (paramObj instanceof ParamBindingHandle) {
      ParamBindingHandle paramBinding=(ParamBindingHandle)paramObj;
      if (paramBinding.getExpression() != null) {
        ScriptExpression paramValueExpr=new ScriptExpression(paramBinding.getExpression());
        InputParameterBinding inputParamBinding=new InputParameterBinding(paramBinding.getParamName(),paramValueExpr);
        parameterBindings.add(inputParamBinding);
      }
    }
 else     if (paramObj instanceof OdaDataSetParameterHandle) {
      OdaDataSetParameterHandle paramBinding=(OdaDataSetParameterHandle)paramObj;
      ExpressionHandle handle=paramBinding.getExpressionProperty(DataSetParameter.DEFAULT_VALUE_MEMBER);
      InputParameterBinding inputParamBinding=new InputParameterBinding(paramBinding.getName(),this.session.getModelAdaptor().adaptExpression((Expression)handle.getValue()));
      parameterBindings.add(inputParamBinding);
    }
  }
  return parameterBindings;
}

Fixed version (ground truth):
/** 
 * @param paramBindingIt
 * @return
 */
private List convertParamterBindings(Iterator paramBindingIt){
  if (paramBindingIt == null)   return null;
  List parameterBindings=new ArrayList();
  while (paramBindingIt.hasNext()) {
    Object paramObj=paramBindingIt.next();
    if (paramObj instanceof ParamBindingHandle) {
      ParamBindingHandle paramBinding=(ParamBindingHandle)paramObj;
      if (paramBinding.getExpression() != null) {
        ScriptExpression paramValueExpr=new ScriptExpression(paramBinding.getExpression());
        InputParameterBinding inputParamBinding=new InputParameterBinding(paramBinding.getParamName(),paramValueExpr);
        parameterBindings.add(inputParamBinding);
      }
    }
 else     if (paramObj instanceof OdaDataSetParameterHandle) {
      if (((OdaDataSetParameterHandle)paramObj).getParamName() != null) {
        String defaultValueExpr=ExpressionUtil.createJSParameterExpression((((OdaDataSetParameterHandle)paramObj).getParamName()));
        InputParameterBinding inputParamBinding=new InputParameterBinding((String)((OdaDataSetParameterHandle)paramObj).getName(),modelAdaptor.adaptExpression(defaultValueExpr,((OdaDataSetParameterHandle)paramObj).getDataType()));
        parameterBindings.add(inputParamBinding);
      }
 else {
        OdaDataSetParameterHandle paramBinding=(OdaDataSetParameterHandle)paramObj;
        ExpressionHandle handle=paramBinding.getExpressionProperty(DataSetParameter.DEFAULT_VALUE_MEMBER);
        InputParameterBinding inputParamBinding=new InputParameterBinding(paramBinding.getName(),this.session.getModelAdaptor().adaptExpression((Expression)handle.getValue()));
        parameterBindings.add(inputParamBinding);
      }
    }
  }
  return parameterBindings;
}
Program: 66869
Project: 66869
Buggy source:
public void tearDown(){
  ArchiveUtil.DeleteAllFiles(new File(TEMP_FOLDER_NAME));
  ArchiveUtil.DeleteAllFiles(new File(ARCHIVE_NAME));
}

Fixed version (ground truth):
public void tearDown(){
  ArchiveUtil.deleteAllFiles(new File(TEMP_FOLDER_NAME));
  ArchiveUtil.deleteAllFiles(new File(ARCHIVE_NAME));
}
Program: 66870
Project: 66870
Buggy source:
public void setUp(){
  ArchiveUtil.DeleteAllFiles(new File(ARCHIVE_NAME));
  ArchiveUtil.DeleteAllFiles(new File(TEMP_FOLDER_NAME));
}

Fixed version (ground truth):
public void setUp(){
  ArchiveUtil.deleteAllFiles(new File(ARCHIVE_NAME));
  ArchiveUtil.deleteAllFiles(new File(TEMP_FOLDER_NAME));
}
Program: 66871
Project: 66871
Buggy source:
public void tearDown(){
  ArchiveUtil.DeleteAllFiles(new File(ARCHIVE_NAME));
}

Fixed version (ground truth):
public void tearDown(){
  ArchiveUtil.deleteAllFiles(new File(ARCHIVE_NAME));
}
Program: 66872
Project: 66872
Buggy source:
/** 
 * open an none exits folder. it should be failed and no folder is created.
 */
public void testOpenNoneExistFolder(){
  try {
    ArchiveUtil.DeleteAllFiles(new File(ARCHIVE_NAME));
    FolderArchiveReader reader=new FolderArchiveReader(ARCHIVE_NAME);
    reader.open();
    reader.close();
  }
 catch (  IOException ex) {
    assertTrue(!new File(ARCHIVE_NAME).exists());
    assertTrue(true);
    return;
  }
  assertTrue(false);
}

Fixed version (ground truth):
/** 
 * open an none exits folder. it should be failed and no folder is created.
 */
public void testOpenNoneExistFolder(){
  try {
    ArchiveUtil.deleteAllFiles(new File(ARCHIVE_NAME));
    FolderArchiveReader reader=new FolderArchiveReader(ARCHIVE_NAME);
    reader.open();
    reader.close();
  }
 catch (  IOException ex) {
    assertTrue(!new File(ARCHIVE_NAME).exists());
    assertTrue(true);
    return;
  }
  assertTrue(false);
}
Program: 66873
Project: 66873
Buggy source:
public void setUp(){
  ArchiveUtil.DeleteAllFiles(new File(ARCHIVE_NAME));
}

Fixed version (ground truth):
public void setUp(){
  ArchiveUtil.deleteAllFiles(new File(ARCHIVE_NAME));
}
Program: 66874
Project: 66874
Buggy source:
public void setUp(){
  ArchiveUtil.DeleteAllFiles(new File(ARCHIVE_NAME));
}

Fixed version (ground truth):
public void setUp(){
  ArchiveUtil.deleteAllFiles(new File(ARCHIVE_NAME));
}
Program: 66875
Project: 66875
Buggy source:
public void tearDown(){
  ArchiveUtil.DeleteAllFiles(new File(ARCHIVE_NAME));
}

Fixed version (ground truth):
public void tearDown(){
  ArchiveUtil.deleteAllFiles(new File(ARCHIVE_NAME));
}
Program: 66877
Project: 66877
Buggy source:
public Object getDefaultValue(String name){
  ModuleHandle report=executionContext.getDesign();
  AbstractScalarParameterHandle parameter=(AbstractScalarParameterHandle)report.findParameter(name);
  if (parameter == null) {
    return null;
  }
  usingParameterValues();
  return evaluateDefaultValue(parameter);
}

Fixed version (ground truth):
public Object getDefaultValue(String name){
  ModuleHandle report=executionContext.getDesign();
  AbstractScalarParameterHandle parameter=(AbstractScalarParameterHandle)report.findParameter(name);
  if (parameter == null) {
    return null;
  }
  loadDesign();
  usingParameterValues();
  return evaluateDefaultValue(parameter);
}
Program: 66878
Project: 66878
Buggy source:
public Collection getSelectionTreeForCascadingGroup(String parameterGroupName){
  try {
    switchToOsgiClassLoader();
    return doGetSelectionTreeForCascadingGroup(parameterGroupName);
  }
  finally {
    switchClassLoaderBack();
  }
}

Fixed version (ground truth):
public Collection getSelectionTreeForCascadingGroup(String parameterGroupName){
  try {
    switchToOsgiClassLoader();
    loadDesign();
    return doGetSelectionTreeForCascadingGroup(parameterGroupName);
  }
  finally {
    switchClassLoaderBack();
  }
}
Program: 66879
Project: 66879
Buggy source:
public Collection getSelectionList(String name){
  try {
    switchToOsgiClassLoader();
    return doGetSelectionList(name);
  }
  finally {
    switchClassLoaderBack();
  }
}

Fixed version (ground truth):
public Collection getSelectionList(String name){
  try {
    switchToOsgiClassLoader();
    loadDesign();
    return doGetSelectionList(name);
  }
  finally {
    switchClassLoaderBack();
  }
}
Program: 66880
Project: 66880
Buggy source:
public HashMap getDefaultValues(){
  usingParameterValues();
  final HashMap values=new HashMap();
  new ParameterVisitor(){
    boolean visitScalarParameter(    ScalarParameterHandle param,    Object userData){
      String name=param.getName();
      Object value=getDefaultValue(name);
      values.put(name,value);
      return true;
    }
    boolean visitDynamicFilterParameter(    DynamicFilterParameterHandle param,    Object userData){
      return true;
    }
    boolean visitParameterGroup(    ParameterGroupHandle group,    Object userData){
      return visitParametersInGroup(group,userData);
    }
  }
.visit(executionContext.getDesign());
  return values;
}

Fixed version (ground truth):
public HashMap getDefaultValues(){
  loadDesign();
  usingParameterValues();
  final HashMap values=new HashMap();
  new ParameterVisitor(){
    boolean visitScalarParameter(    ScalarParameterHandle param,    Object userData){
      String name=param.getName();
      Object value=getDefaultValue(name);
      values.put(name,value);
      return true;
    }
    boolean visitDynamicFilterParameter(    DynamicFilterParameterHandle param,    Object userData){
      return true;
    }
    boolean visitParameterGroup(    ParameterGroupHandle group,    Object userData){
      return visitParametersInGroup(group,userData);
    }
  }
.visit(executionContext.getDesign());
  return values;
}
Program: 66881
Project: 66881
Buggy source:
/** 
 * Creates the context menu for the given object. Gets the action from the actionRegistry for the given object and adds them to the menu
 * @param menu the menu
 * @param object the object
 */
public void createContextMenu(TreeViewer sourceViewer,Object object,IMenuManager menu){
  menu.add(new InsertAction(object,Messages.getString("String_Node_Str"),ReportDesignConstants.SCALAR_PARAMETER_ELEMENT));
  menu.add(new InsertAction(object,Messages.getString("String_Node_Str"),ReportDesignConstants.CASCADING_PARAMETER_GROUP_ELEMENT));
  menu.add(new InsertAction(object,Messages.getString("String_Node_Str"),ReportDesignConstants.PARAMETER_GROUP_ELEMENT));
  super.createContextMenu(sourceViewer,object,menu);
}

Fixed version (ground truth):
/** 
 * Creates the context menu for the given object. Gets the action from the actionRegistry for the given object and adds them to the menu
 * @param menu the menu
 * @param object the object
 */
public void createContextMenu(TreeViewer sourceViewer,Object object,IMenuManager menu){
  menu.add(new InsertAction(object,Messages.getString("String_Node_Str"),ReportDesignConstants.SCALAR_PARAMETER_ELEMENT));
  menu.add(new InsertAction(object,Messages.getString("String_Node_Str"),ReportDesignConstants.CASCADING_PARAMETER_GROUP_ELEMENT));
  menu.add(new InsertAction(object,Messages.getString("String_Node_Str"),ReportDesignConstants.PARAMETER_GROUP_ELEMENT));
  menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS + "String_Node_Str"));
  super.createContextMenu(sourceViewer,object,menu);
}
Program: 66882
Project: 66882
Buggy source:
/** 
 * @param ri
 * @param scope
 * @param saveUtil
 * @param serviceForResultSet
 * @throws DataException 
 */
BindingColumnsEvalUtil(IResultIterator ri,Scriptable scope,ScriptContext cx,RDSaveHelper saveUtil,List manualBindingExprs,Map autoBindingExprs) throws DataException {
  Object[] params={ri,scope,saveUtil,manualBindingExprs,autoBindingExprs};
  logger.entering(BindingColumnsEvalUtil.class.getName(),"String_Node_Str",params);
  this.odiResult=ri;
  this.scope=scope;
  this.saveHelper=saveUtil;
  this.cx=cx;
  try {
    this.isBasedOnRD=ExprMetaUtil.isBasedOnRD(ri.getResultClass());
    if (this.isBasedOnRD == true)     this.evalHelper=new EvalHelper(ri);
  }
 catch (  DataException e) {
  }
  this.initBindingColumns(manualBindingExprs,autoBindingExprs);
  logger.exiting(BindingColumnsEvalUtil.class.getName(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param ri
 * @param scope
 * @param saveUtil
 * @param serviceForResultSet
 * @throws DataException 
 */
BindingColumnsEvalUtil(IResultIterator ri,Scriptable scope,ScriptContext cx,RDSaveHelper saveUtil,List manualBindingExprs,Map autoBindingExprs) throws DataException {
  Object[] params={ri,scope,saveUtil,manualBindingExprs,autoBindingExprs};
  logger.entering(BindingColumnsEvalUtil.class.getName(),"String_Node_Str",params);
  this.odiResult=ri;
  this.scope=scope;
  this.saveHelper=saveUtil;
  this.cx=cx;
  this.initBindingColumns(manualBindingExprs,autoBindingExprs);
  logger.exiting(BindingColumnsEvalUtil.class.getName(),"String_Node_Str");
}
Program: 66885
Project: 66885
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.getFacttableBasedFilterHelpers().addAll(this.preparedQuery.getInternalFilters());
  IDocumentManager documentManager=getDocumentManager(executor);
  ICube cube=loadCube(documentManager,executor);
  BirtCubeView bcv=new BirtCubeView(executor,cube,appContext,fetcher);
  CubeCursor cubeCursor=bcv.getCubeCursor(stopSign,cube);
  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;
  CubeQueryExecutor executor=new CubeQueryExecutor(this.outResults,cubeQueryDefinition,this.session,this.scope,this.context);
  executor.getFacttableBasedFilterHelpers().addAll(this.preparedQuery.getInternalFilters());
  IDocumentManager documentManager=getDocumentManager(executor);
  ICube cube=null;
  try {
    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);
  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: 66886
Project: 66886
Buggy source:
private void init(Object value,Object size){
  if (NumberUtil.isBigNumber(value)) {
    bIsBigNumber=true;
    divisor=((BigNumber)value).getDivisor();
    bnSize=(BigNumber)size;
  }
 else   if (NumberUtil.isBigDecimal(value)) {
    bIsBigDecimal=true;
    bdSize=(Number)size;
  }
  this.oValue=value;
  if (value instanceof Double && ((Double)value).isNaN()) {
    this.oValue=null;
  }
  this.dSize=(size instanceof Number) ? ((Number)size).doubleValue() : 0;
}

Fixed version (ground truth):
private void init(Object value,Object size){
  if (NumberUtil.isBigNumber(value)) {
    bIsBigNumber=true;
    divisor=((BigNumber)value).getDivisor();
    bnSize=(BigNumber)size;
  }
 else   if (NumberUtil.isBigDecimal(value)) {
    bIsBigDecimal=true;
    if (NumberUtil.isJavaMathBigDecimal(value)) {
      bdSize=NumberUtil.asJavaMathBigDecimal((Number)size);
    }
 else {
      bdSize=NumberUtil.asBigDecimal((Number)size);
    }
  }
  this.oValue=value;
  if (value instanceof Double && ((Double)value).isNaN()) {
    this.oValue=null;
  }
  this.dSize=(size instanceof Number) ? ((Number)size).doubleValue() : 0;
}
Program: 66887
Project: 66887
Buggy source:
protected void init(Number bdPositiveValue,Number bdNegativeValue){
  if (isBigDecimal) {
    bdPosValue=bdPositiveValue;
    bdNegValue=bdNegativeValue;
    dPosValue=bdPosValue.doubleValue();
    dNegValue=bdNegValue.doubleValue();
  }
}

Fixed version (ground truth):
protected void init(Number bdPositiveValue,Number bdNegativeValue){
  if (isBigDecimal) {
    if (NumberUtil.isJavaMathBigDecimal(bdPositiveValue)) {
      bdPosValue=NumberUtil.asJavaMathBigDecimal(bdPositiveValue);
      bdNegValue=NumberUtil.asJavaMathBigDecimal(bdNegativeValue);
    }
 else {
      bdPosValue=NumberUtil.asBigDecimal(bdPositiveValue);
      bdNegValue=NumberUtil.asBigDecimal(bdNegativeValue);
    }
    dPosValue=bdPosValue.doubleValue();
    dNegValue=bdNegValue.doubleValue();
  }
}
Program: 66889
Project: 66889
Buggy source:
/** 
 * This method wraps number as big decimal.
 * @param n
 * @return
 */
public static BigDecimal asBigDecimal(Number n){
  if (n == null) {
    return null;
  }
 else   if (n instanceof BigNumber) {
    return ((BigNumber)n).getValue();
  }
 else   if (n instanceof BigDecimal) {
    return (BigDecimal)n;
  }
 else   if (n instanceof java.math.BigDecimal) {
    return new BigDecimal(((java.math.BigDecimal)n).toString());
  }
  return BigDecimal.valueOf(n.doubleValue());
}

Fixed version (ground truth):
/** 
 * This method wraps number as big decimal.
 * @param n
 * @return
 */
public static BigDecimal asBigDecimal(Number n){
  if (n == null) {
    return null;
  }
 else   if (n instanceof BigNumber) {
    return ((BigNumber)n).getValue();
  }
 else   if (n instanceof BigDecimal) {
    return (BigDecimal)n;
  }
 else   if (n instanceof java.math.BigDecimal) {
    return new BigDecimal(((java.math.BigDecimal)n).toString());
  }
 else   if (n instanceof BigInteger) {
    return new BigDecimal(n.toString());
  }
  return BigDecimal.valueOf(n.doubleValue());
}
Program: 66891
Project: 66891
Buggy source:
private void populateSeriesTypes(Collection<IChartType> allChartType,Series series,Orientation orientation){
  Iterator<IChartType> iterTypes=allChartType.iterator();
  while (iterTypes.hasNext()) {
    IChartType type=iterTypes.next();
    Series newSeries=type.getSeries();
    if (htSeriesNames == null) {
      htSeriesNames=new Hashtable<String,Series>(20);
    }
    if (type.canCombine()) {
      if (IChartType.TWO_DIMENSION_WITH_DEPTH_TYPE.equals(sDimension) && newSeries instanceof AreaSeries) {
        continue;
      }
      if (!(newSeries instanceof StockSeries) || (orientation.getValue() == Orientation.VERTICAL)) {
        String sDisplayName=newSeries.getDisplayName();
        htSeriesNames.put(sDisplayName,newSeries);
        cbSeriesType.add(sDisplayName);
      }
      if (type.getName().equals(chartModel.getType())) {
        cbSeriesType.select(cbSeriesType.getItemCount() - 1);
      }
    }
  }
}

Fixed version (ground truth):
private void populateSeriesTypes(Collection<IChartType> allChartType,Series series,Orientation orientation){
  Iterator<IChartType> iterTypes=allChartType.iterator();
  while (iterTypes.hasNext()) {
    IChartType type=iterTypes.next();
    Series newSeries=type.getSeries();
    if (type.canCombine()) {
      if (IChartType.TWO_DIMENSION_WITH_DEPTH_TYPE.equals(sDimension) && newSeries instanceof AreaSeries) {
        continue;
      }
      if (!(newSeries instanceof StockSeries) || (orientation.getValue() == Orientation.VERTICAL)) {
        String sDisplayName=newSeries.getDisplayName();
        htSeriesNames.put(sDisplayName,newSeries);
        cbSeriesType.add(sDisplayName);
      }
      if (type.getName().equals(chartModel.getType())) {
        cbSeriesType.select(cbSeriesType.getItemCount() - 1);
      }
    }
  }
}
Program: 66892
Project: 66892
Buggy source:
/** 
 * Next all associated datasetiterators and update the datapointhints object.
 * @param dph
 */
public final void next(DataPointHints dph){
  for (int i=0; i < keys.length; i++) {
    Object val=dsis[i].next();
    if (dph != null) {
      dph.setUserValue(keys[i],val);
    }
  }
}

Fixed version (ground truth):
/** 
 * Next all associated datasetiterators and update the datapointhints object.
 * @param dph
 */
public final void next(DataPointHints dph){
  for (int i=0; i < keys.length; i++) {
    if (dsis[i].hasNext()) {
      Object val=dsis[i].next();
      if (dph != null) {
        dph.setUserValue(keys[i],val);
      }
    }
  }
}
Program: 66896
Project: 66896
Buggy source:
/** 
 * This method initializes cmpTypeButtons
 */
private void createGroups(Vector<IChartSubType> vSubTypes){
  vSubTypeNames=new Vector<String>();
  if (cmpTypeButtons != null && !cmpTypeButtons.isDisposed()) {
    cmpTypeButtons.dispose();
  }
  cmpTypeButtons=new Composite(cmpSubTypes,SWT.NONE);
  cmpTypeButtons.setLayoutData(new GridData(GridData.FILL_BOTH));
  GridLayout rowLayout=new GridLayout(vSubTypes.size(),false);
  rowLayout.marginTop=0;
  rowLayout.marginLeft=0;
  rowLayout.marginBottom=12;
  rowLayout.marginRight=12;
  rowLayout.horizontalSpacing=4;
  cmpTypeButtons.setLayout(rowLayout);
  for (int iC=0; iC < vSubTypes.size(); iC++) {
    IChartSubType subType=vSubTypes.get(iC);
    vSubTypeNames.add(subType.getName());
    Button btnType=new Button(cmpTypeButtons,SWT.TOGGLE | SWT.FLAT);
    btnType.setData(subType.getName());
    btnType.setImage(subType.getImage());
    GridData gd=new GridData();
    gd.widthHint=80;
    gd.heightHint=80;
    btnType.setLayoutData(gd);
    btnType.addSelectionListener(this);
    btnType.setToolTipText(subType.getDescription());
    btnType.getImage().setBackground(btnType.getBackground());
    btnType.setVisible(true);
    if (getDataServiceProvider().checkState(IDataServiceProvider.PART_CHART)) {
      break;
    }
  }
}

Fixed version (ground truth):
/** 
 * This method initializes cmpTypeButtons
 */
private void createGroups(Vector<IChartSubType> vSubTypes){
  vSubTypeNames=new Vector<String>();
  if (cmpTypeButtons != null && !cmpTypeButtons.isDisposed()) {
    cmpTypeButtons.dispose();
  }
  cmpTypeButtons=new Composite(cmpSubTypes,SWT.NONE);
  cmpTypeButtons.setLayoutData(new GridData(GridData.FILL_BOTH));
  GridLayout rowLayout=new GridLayout(vSubTypes.size(),false);
  rowLayout.marginTop=0;
  rowLayout.marginLeft=0;
  rowLayout.marginBottom=12;
  rowLayout.marginRight=12;
  rowLayout.horizontalSpacing=4;
  cmpTypeButtons.setLayout(rowLayout);
  for (int iC=0; iC < vSubTypes.size(); iC++) {
    IChartSubType subType=vSubTypes.get(iC);
    vSubTypeNames.add(subType.getName());
    Button btnType=new Button(cmpTypeButtons,SWT.TOGGLE | SWT.FLAT);
    btnType.setData(subType.getName());
    btnType.setImage(subType.getImage());
    GridData gd=new GridData();
    gd.widthHint=80;
    gd.heightHint=80;
    btnType.setLayoutData(gd);
    btnType.addSelectionListener(this);
    btnType.setToolTipText(subType.getDescription());
    btnType.getImage().setBackground(btnType.getBackground());
    btnType.setVisible(true);
    cmpTypeButtons.layout(true);
    if (getDataServiceProvider().checkState(IDataServiceProvider.PART_CHART)) {
      break;
    }
  }
  cmpSubTypes.layout(true);
}
Program: 66897
Project: 66897
Buggy source:
/** 
 * This method initializes cmpSubTypes
 */
private void createComposite(Vector<IChartSubType> vSubTypes){
  Label lblSubtypes=new Label(cmpRight,SWT.NO_FOCUS);
{
    lblSubtypes.setText(Messages.getString("String_Node_Str"));
    GridData gd=new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalIndent=5;
    lblSubtypes.setLayoutData(gd);
  }
  GridData gdTypes=new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
  cmpSubTypes=new Composite(cmpRight,SWT.NONE);
  createGroups(vSubTypes);
  cmpSubTypes.setLayoutData(gdTypes);
  cmpSubTypes.setToolTipText(Messages.getString("String_Node_Str"));
  cmpSubTypes.setLayout(new GridLayout());
  cmpSubTypes.setVisible(true);
  cmpSubTypes.layout(true);
}

Fixed version (ground truth):
/** 
 * This method initializes cmpSubTypes
 */
private void createComposite(Vector<IChartSubType> vSubTypes){
  Label lblSubtypes=new Label(cmpRight,SWT.NO_FOCUS);
{
    lblSubtypes.setText(Messages.getString("String_Node_Str"));
    GridData gd=new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalIndent=5;
    lblSubtypes.setLayoutData(gd);
  }
  GridData gdTypes=new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
  cmpSubTypes=new Composite(cmpRight,SWT.NONE);
  createGroups(vSubTypes);
  cmpSubTypes.setLayoutData(gdTypes);
  cmpSubTypes.setToolTipText(Messages.getString("String_Node_Str"));
  cmpSubTypes.setLayout(new GridLayout());
  cmpSubTypes.setVisible(true);
}
Program: 66898
Project: 66898
Buggy source:
/** 
 * Populate the aggregation references, return whether the aggregation should  be calculated on OVERALL level, which is indicated by reference to "dataSetRow" java script object.
 * @param aggrReferences
 * @param expr
 * @param aggrMap
 * @return
 * @throws DataException
 */
private boolean popAggrRefFromScriptExpr(Set aggrReferences,IScriptExpression expr,Map aggrMap) throws DataException {
  try {
    List usedRowReferences=ExpressionUtil.extractColumnExpressions(expr.getText());
    boolean result=this.hasDataSetRowReference(expr);
    for (int i=0; i < usedRowReferences.size(); i++) {
      Object o=aggrMap.get(((IColumnBinding)usedRowReferences.get(i)).getResultSetColumnName());
      if (o != null) {
        aggrReferences.add(o);
      }
 else {
        if (this.getBinding(((IColumnBinding)usedRowReferences.get(i)).getResultSetColumnName()) == null) {
          return false;
        }
        result=result || popAggrRefFromBaseExpr(aggrReferences,this.getBinding(((IColumnBinding)usedRowReferences.get(i)).getResultSetColumnName()).getExpression(),aggrMap);
      }
    }
    return result;
  }
 catch (  BirtException be) {
    throw DataException.wrap(be);
  }
}

Fixed version (ground truth):
/** 
 * Populate the aggregation references, return whether the aggregation should  be calculated on OVERALL level, which is indicated by reference to "dataSetRow" java script object.
 * @param aggrReferences
 * @param expr
 * @param aggrMap
 * @return
 * @throws DataException
 */
private boolean popAggrRefFromScriptExpr(Set aggrReferences,IScriptExpression expr,Map aggrMap) throws DataException {
  try {
    List usedRowReferences=ExpressionUtil.extractColumnExpressions(expr.getText());
    boolean result=this.hasDataSetRowReference(expr);
    for (int i=0; i < usedRowReferences.size(); i++) {
      Object o=aggrMap.get(((IColumnBinding)usedRowReferences.get(i)).getResultSetColumnName());
      if (o != null) {
        aggrReferences.add(o);
      }
 else {
        if (this.getBinding(((IColumnBinding)usedRowReferences.get(i)).getResultSetColumnName()) == null) {
          return false;
        }
        result=popAggrRefFromBaseExpr(aggrReferences,this.getBinding(((IColumnBinding)usedRowReferences.get(i)).getResultSetColumnName()).getExpression(),aggrMap) || result;
      }
    }
    return result;
  }
 catch (  BirtException be) {
    throw DataException.wrap(be);
  }
}
Program: 66899
Project: 66899
Buggy source:
/** 
 * Calculate the number of tabs that will fit in the tab list composite.
 */
protected void computeTabsThatFitInComposite(){
  tabsThatFitInComposite=Math.round((getSize().y - 22) / getTabHeight());
  if (tabsThatFitInComposite <= 0) {
    tabsThatFitInComposite=1;
  }
}

Fixed version (ground truth):
/** 
 * Calculate the number of tabs that will fit in the tab list composite.
 */
protected void computeTabsThatFitInComposite(){
  tabsThatFitInComposite=Math.round(((float)(getSize().y - 22)) / getTabHeight());
  if (tabsThatFitInComposite <= 0) {
    tabsThatFitInComposite=1;
  }
}
Program: 66900
Project: 66900
Buggy source:
public void execute(Command command){
  if (command == null) {
    return;
  }
  ar.startTrans(command.getLabel());
  command.execute();
  ar.commit();
}

Fixed version (ground truth):
public void execute(Command command){
  if (command == null) {
    return;
  }
  if (command.getLabel() == null) {
    command.setLabel("String_Node_Str");
  }
  ar.startTrans(command.getLabel());
  command.execute();
  ar.commit();
}
Program: 66902
Project: 66902
Buggy source:
private ColumnHintHandle findColumnHint(DataSetHandle handle,String columnName){
  if (columnName == null || columnName.trim().length() == 0)   return null;
  ColumnHintHandle hint=null;
  Iterator iter=handle.getPropertyHandle(DataSetHandle.COLUMN_HINTS_PROP).iterator();
  while (iter.hasNext()) {
    hint=(ColumnHintHandle)iter.next();
    if (columnName.equals(hint.getColumnName())) {
      return hint;
    }
  }
  if (handle instanceof DerivedDataSetHandle) {
    List<DataSetHandle> inputDataSets=((DerivedDataSetHandle)handle).getInputDataSets();
    for (int i=0; i < inputDataSets.size(); i++) {
      hint=findColumnHint(inputDataSets.get(i),columnName);
      if (hint != null) {
        return hint;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
private ColumnHintHandle findColumnHint(DataSetHandle handle,String columnName){
  if (columnName == null || columnName.trim().length() == 0)   return null;
  ColumnHintHandle hint=null;
  Iterator iter=handle.getPropertyHandle(DataSetHandle.COLUMN_HINTS_PROP).iterator();
  while (iter.hasNext()) {
    hint=(ColumnHintHandle)iter.next();
    if (columnName.equals(hint.getColumnName())) {
      return hint;
    }
  }
  if (handle instanceof DerivedDataSetHandle) {
    String[] splits=columnName.split(DERIVED_SEPERATOR);
    List<DataSetHandle> inputDataSets=((DerivedDataSetHandle)handle).getInputDataSets();
    for (int i=0; i < inputDataSets.size(); i++) {
      hint=findColumnHint(inputDataSets.get(i),columnName);
      if (hint != null) {
        return hint;
      }
      if (splits.length > 1) {
        if (splits[0].equals(inputDataSets.get(i).getName())) {
          columnName=columnName.substring(columnName.indexOf(DERIVED_SEPERATOR) + DERIVED_SEPERATOR.length());
          return findColumnHint(inputDataSets.get(i),columnName);
        }
      }
    }
  }
  return null;
}
Program: 66903
Project: 66903
Buggy source:
/** 
 * @param request
 */
protected void handleCreateElement(final ReportRequest request){
  final GraphicalViewer viewer=getGraphicalViewer();
  if (!viewer.getControl().isVisible()) {
    return;
  }
  final List list=request.getSelectionModelList();
  if (list.size() != 1) {
    return;
  }
  Display.getCurrent().asyncExec(new Runnable(){
    public void run(){
      Object part=viewer.getEditPartRegistry().get(list.get(0));
      if (part instanceof EditPart) {
        Request directEditRequest=new Request(ReportRequest.CREATE_ELEMENT);
        directEditRequest.getExtendedData().putAll(request.getExtendedData());
        if (((EditPart)part).understandsRequest(directEditRequest)) {
          ((EditPart)part).performRequest(directEditRequest);
        }
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * @param request
 */
protected void handleCreateElement(final ReportRequest request){
  final GraphicalViewer viewer=getGraphicalViewer();
  if (!viewer.getControl().isVisible()) {
    return;
  }
  final List list=request.getSelectionModelList();
  if (list.size() != 1) {
    return;
  }
  if (request.getSource() instanceof ParameterHandle && list.get(0) instanceof DataItemHandle) {
    return;
  }
  Display.getCurrent().asyncExec(new Runnable(){
    public void run(){
      Object part=viewer.getEditPartRegistry().get(list.get(0));
      if (part instanceof EditPart) {
        Request directEditRequest=new Request(ReportRequest.CREATE_ELEMENT);
        directEditRequest.getExtendedData().putAll(request.getExtendedData());
        if (((EditPart)part).understandsRequest(directEditRequest)) {
          ((EditPart)part).performRequest(directEditRequest);
        }
      }
    }
  }
);
}
Program: 66904
Project: 66904
Buggy source:
private void fireCreateRequest(Object newElement){
  List list=new ArrayList();
  list.add(newElement);
  ReportRequest r=new ReportRequest();
  r.setType(ReportRequest.CREATE_ELEMENT);
  r.setSelectionObject(list);
  SessionHandleAdapter.getInstance().getMediator().notifyRequest(r);
}

Fixed version (ground truth):
private void fireCreateRequest(Object newElement,Object source){
  List list=new ArrayList();
  list.add(newElement);
  ReportRequest r=new ReportRequest(source);
  r.setType(ReportRequest.CREATE_ELEMENT);
  r.setSelectionObject(list);
  SessionHandleAdapter.getInstance().getMediator().notifyRequest(r);
}
Program: 66905
Project: 66905
Buggy source:
public void run(){
  CommandStack stack=SessionHandleAdapter.getInstance().getCommandStack();
  stack.startTrans(DISPLAY_TEXT);
  try {
    if (Policy.TRACING_ACTIONS) {
      System.out.println("String_Node_Str");
    }
    Object newElement=InsertInLayoutUtil.performInsert(getSelection(),getTargetEditPart());
    if (newElement != null)     runCreate(newElement,targetPart.getModel());
    stack.commit();
    fireCreateRequest(newElement);
  }
 catch (  SemanticException e) {
    ExceptionHandler.handle(e);
    stack.rollback();
  }
}

Fixed version (ground truth):
public void run(){
  CommandStack stack=SessionHandleAdapter.getInstance().getCommandStack();
  stack.startTrans(DISPLAY_TEXT);
  try {
    if (Policy.TRACING_ACTIONS) {
      System.out.println("String_Node_Str");
    }
    Object newElement=InsertInLayoutUtil.performInsert(getSelection(),getTargetEditPart());
    if (newElement != null)     runCreate(newElement,targetPart.getModel());
    stack.commit();
    fireCreateRequest(newElement,getSelection());
  }
 catch (  SemanticException e) {
    ExceptionHandler.handle(e);
    stack.rollback();
  }
}
Program: 66906
Project: 66906
Buggy source:
public boolean onBroughtToTop(IReportEditorPage page){
  String prompt=ReportPlugin.getDefault().getPreferenceStore().getString(ReportPlugin.LIBRARY_WARNING_PREFERENCE);
  if (prompt == null || (!ReportPlugin.getDefault().getPreferenceStore().getString(ReportPlugin.LIBRARY_WARNING_PREFERENCE).equals(MessageDialogWithToggle.NEVER))) {
    MessageDialogWithToggle dialog=MessageDialogWithToggle.openInformation(UIUtil.getDefaultShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),false,ReportPlugin.getDefault().getPreferenceStore(),ReportPlugin.LIBRARY_WARNING_PREFERENCE);
    if (dialog.getToggleState()) {
      ReportPlugin.getDefault().getPreferenceStore().setValue(ReportPlugin.LIBRARY_WARNING_PREFERENCE,MessageDialogWithToggle.NEVER);
    }
  }
  ModuleHandle newModel=getProvider().queryReportModuleHandle();
  boolean reload=false;
  if (getStaleType() == IPageStaleType.MODEL_RELOAD) {
    setModel(null);
    doSave(null);
    reload=true;
  }
  if ((newModel != null && getModel() != newModel) || reload) {
    Object oldModel=getModel();
    setModel(newModel);
    rebuildReportDesign(oldModel);
    if (getModel() != null) {
      this.getGraphicalViewer().setContents(getModel());
      hookModelEventManager(getModel());
      markPageStale(IPageStaleType.NONE);
    }
    updateStackActions();
  }
  GraphicalViewer view=getGraphicalViewer();
  if (view != null) {
    UIUtil.resetViewSelection(view,true);
  }
  return true;
}

Fixed version (ground truth):
public boolean onBroughtToTop(IReportEditorPage page){
  String prompt=ReportPlugin.getDefault().getPreferenceStore().getString(ReportPlugin.LIBRARY_WARNING_PREFERENCE);
  if (!alreadyShow && (prompt == null || (!ReportPlugin.getDefault().getPreferenceStore().getString(ReportPlugin.LIBRARY_WARNING_PREFERENCE).equals(MessageDialogWithToggle.NEVER)))) {
    alreadyShow=true;
    MessageDialogWithToggle dialog=MessageDialogWithToggle.openInformation(UIUtil.getDefaultShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),false,ReportPlugin.getDefault().getPreferenceStore(),ReportPlugin.LIBRARY_WARNING_PREFERENCE);
    if (dialog.getToggleState()) {
      ReportPlugin.getDefault().getPreferenceStore().setValue(ReportPlugin.LIBRARY_WARNING_PREFERENCE,MessageDialogWithToggle.NEVER);
    }
  }
  ModuleHandle newModel=getProvider().queryReportModuleHandle();
  boolean reload=false;
  if (getStaleType() == IPageStaleType.MODEL_RELOAD) {
    setModel(null);
    doSave(null);
    reload=true;
  }
  if ((newModel != null && getModel() != newModel) || reload) {
    Object oldModel=getModel();
    setModel(newModel);
    rebuildReportDesign(oldModel);
    if (getModel() != null) {
      this.getGraphicalViewer().setContents(getModel());
      hookModelEventManager(getModel());
      markPageStale(IPageStaleType.NONE);
    }
    updateStackActions();
  }
  GraphicalViewer view=getGraphicalViewer();
  if (view != null) {
    UIUtil.resetViewSelection(view,true);
  }
  return true;
}
Program: 66907
Project: 66907
Buggy source:
public Object start(IApplicationContext context) throws Exception {
  String[] appArgs=null;
  if (context.getArguments() != null) {
    Object args=context.getArguments().get(IApplicationContext.APPLICATION_ARGS);
    if (args instanceof String[]) {
      appArgs=(String[])args;
    }
  }
  ReportLauncher.main(appArgs);
  return null;
}

Fixed version (ground truth):
public Object start(IApplicationContext context) throws Exception {
  String[] appArgs=new String[0];
  if (context.getArguments() != null) {
    Object args=context.getArguments().get(IApplicationContext.APPLICATION_ARGS);
    if (args instanceof String[]) {
      appArgs=(String[])args;
    }
  }
  ReportLauncher.main(appArgs);
  return null;
}
Program: 66908
Project: 66908
Buggy source:
public void evaluateExpression(String expression,IDebugElement context,IWatchExpressionListener listener){
  fListener=listener;
  IStackFrame frame=null;
  if (context instanceof IStackFrame) {
    frame=(IStackFrame)context;
  }
 else   if (context instanceof IThread) {
    try {
      frame=((IThread)context).getTopStackFrame();
    }
 catch (    DebugException e) {
    }
  }
  final IStackFrame tempFrame=frame;
  final String tempStr=expression;
  IWatchExpressionResult watchResult=new IWatchExpressionResult(){
    public IValue getValue(){
      if (tempFrame != null) {
        return ((ScriptDebugTarget)tempFrame.getDebugTarget()).evaluate((ScriptStackFrame)tempFrame,tempStr);
      }
      return null;
    }
    public boolean hasErrors(){
      return getValue() == null;
    }
    public String[] getErrorMessages(){
      return new String[]{"String_Node_Str"};
    }
    public String getExpressionText(){
      return tempStr;
    }
    public DebugException getException(){
      return null;
    }
  }
;
  if (frame == null) {
    fListener.watchEvaluationFinished(watchResult);
  }
 else {
    fListener.watchEvaluationFinished(watchResult);
  }
}

Fixed version (ground truth):
public void evaluateExpression(String expression,IDebugElement context,IWatchExpressionListener listener){
  fListener=listener;
  IStackFrame frame=null;
  if (context instanceof IStackFrame) {
    frame=(IStackFrame)context;
  }
 else   if (context instanceof IThread) {
    try {
      frame=((IThread)context).getTopStackFrame();
    }
 catch (    DebugException e) {
    }
  }
  final IStackFrame tempFrame=frame;
  final String tempStr=expression;
  IWatchExpressionResult watchResult=new IWatchExpressionResult(){
    public IValue getValue(){
      if (tempFrame != null) {
        return ((ScriptDebugTarget)tempFrame.getDebugTarget()).evaluate((ScriptStackFrame)tempFrame,tempStr);
      }
      return null;
    }
    public boolean hasErrors(){
      return getValue() == null;
    }
    public String[] getErrorMessages(){
      return new String[]{"String_Node_Str"};
    }
    public String getExpressionText(){
      return tempStr;
    }
    public DebugException getException(){
      return null;
    }
  }
;
  fListener.watchEvaluationFinished(watchResult);
}
Program: 66909
Project: 66909
Buggy source:
/** 
 * @param showFeatures
 */
public ReportAdvancedLauncherTab(boolean showFeatures){
  fNumExternalChecked=0;
  fNumWorkspaceChecked=0;
  fShowFeatures=true;
  fShowFeatures=showFeatures;
  PDEPlugin.getDefault().getLabelProvider().connect(this);
  fImage=PDEPluginImages.DESC_REQ_PLUGINS_OBJ.createImage();
  fWorkspaceBIRTModels=getInterestProject(REPORTPROJECTKID);
  fWorkspaceJavaModels=getInterestProject(JavaCore.NATURE_ID);
}

Fixed version (ground truth):
/** 
 * @param showFeatures
 */
public ReportAdvancedLauncherTab(boolean showFeatures){
  fNumExternalChecked=0;
  fNumWorkspaceChecked=0;
  fShowFeatures=showFeatures;
  PDEPlugin.getDefault().getLabelProvider().connect(this);
  fImage=PDEPluginImages.DESC_REQ_PLUGINS_OBJ.createImage();
  fWorkspaceBIRTModels=getInterestProject(REPORTPROJECTKID);
  fWorkspaceJavaModels=getInterestProject(JavaCore.NATURE_ID);
}