nus-yam/ex-repair huggingface dataset:
Program: 67111
Project: 67111
Buggy source:
protected void handlePageBreakInterval(){
  if (tableExecutor.breakOnDetailBand) {
    BandDesign band=(BandDesign)design;
    if (band.getBandType() == BandDesign.BAND_DETAIL) {
      tableExecutor.next();
      if (tableExecutor.needSoftBreakAfter()) {
        IStyle style=content.getStyle();
        if (style != null) {
          CSSValue pageBreak=style.getProperty(IStyle.STYLE_PAGE_BREAK_AFTER);
          if (pageBreak == null || IStyle.AUTO_VALUE.equals(pageBreak)) {
            style.setProperty(IStyle.STYLE_PAGE_BREAK_AFTER,IStyle.SOFT_VALUE);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
protected void handlePageBreakInterval(){
  if (tableExecutor.breakOnDetailBand) {
    BandDesign band=(BandDesign)design;
    if (band.getBandType() == BandDesign.BAND_DETAIL) {
      tableExecutor.next();
      if (tableExecutor.needSoftBreakAfter()) {
        tableExecutor.softBreakBefore=true;
        tableExecutor.pageRowCount=0;
      }
 else       if (tableExecutor.softBreakBefore) {
        IStyle style=content.getStyle();
        if (style != null) {
          CSSValue pageBreak=style.getProperty(IStyle.STYLE_PAGE_BREAK_BEFORE);
          if (pageBreak == null || IStyle.AUTO_VALUE.equals(pageBreak)) {
            style.setProperty(IStyle.STYLE_PAGE_BREAK_BEFORE,IStyle.SOFT_VALUE);
          }
        }
        tableExecutor.softBreakBefore=false;
        tableExecutor.previous();
        tableExecutor.addAfterBreak=true;
      }
    }
  }
}
Program: 67114
Project: 67114
Buggy source:
public CubeCursorImpl(IBaseQueryResults outerResults,CubeCursor cursor,Scriptable scope,ScriptContext cx,ICubeQueryDefinition queryDefn,BirtCubeView view) throws DataException {
  this.cursor=cursor;
  this.scope=scope;
  this.queryDefn=queryDefn;
  this.cubeView=view;
  this.cx=cx;
  this.dimensionCursorMap=new HashMap<DimLevel,DimensionCursor>();
  populateDimensionCursor();
  this.outerResults=OlapExpressionUtil.createQueryResultsScriptable(outerResults);
  this.bindingMap=new HashMap();
  this.validBindingSet=new HashSet();
  this.dataTypeMap=new HashMap();
  List<IBinding> allBindings=CubeQueryDefinitionUtil.getAllBindings(queryDefn);
  for (int i=0; i < allBindings.size(); i++) {
    IBinding binding=(IBinding)allBindings.get(i);
    final String bindingName=binding.getBindingName();
    validBindingSet.add(bindingName);
    final IBaseExpression expr=binding.getExpression();
    if (binding.getAggrFunction() == null) {
      this.bindingMap.put(bindingName,expr);
      OLAPExpressionCompiler.compile(cx.newContext(this.scope),expr);
    }
    dataTypeMap.put(bindingName,new Integer(binding.getDataType()));
  }
  this.scope.put(ScriptConstants.DATA_BINDING_SCRIPTABLE,this.scope,new JSCubeBindingObject(this));
  this.scope.put(ScriptConstants.DATA_SET_BINDING_SCRIPTABLE,this.scope,new JSCubeBindingObject(this));
}

Fixed version (ground truth):
public CubeCursorImpl(IBaseQueryResults outerResults,CubeCursor cursor,Scriptable scope,ScriptContext cx,ICubeQueryDefinition queryDefn,BirtCubeView view) throws DataException {
  this.cursor=cursor;
  this.scope=scope;
  this.queryDefn=queryDefn;
  this.cubeView=view;
  this.cx=cx;
  this.dimensionCursorMap=new HashMap<DimLevel,DimensionCursor>();
  populateDimensionCursor();
  this.outerResults=OlapExpressionUtil.createQueryResultsScriptable(outerResults);
  this.bindingMap=new HashMap();
  this.validBindingSet=new HashSet();
  this.dataTypeMap=new HashMap();
  List<IBinding> allBindings=CubeQueryDefinitionUtil.getAllBindings(queryDefn);
  for (int i=0; i < allBindings.size(); i++) {
    IBinding binding=(IBinding)allBindings.get(i);
    final String bindingName=binding.getBindingName();
    validBindingSet.add(bindingName);
    final IBaseExpression expr=binding.getExpression();
    if (binding.getAggrFunction() == null) {
      this.bindingMap.put(bindingName,expr);
      if (expr instanceof IScriptExpression) {
        if (!isSimpleDimensionExpression(((IScriptExpression)expr).getText()))         OLAPExpressionCompiler.compile(cx.newContext(this.scope),expr);
      }
 else       OLAPExpressionCompiler.compile(cx.newContext(this.scope),expr);
    }
    dataTypeMap.put(bindingName,new Integer(binding.getDataType()));
  }
  this.scope.put(ScriptConstants.DATA_BINDING_SCRIPTABLE,this.scope,new JSCubeBindingObject(this));
  this.scope.put(ScriptConstants.DATA_SET_BINDING_SCRIPTABLE,this.scope,new JSCubeBindingObject(this));
}
Program: 67115
Project: 67115
Buggy source:
/** 
 * @param is
 * @return
 * @throws IOException
 * @throws DataException
 */
public static ObjectInputStream createObjectInputStream(final InputStream is) throws IOException, DataException {
  try {
    return AccessController.doPrivileged(new PrivilegedExceptionAction<ObjectInputStream>(){
      public ObjectInputStream run() throws IOException {
        return new ObjectInputStream(is);
      }
    }
);
  }
 catch (  PrivilegedActionException e) {
    Exception typedException=e.getException();
    if (typedException instanceof IOException) {
      throw (IOException)typedException;
    }
    throw new DataException(e.getMessage());
  }
}

Fixed version (ground truth):
public static ObjectInputStream createObjectInputStream(final InputStream is,final ClassLoader classLoader) throws IOException, DataException {
  try {
    return AccessController.doPrivileged(new PrivilegedExceptionAction<ObjectInputStream>(){
      public ObjectInputStream run() throws IOException {
        return new ObjectInputStream(is){
          protected Class resolveClass(          ObjectStreamClass desc) throws IOException, ClassNotFoundException {
            return Class.forName(desc.getName(),false,classLoader);
          }
        }
;
      }
    }
);
  }
 catch (  PrivilegedActionException e) {
    Exception typedException=e.getException();
    if (typedException instanceof IOException) {
      throw (IOException)typedException;
    }
    throw new DataException(e.getMessage());
  }
}
Program: 67116
Project: 67116
Buggy source:
/** 
 * @return fetched ResultObject
 * @throws IOException
 */
public IResultObject fetch() throws DataException {
  if (curIndex < dataCount) {
    try {
      curIndex++;
      return roUtil.readData(intputStream,1)[0];
    }
 catch (    IOException e) {
      throw new DataException("String_Node_Str",e);
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * @return fetched ResultObject
 * @throws IOException
 */
public IResultObject fetch() throws DataException {
  if (curIndex < dataCount) {
    try {
      curIndex++;
      return roUtil.readData(intputStream,this.loader,1)[0];
    }
 catch (    IOException e) {
      throw new DataException("String_Node_Str",e);
    }
  }
  return null;
}
Program: 67118
Project: 67118
Buggy source:
/** 
 * Read the specified length of objects from file. Notice to improve the efficienly of reading, the order of reading only can be sequencial. The caller has responsibility to design a good algorithm to achive this goal.
 * @param length
 * @param stopSign
 * @throws IOException , exception of reading file
 * @return ResultObject array
 * @throws DataException 
 */
IResultObject[] read(int length) throws IOException, DataException {
  if (isOpen == false) {
    try {
      fis=FileSecurity.createFileInputStream(file);
    }
 catch (    Exception e) {
    }
    bis=new BufferedInputStream(fis);
    isOpen=true;
  }
  return resultObjectUtil.readData(bis,length);
}

Fixed version (ground truth):
/** 
 * Read the specified length of objects from file. Notice to improve the efficienly of reading, the order of reading only can be sequencial. The caller has responsibility to design a good algorithm to achive this goal.
 * @param length
 * @param stopSign
 * @throws IOException , exception of reading file
 * @return ResultObject array
 * @throws DataException 
 */
IResultObject[] read(int length) throws IOException, DataException {
  if (isOpen == false) {
    try {
      fis=FileSecurity.createFileInputStream(file);
    }
 catch (    Exception e) {
    }
    bis=new BufferedInputStream(fis);
    isOpen=true;
  }
  return resultObjectUtil.readData(bis,null,length);
}
Program: 67119
Project: 67119
Buggy source:
private int getParameterType(int i) throws OdaException {
  if (parameterDefn.getParameterType(i) != Types.CHAR)   return parameterDefn.getParameterType(i);
  try {
    IParameterMetaData paramMetaData=getParameterMetaData();
    if (paramMetaData != null && paramMetaData.getParameterCount() >= i)     return paramMetaData.getParameterType(i);
 else     return parameterDefn.getParameterType(i);
  }
 catch (  OdaException ex) {
    return parameterDefn.getParameterType(i);
  }
}

Fixed version (ground truth):
private int getParameterType(int i) throws OdaException {
  if (parameterDefn.getParameterType(i) != Types.CHAR)   return parameterDefn.getParameterType(i);
  try {
    IParameterMetaData paramMetaData=getParameterMetaData();
    if (paramMetaData != null && paramMetaData.getParameterCount() >= i)     return paramMetaData.getParameterType(i);
  }
 catch (  Exception ex) {
  }
  return parameterDefn.getParameterType(i);
}
Program: 67120
Project: 67120
Buggy source:
public void setNull(int parameterId) throws OdaException {
  assertNotNull(callStat);
  try {
    if (this.getParameterMetaData() != null) {
      this.callStat.setNull(parameterId,getParameterType(parameterId));
    }
 else {
      this.callStat.setNull(parameterId,java.sql.Types.OTHER);
    }
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PREPARESTATEMENT_CANNOT_SET_NULL_VALUE,e);
  }
}

Fixed version (ground truth):
public void setNull(int parameterId) throws OdaException {
  assertNotNull(callStat);
  try {
    if (this.parameterDefn != null) {
      this.callStat.setNull(parameterId,getParameterType(parameterId));
    }
 else {
      this.callStat.setNull(parameterId,java.sql.Types.OTHER);
    }
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.PREPARESTATEMENT_CANNOT_SET_NULL_VALUE,e);
  }
}
Program: 67123
Project: 67123
Buggy source:
/** 
 * @param d
 * @return
 */
private static Calendar getCalendar(Date d){
  Calendar c=Calendar.getInstance(timeZone);
  if (d == null) {
    c.clear();
    c.set(1970,0,1);
  }
 else {
    c.setTime(d);
  }
  return c;
}

Fixed version (ground truth):
/** 
 * @param d
 * @return
 */
private static Calendar getCalendar(Date d){
  Calendar c=Calendar.getInstance(defaultLocale);
  if (d instanceof java.sql.Date) {
    c.setTimeZone(TimeZone.getDefault());
  }
 else {
    c.setTimeZone(timeZone);
  }
  if (d == null) {
    c.clear();
    c.set(1970,0,1);
  }
 else {
    c.setTime(d);
  }
  return c;
}
Program: 67124
Project: 67124
Buggy source:
/** 
 * evaluate the script with specified script language.
 * @param language
 * @param script
 * @return
 * @throws BirtException
 */
Object evaluate(String language,String script) throws BirtException ;

Fixed version (ground truth):
/** 
 * Evaluate the script.
 * @param script
 * @return
 * @throws BirtException
 */
Object evaluate(Expression script) throws BirtException ;
Program: 67125
Project: 67125
Buggy source:
public Object evaluate(String language,String script) throws BirtException {
  if (null != script && script.length() > 0) {
    return context.evaluateInlineScript(language,script);
  }
  return null;
}

Fixed version (ground truth):
public Object evaluate(Expression script) throws BirtException {
  return context.evaluate(script);
}
Program: 67126
Project: 67126
Buggy source:
protected void updateMetaInfo(){
  for (int i=0; i < newMetaInfo.size(); i++) {
    String[] info=newMetaInfo.get(i);
    String pRsetId=info[0];
    String rawId=info[1];
    String queryId=info[2];
    String rsetId=info[3];
    String rowId=info[4];
    removeMetaInfo(pRsetId,queryId);
  }
  for (int i=0; i < metaInfo.size(); i++) {
    String[] info=metaInfo.get(i);
    storeDteMetaInfo(info[0],info[1],info[2],info[3],info[4]);
  }
  newMetaInfo.clear();
  metaInfo.clear();
}

Fixed version (ground truth):
protected void updateMetaInfo(){
  for (int i=0; i < newMetaInfo.size(); i++) {
    String[] info=newMetaInfo.get(i);
    String pRsetId=info[0];
    String rawId=info[1];
    String queryId=info[2];
    String rsetId=info[3];
    String rowId=info[4];
    removeMetaInfo(pRsetId,queryId,rsetId);
  }
  for (int i=0; i < metaInfo.size(); i++) {
    String[] info=metaInfo.get(i);
    storeDteMetaInfo(info[0],info[1],info[2],info[3],info[4]);
  }
  newMetaInfo.clear();
  metaInfo.clear();
}
Program: 67129
Project: 67129
Buggy source:
/** 
 * Updates the dimension combo according to chart type and axes number
 * @param sSelectedType Chart type
 * @return whether the dimension is changed after updating
 */
private boolean updateDimensionCombo(String sSelectedType){
  boolean isOldExist=false;
  IChartType chartType=ChartUIUtil.getChartType(sSelectedType);
  String[] dimensionArray=chartType.getSupportedDimensions();
  int axesNum=ChartUIUtil.getOrthogonalAxisNumber(chartModel);
  if (sDimension == null) {
    sDimension=chartType.getDefaultDimension();
    isOldExist=true;
  }
  cbDimension.removeAll();
  boolean bAreaSeriesMixed=isAreaSeriesMixed();
  for (int i=0; i < dimensionArray.length; i++) {
    boolean isSupported=chartType.isDimensionSupported(dimensionArray[i],(ChartWizardContext)context,axesNum,0);
    if (isSupported) {
      if (bAreaSeriesMixed && dimensionArray[i].equals(IChartType.TWO_DIMENSION_WITH_DEPTH_TYPE)) {
        continue;
      }
      cbDimension.add(dimensionArray[i]);
    }
    if (!isOldExist && sDimension.equals(dimensionArray[i])) {
      isOldExist=isSupported;
    }
  }
  String cache=ChartCacheManager.getInstance().getDimension(sSelectedType);
  if (cache != null) {
    sDimension=cache;
    isOldExist=true;
  }
  if (!isOldExist) {
    sDimension=chartType.getDefaultDimension();
  }
  cbDimension.setText(sDimension);
  return !isOldExist;
}

Fixed version (ground truth):
/** 
 * Updates the dimension combo according to chart type and axes number
 * @param sSelectedType Chart type
 * @return whether the dimension is changed after updating
 */
protected boolean updateDimensionCombo(String sSelectedType){
  boolean isOldExist=false;
  IChartType chartType=ChartUIUtil.getChartType(sSelectedType);
  String[] dimensionArray=chartType.getSupportedDimensions();
  int axesNum=ChartUIUtil.getOrthogonalAxisNumber(chartModel);
  if (sDimension == null) {
    sDimension=chartType.getDefaultDimension();
    isOldExist=true;
  }
  cbDimension.removeAll();
  boolean bAreaSeriesMixed=isAreaSeriesMixed();
  for (int i=0; i < dimensionArray.length; i++) {
    boolean isSupported=chartType.isDimensionSupported(dimensionArray[i],(ChartWizardContext)context,axesNum,0);
    if (isSupported) {
      if (bAreaSeriesMixed && dimensionArray[i].equals(IChartType.TWO_DIMENSION_WITH_DEPTH_TYPE)) {
        continue;
      }
      cbDimension.add(dimensionArray[i]);
    }
    if (!isOldExist && sDimension.equals(dimensionArray[i])) {
      isOldExist=isSupported;
    }
  }
  cbDimension.setData(cbDimension.getItems());
  String cache=ChartCacheManager.getInstance().getDimension(sSelectedType);
  if (cache != null) {
    sDimension=cache;
    isOldExist=true;
  }
  if (!isOldExist) {
    sDimension=chartType.getDefaultDimension();
  }
  cbDimension.setText(sDimension);
  return !isOldExist;
}
Program: 67132
Project: 67132
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;
    }
  }
  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 (hint == null && (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 hint;
}
Program: 67134
Project: 67134
Buggy source:
/** 
 * Checks if given dimension cusor is associated with a dummy group
 */
public static boolean isDummyGroup(DimensionCursor dc) throws OLAPException {
  return dc.getEdgeStart() == -1 && dc.getEdgeEnd() == -1;
}

Fixed version (ground truth):
/** 
 * Checks if given dimension cusor is associated with a dummy group
 */
public static boolean isDummyGroup(DimensionCursor dc) throws OLAPException {
  return dc.getExtent() == -1;
}
Program: 67137
Project: 67137
Buggy source:
/** 
 * build overflow style which displays the vertical or horizontal scrollbar automatically if content inside the div tag exceed the limit in any aspect.
 * @param buf - the buffer to build the overflow style
 * @param style - the style of current report item
 * @param outputHidden - whether to output the overflow property with hidden value
 */
public static void buildOverflowStyle(StringBuffer buf,IStyle style,boolean outputHidden){
  if (style != null) {
    String overflow=style.getOverflow();
    if (outputHidden || (overflow != null && !CSSConstants.CSS_OVERFLOW_HIDDEN_VALUE.equals(overflow))) {
      buf.append("String_Node_Str");
      buf.append(overflow != null ? overflow : CSSConstants.CSS_OVERFLOW_HIDDEN_VALUE);
      buf.append("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * build overflow style which displays the vertical or horizontal scrollbar automatically if content inside the div tag exceed the limit in any aspect.
 * @param buf - the buffer to build the overflow style
 * @param style - the style of current report item
 * @param outputHidden - whether to output the overflow property with hidden value
 */
public static void buildOverflowStyle(StringBuffer buf,IStyle style,boolean outputHidden){
  String overflow=null;
  if (style != null) {
    overflow=style.getOverflow();
  }
  if (outputHidden || (overflow != null && !CSSConstants.CSS_OVERFLOW_HIDDEN_VALUE.equals(overflow))) {
    buf.append("String_Node_Str");
    buf.append(overflow != null ? overflow : CSSConstants.CSS_OVERFLOW_HIDDEN_VALUE);
    buf.append("String_Node_Str");
  }
}
Program: 67138
Project: 67138
Buggy source:
public void restart(){
  this.isCancelled=false;
}

Fixed version (ground truth):
public void restart() throws EngineException {
  getDataEngine().getDTESession().restart();
  this.isCancelled=false;
}
Program: 67139
Project: 67139
Buggy source:
public void modifyText(ModifyEvent e){
  if (e.widget.equals(txtHeight)) {
    if (txtHeight.isSetValue()) {
      getBlockForProcessing().setHeightHint(txtHeight.getValue());
    }
 else {
      getBlockForProcessing().unsetHeightHint();
    }
  }
 else   if (e.widget.equals(txtWidth)) {
    if (txtWidth.isSetValue()) {
      getBlockForProcessing().setWidthHint(txtWidth.getValue());
    }
 else {
      getBlockForProcessing().unsetWidthHint();
    }
  }
}

Fixed version (ground truth):
public void modifyText(ModifyEvent e){
  if (e.widget.equals(txtHeight)) {
    if (txtHeight.isSetValue()) {
      double height=txtHeight.getValue();
      double max=getChart().getBlock().getBounds().getHeight();
      max=max > 0 ? max : 130;
      height=height > max ? max : height;
      getBlockForProcessing().setHeightHint(height);
      if (height != txtHeight.getValue()) {
        txtHeight.setValue(height);
      }
    }
 else {
      getBlockForProcessing().unsetHeightHint();
    }
  }
 else   if (e.widget.equals(txtWidth)) {
    if (txtWidth.isSetValue()) {
      double width=txtWidth.getValue();
      double max=getChart().getBlock().getBounds().getWidth();
      max=max > 0 ? max : 220;
      width=width > max ? max : width;
      getBlockForProcessing().setWidthHint(width);
      if (width != txtWidth.getValue()) {
        txtWidth.setValue(width);
      }
    }
 else {
      getBlockForProcessing().unsetWidthHint();
    }
  }
}
Program: 67140
Project: 67140
Buggy source:
private BindingColumn(String columnName,IBaseExpression baseExpr,boolean isAggregation,int type){
  this.columnName=columnName;
  this.baseExpr=baseExpr;
  this.isAggregation=isAggregation;
  this.type=type;
  if (this.baseExpr instanceof ScriptExpression) {
    ((ScriptExpression)this.baseExpr).setDataType(type);
  }
}

Fixed version (ground truth):
private BindingColumn(String columnName,IBaseExpression baseExpr,boolean isAggregation,int type){
  this.columnName=columnName;
  this.baseExpr=baseExpr;
  this.isAggregation=isAggregation;
  this.type=type;
}
Program: 67141
Project: 67141
Buggy source:
private void doNew(){
  doEdit(new ComputedColumn());
}

Fixed version (ground truth):
private void doNew(){
  doEdit(new ComputedColumn(),true);
}
Program: 67142
Project: 67142
Buggy source:
protected void doEdit(Object structureOrHandle){
  ComputedColumnInputDialog dlg=new ComputedColumnInputDialog(structureOrHandle);
  if (dlg.open() == Window.OK) {
    updateComputedColumn(structureOrHandle);
  }
}

Fixed version (ground truth):
protected void doEdit(Object structureOrHandle,boolean applyAnalysis){
  ComputedColumnInputDialog dlg=new ComputedColumnInputDialog(structureOrHandle,applyAnalysis);
  if (dlg.open() == Window.OK) {
    updateComputedColumn(structureOrHandle);
  }
}
Program: 67143
Project: 67143
Buggy source:
/** 
 * @param structureOrHandle
 */
private ComputedColumnInputDialog(Object structureOrHandle){
  super(structureOrHandle);
  populateFunctions();
}

Fixed version (ground truth):
/** 
 * @param structureOrHandle
 */
private ComputedColumnInputDialog(Object structureOrHandle,boolean applyAnalysis){
  super(structureOrHandle);
  populateFunctions();
}
Program: 67144
Project: 67144
Buggy source:
public boolean next() throws DataException {
  if (this.streamsWrapper != null && currResultObj != null) {
    try {
      if (dataSetStream != null) {
        int colCount=this.currResultObj.getResultClass().getFieldCount();
        IOUtil.writeLong(dataSetLenStream,offset);
        offset+=ResultSetUtil.writeResultObject(new DataOutputStream(dataSetStream),currResultObj,colCount,resultSetNameSet,streamsWrapper.getOutputStringTable(this.currResultObj.getResultClass()),streamsWrapper.getStreamForIndex(this.currResultObj.getResultClass()),this.rowCount - 1);
      }
    }
 catch (    IOException e) {
      throw new DataException(e.getLocalizedMessage(),e);
    }
  }
  this.currResultObj=this.rowResultSet.next();
  if (this.currResultObj != null)   rowCount++;
  return this.currResultObj != null;
}

Fixed version (ground truth):
public boolean next() throws DataException {
  if (currResultObj == null)   return false;
  if (this.streamsWrapper != null && currResultObj != null) {
    try {
      if (dataSetStream != null) {
        int colCount=this.currResultObj.getResultClass().getFieldCount();
        IOUtil.writeLong(dataSetLenStream,offset);
        offset+=ResultSetUtil.writeResultObject(new DataOutputStream(dataSetStream),currResultObj,colCount,resultSetNameSet,streamsWrapper.getOutputStringTable(this.currResultObj.getResultClass()),streamsWrapper.getStreamForIndex(this.currResultObj.getResultClass()),this.rowCount - 1);
      }
    }
 catch (    IOException e) {
      throw new DataException(e.getLocalizedMessage(),e);
    }
  }
  try {
    this.currResultObj=this.rowResultSet.next();
  }
 catch (  DataException e) {
    this.currResultObj=null;
    throw e;
  }
  if (this.currResultObj != null)   rowCount++;
  return this.currResultObj != null;
}
Program: 67145
Project: 67145
Buggy source:
/** 
 * @param elm
 * @param src
 * @param scriptEvent
 * @param bDblClick
 * @param action
 */
private void addURLRedirectJSCode(Element elm,StructureSource src,String scriptEvent,boolean bDblClick,Action action){
  ActionValue av=action.getValue();
  if (av instanceof URLValue) {
    URLValue urlValue=(URLValue)av;
    setURLValueAttributes(urlValue,elm,src,scriptEvent,bDblClick);
  }
 else   if (av instanceof MultiURLValues) {
    MultiURLValues muv=(MultiURLValues)av;
    List<URLValue> validURLValues=MultiActionValuesScriptGenerator.getValidURLValues(muv);
    int size=validURLValues.size();
    if (size == 1) {
      setURLValueAttributes(validURLValues.get(0),elm,src,scriptEvent,bDblClick);
    }
 else     if (size > 1) {
      setMultiURLValuesAttributes(muv,elm,src,scriptEvent,bDblClick);
    }
    setTooltipForURLRedirect(elm,src,muv.getTooltip());
  }
}

Fixed version (ground truth):
/** 
 * @param elm
 * @param src
 * @param scriptEvent
 * @param bDblClick
 * @param action
 */
private void addURLRedirectJSCode(Element elm,StructureSource src,String scriptEvent,boolean bDblClick,Action action){
  ActionValue av=action.getValue();
  if (av instanceof URLValue) {
    URLValue urlValue=(URLValue)av;
    setURLValueAttributes(urlValue,elm,src,scriptEvent,bDblClick);
  }
 else   if (av instanceof MultiURLValues) {
    MultiURLValues muv=(MultiURLValues)av;
    setTooltipForURLRedirect(elm,src,muv.getTooltip());
    List<URLValue> validURLValues=MultiActionValuesScriptGenerator.getValidURLValues(muv);
    int size=validURLValues.size();
    if (size == 1) {
      setURLValueAttributes(validURLValues.get(0),elm,src,scriptEvent,bDblClick);
    }
 else     if (size > 1) {
      setMultiURLValuesAttributes(muv,elm,src,scriptEvent,bDblClick);
    }
  }
}
Program: 67146
Project: 67146
Buggy source:
/** 
 * Set SVG attributes for URL value.
 * @param urlValue
 * @param elm
 * @param src
 * @param scriptEvent
 * @param bDblClick
 */
private void setURLValueAttributes(URLValue urlValue,Element elm,StructureSource src,String scriptEvent,boolean bDblClick){
  String url="String_Node_Str";
  if (urlValue.getBaseUrl().startsWith("String_Node_Str")) {
    url="String_Node_Str" + urlValue.getBaseUrl() + "String_Node_Str";
  }
 else   if (urlValue.getBaseUrl().startsWith("String_Node_Str")) {
    url=urlValue.getBaseUrl();
  }
 else {
    String target=urlValue.getTarget();
    if (target == null)     target="String_Node_Str";
    String jsRedirect="String_Node_Str" + target + "String_Node_Str"+ urlValue.getBaseUrl()+ "String_Node_Str";
    url="String_Node_Str" + jsRedirect + "String_Node_Str"+ jsRedirect+ "String_Node_Str";
  }
  elm.setAttribute(scriptEvent,wrapJS(bDblClick,url));
  setTooltipForURLRedirect(elm,src,urlValue);
}

Fixed version (ground truth):
/** 
 * Set SVG attributes for URL value.
 * @param urlValue
 * @param elm
 * @param src
 * @param scriptEvent
 * @param bDblClick
 */
private void setURLValueAttributes(URLValue urlValue,Element elm,StructureSource src,String scriptEvent,boolean bDblClick){
  setTooltipForURLRedirect(elm,src,urlValue);
  String url="String_Node_Str";
  if (urlValue.getBaseUrl().startsWith("String_Node_Str")) {
    url="String_Node_Str" + urlValue.getBaseUrl() + "String_Node_Str";
  }
 else   if (urlValue.getBaseUrl().startsWith("String_Node_Str")) {
    url=urlValue.getBaseUrl();
  }
 else {
    String target=urlValue.getTarget();
    if (target == null)     target="String_Node_Str";
    String jsRedirect="String_Node_Str" + target + "String_Node_Str"+ urlValue.getBaseUrl()+ "String_Node_Str";
    url="String_Node_Str" + jsRedirect + "String_Node_Str"+ jsRedirect+ "String_Node_Str";
  }
  elm.setAttribute(scriptEvent,wrapJS(bDblClick,url));
}
Program: 67147
Project: 67147
Buggy source:
public String getText(){
  IForeignContent fc=(IForeignContent)content;
  String type=fc.getRawType();
  if (IForeignContent.TEMPLATE_TYPE.equals(type)) {
    Object[] rawValue=(Object[])fc.getRawValue();
    if (rawValue[0] != null) {
      return (String)rawValue[0];
    }
  }
 else   if (IForeignContent.HTML_TYPE.equals(type) || IForeignContent.TEXT_TYPE.equals(type)) {
    return (fc.getRawValue() == null ? null : fc.getRawValue().toString());
  }
  return null;
}

Fixed version (ground truth):
public String getText(){
  IForeignContent fc=(IForeignContent)content;
  String type=fc.getRawType();
  if (IForeignContent.TEMPLATE_TYPE.equals(type)) {
    String text=null;
    Object[] rawValue=(Object[])fc.getRawValue();
    if (rawValue[0] != null) {
      text=(String)rawValue[0];
    }
    if (text == null) {
      if (fc.getGenerateBy() instanceof TextItemDesign) {
        TextItemDesign design=(TextItemDesign)fc.getGenerateBy();
        text=design.getText();
      }
    }
    return text;
  }
 else   if (IForeignContent.HTML_TYPE.equals(type) || IForeignContent.TEXT_TYPE.equals(type)) {
    return (fc.getRawValue() == null ? null : fc.getRawValue().toString());
  }
  return null;
}
Program: 67149
Project: 67149
Buggy source:
protected boolean isSameInstance(InstanceID a,InstanceID b){
  if (a == b) {
    return true;
  }
  if (a != null && b != null) {
    if (a.getUniqueID() == b.getUniqueID()) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
protected boolean isSameInstance(InstanceID a,InstanceID b){
  if (a == b) {
    return true;
  }
  if (a != null && b != null) {
    if (a.getComponentID() == b.getComponentID() && a.getUniqueID() == b.getUniqueID()) {
      return true;
    }
  }
  return false;
}
Program: 67151
Project: 67151
Buggy source:
public boolean isIndexColumn(){
  if (this.columnHintHandle != null)   return columnHintHandle.isIndexColumn();
 else   return (Boolean)columnHint.getProperty(null,ColumnHint.INDEX_COLUMN_MEMBER);
}

Fixed version (ground truth):
public boolean isIndexColumn(){
  if (this.columnHintHandle != null) {
    return columnHintHandle.isIndexColumn();
  }
 else {
    if (columnHint.getProperty(null,ColumnHint.INDEX_COLUMN_MEMBER) instanceof Boolean) {
      return (Boolean)columnHint.getProperty(null,ColumnHint.INDEX_COLUMN_MEMBER);
    }
    return false;
  }
}
Program: 67153
Project: 67153
Buggy source:
public RDAggrUtil(StreamManager manager,IBaseQueryDefinition qd) throws DataException {
  this.qd=qd;
  try {
    RAInputStream aggrIndexStream=manager.getInStream(DataEngineContext.AGGR_INDEX_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
    int aggrSize=IOUtil.readInt(aggrIndexStream);
    DataInputStream aggrIndexDis=new DataInputStream(aggrIndexStream);
    DataInputStream valueStream=new DataInputStream(new WrapperedRAInputStream(manager.getInStream(DataEngineContext.AGGR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE),0,-1));
    for (int i=0; i < aggrSize; i++) {
      RDAggrValueHolder holder=new RDAggrValueHolder(valueStream);
      holders.put(holder.getName(),holder);
      if (i < aggrSize - 1) {
        long offset=IOUtil.readLong(aggrIndexDis);
        valueStream=new DataInputStream(new WrapperedRAInputStream(manager.getInStream(DataEngineContext.AGGR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE),offset,-1));
      }
    }
  }
 catch (  IOException e) {
    throw new DataException(e.getLocalizedMessage(),e);
  }
}

Fixed version (ground truth):
public RDAggrUtil(StreamManager manager,IBaseQueryDefinition qd) throws DataException {
  this.qd=qd;
  try {
    RAInputStream aggrIndexStream=manager.getInStream(DataEngineContext.AGGR_INDEX_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
    int aggrSize=IOUtil.readInt(aggrIndexStream);
    DataInputStream aggrIndexDis=new DataInputStream(aggrIndexStream);
    DataInputStream valueStream=new DataInputStream(new WrapperedRAInputStream(manager.getInStream(DataEngineContext.AGGR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE),0,-1));
    for (int i=0; i < aggrSize; i++) {
      RDAggrValueHolder holder=new RDAggrValueHolder(valueStream);
      holders.put(holder.getName(),holder);
      if (i < aggrSize - 1) {
        long offset=IOUtil.readLong(aggrIndexDis);
        if (manager.getVersion() >= VersionManager.VERSION_2_5_2_1) {
          valueStream=new DataInputStream(new WrapperedRAInputStream(manager.getInStream(DataEngineContext.AGGR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE),offset,-1));
        }
 else {
          valueStream=new DataInputStream(new WrapperedRAInputStream(manager.getInStream(DataEngineContext.AGGR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE),offset + 1,-1));
        }
      }
    }
  }
 catch (  IOException e) {
    throw new DataException(e.getLocalizedMessage(),e);
  }
}
Program: 67156
Project: 67156
Buggy source:
public RDAggrUtil(StreamManager manager,IBaseQueryDefinition qd) throws DataException {
  this.qd=qd;
  try {
    RAInputStream aggrIndexStream=manager.getInStream(DataEngineContext.AGGR_INDEX_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
    int aggrSize=IOUtil.readInt(aggrIndexStream);
    DataInputStream aggrIndexDis=new DataInputStream(aggrIndexStream);
    DataInputStream valueStream=new DataInputStream(new WrapperedRAInputStream(manager.getInStream(DataEngineContext.AGGR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE),0,-1));
    for (int i=0; i < aggrSize; i++) {
      RDAggrValueHolder holder=new RDAggrValueHolder(valueStream);
      holders.put(holder.getName(),holder);
      if (i < aggrSize - 1) {
        long offset=IOUtil.readLong(aggrIndexDis);
        valueStream=new DataInputStream(new WrapperedRAInputStream(manager.getInStream(DataEngineContext.AGGR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE),offset + 1,-1));
      }
    }
  }
 catch (  IOException e) {
    throw new DataException(e.getLocalizedMessage(),e);
  }
}

Fixed version (ground truth):
public RDAggrUtil(StreamManager manager,IBaseQueryDefinition qd) throws DataException {
  this.qd=qd;
  try {
    RAInputStream aggrIndexStream=manager.getInStream(DataEngineContext.AGGR_INDEX_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
    int aggrSize=IOUtil.readInt(aggrIndexStream);
    DataInputStream aggrIndexDis=new DataInputStream(aggrIndexStream);
    DataInputStream valueStream=new DataInputStream(new WrapperedRAInputStream(manager.getInStream(DataEngineContext.AGGR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE),0,-1));
    for (int i=0; i < aggrSize; i++) {
      RDAggrValueHolder holder=new RDAggrValueHolder(valueStream);
      holders.put(holder.getName(),holder);
      if (i < aggrSize - 1) {
        long offset=IOUtil.readLong(aggrIndexDis);
        valueStream=new DataInputStream(new WrapperedRAInputStream(manager.getInStream(DataEngineContext.AGGR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE),offset,-1));
      }
    }
  }
 catch (  IOException e) {
    throw new DataException(e.getLocalizedMessage(),e);
  }
}
Program: 67157
Project: 67157
Buggy source:
/** 
 * @param streamType
 * @param streamPos
 * @param streamScope
 * @return
 * @throws DataException
 */
public OutputStream getOutStream(int streamType,int streamPos,int streamScope) throws DataException {
  StreamID streamID=getStreamID(streamType,streamPos,streamScope);
  if (!useTempStream(streamType)) {
    RAOutputStream outputStream=context.getOutputStream(streamID.getStartStream(),streamID.getSubQueryStream(),streamType);
    if (streamType == DataEngineContext.DATASET_DATA_STREAM && this.version >= VersionManager.VERSION_2_2_0) {
      try {
        outputStream.seek(outputStream.length());
        outputStream.writeInt(0);
        outputStream.writeInt(0);
      }
 catch (      IOException e) {
        logger.log(Level.FINE,e.getMessage(),e);
      }
    }
    return outputStream;
  }
 else {
    int sType=DataEngineContext.META_STREAM;
    if (streamType == DataEngineContext.DATASET_DATA_STREAM || streamType == DataEngineContext.DATASET_META_STREAM)     sType=DataEngineContext.DATASET_DATA_STREAM;
    return this.getTempStreamManager(getStreamID(sType,streamPos,streamScope)).getOutputStream(streamType);
  }
}

Fixed version (ground truth):
/** 
 * @param streamType
 * @param streamPos
 * @param streamScope
 * @return
 * @throws DataException
 */
public OutputStream getOutStream(int streamType,int streamPos,int streamScope) throws DataException {
  StreamID streamID=getStreamID(streamType,streamPos,streamScope);
  if (!useTempStream(streamType)) {
    RAOutputStream outputStream=context.getOutputStream(streamID.getStartStream(),streamID.getSubQueryStream(),streamType);
    if (this.version >= VersionManager.VERSION_2_5_2_1)     return outputStream;
    if (streamType == DataEngineContext.DATASET_DATA_STREAM && this.version >= VersionManager.VERSION_2_2_0) {
      try {
        outputStream.seek(outputStream.length());
        outputStream.writeInt(0);
        outputStream.writeInt(0);
      }
 catch (      IOException e) {
        logger.log(Level.FINE,e.getMessage(),e);
      }
    }
    return outputStream;
  }
 else {
    int sType=DataEngineContext.META_STREAM;
    if (streamType == DataEngineContext.DATASET_DATA_STREAM || streamType == DataEngineContext.DATASET_META_STREAM)     sType=DataEngineContext.DATASET_DATA_STREAM;
    return this.getTempStreamManager(getStreamID(sType,streamPos,streamScope)).getOutputStream(streamType);
  }
}
Program: 67158
Project: 67158
Buggy source:
/** 
 * @param streamType
 * @return
 */
private boolean useTempStream(int streamType){
  if (this.version < VersionManager.VERSION_2_2)   return false;
switch (streamType) {
case DataEngineContext.DATASET_DATA_STREAM:
    return false;
case DataEngineContext.DATASET_META_STREAM:
  return !(this.version < VersionManager.VERSION_2_2_0);
case DataEngineContext.DATASET_DATA_LEN_STREAM:
return false;
case DataEngineContext.EXPR_VALUE_STREAM:
return false;
case DataEngineContext.EXPR_ROWLEN_STREAM:
return this.version < VersionManager.VERSION_2_2_0;
case DataEngineContext.EXPR_META_STREAM:
return true;
case DataEngineContext.GROUP_INFO_STREAM:
return true;
case DataEngineContext.SUBQUERY_INFO_STREAM:
return false;
case DataEngineContext.QUERY_DEFN_STREAM:
return true;
case DataEngineContext.ORIGINAL_QUERY_DEFN_STREAM:
return false;
case DataEngineContext.ROW_INDEX_STREAM:
return true;
case DataEngineContext.QUERYID_INFO_STREAM:
return true;
case DataEngineContext.SUBQUERY_PARENTINDEX_STREAM:
return true;
case DataEngineContext.PLS_GROUPLEVEL_STREAM:
return false;
case DataEngineContext.META_STREAM:
return false;
case DataEngineContext.META_INDEX_STREAM:
return false;
case DataEngineContext.AGGR_INDEX_STREAM:
return true;
case DataEngineContext.AGGR_VALUE_STREAM:
return true;
default :
return false;
}
}

Fixed version (ground truth):
/** 
 * @param streamType
 * @return
 */
private boolean useTempStream(int streamType){
  if (this.version < VersionManager.VERSION_2_2 || this.version >= VersionManager.VERSION_2_5_2_1)   return false;
switch (streamType) {
case DataEngineContext.DATASET_DATA_STREAM:
    return false;
case DataEngineContext.DATASET_META_STREAM:
  return !(this.version < VersionManager.VERSION_2_2_0);
case DataEngineContext.DATASET_DATA_LEN_STREAM:
return false;
case DataEngineContext.EXPR_VALUE_STREAM:
return false;
case DataEngineContext.EXPR_ROWLEN_STREAM:
return this.version < VersionManager.VERSION_2_2_0;
case DataEngineContext.EXPR_META_STREAM:
return true;
case DataEngineContext.GROUP_INFO_STREAM:
return true;
case DataEngineContext.SUBQUERY_INFO_STREAM:
return false;
case DataEngineContext.QUERY_DEFN_STREAM:
return true;
case DataEngineContext.ORIGINAL_QUERY_DEFN_STREAM:
return false;
case DataEngineContext.ROW_INDEX_STREAM:
return true;
case DataEngineContext.QUERYID_INFO_STREAM:
return true;
case DataEngineContext.SUBQUERY_PARENTINDEX_STREAM:
return true;
case DataEngineContext.PLS_GROUPLEVEL_STREAM:
return false;
case DataEngineContext.META_STREAM:
return false;
case DataEngineContext.META_INDEX_STREAM:
return false;
case DataEngineContext.AGGR_INDEX_STREAM:
return true;
case DataEngineContext.AGGR_VALUE_STREAM:
return true;
default :
return false;
}
}
Program: 67159
Project: 67159
Buggy source:
private RAInputStream createInputStream(StreamID streamID,int streamType) throws DataException {
  if (!useTempStream(streamType)) {
    RAInputStream stream=(RAInputStream)context.getInputStream(streamID.getStartStream(),streamID.getSubQueryStream(),streamType);
    if (streamType == DataEngineContext.DATASET_DATA_STREAM && this.version >= VersionManager.VERSION_2_2_0) {
      try {
        stream.readInt();
        int size=stream.readInt();
        stream.skip(size);
        stream.readInt();
        stream.readInt();
      }
 catch (      IOException e) {
        logger.log(Level.FINE,e.getMessage(),e);
      }
    }
    return stream;
  }
 else {
    return this.getMetaManager(streamID,streamType).getRAInputStream(streamType);
  }
}

Fixed version (ground truth):
private RAInputStream createInputStream(StreamID streamID,int streamType) throws DataException {
  if (!useTempStream(streamType)) {
    RAInputStream stream=(RAInputStream)context.getInputStream(streamID.getStartStream(),streamID.getSubQueryStream(),streamType);
    if (this.version >= VersionManager.VERSION_2_5_2_1) {
      return stream;
    }
    if (streamType == DataEngineContext.DATASET_DATA_STREAM && this.version >= VersionManager.VERSION_2_2_0) {
      try {
        stream.readInt();
        int size=stream.readInt();
        stream.skip(size);
        stream.readInt();
        stream.readInt();
      }
 catch (      IOException e) {
        logger.log(Level.FINE,e.getMessage(),e);
      }
    }
    return stream;
  }
 else {
    return this.getMetaManager(streamID,streamType).getRAInputStream(streamType);
  }
}
Program: 67160
Project: 67160
Buggy source:
/** 
 * @return
 */
public static int getLatestVersion(){
  return VERSION_2_5_2_0;
}

Fixed version (ground truth):
/** 
 * @return
 */
public static int getLatestVersion(){
  return VERSION_2_5_2_1;
}
Program: 67161
Project: 67161
Buggy source:
public static AggregationManager getAggregationManager() throws BirtException {
  if (manager == null) {
    DataRequestSession session=DataRequestSession.newSession(new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION));
    manager=session.getAggregationManager();
    session.shutdown();
  }
  return manager;
}

Fixed version (ground truth):
private static AggregationManager getAggregationManager() throws BirtException {
  if (manager == null) {
    DataRequestSession session=DataRequestSession.newSession(new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION));
    manager=session.getAggregationManager();
    session.shutdown();
  }
  return manager;
}
Program: 67162
Project: 67162
Buggy source:
@Override public void setExpressionType(String exprType){
  if (getExpressionType().equals(exprType)) {
    return;
  }
  super.setExpressionType(exprType);
  ComboProxy cp=ComboProxy.getInstance(control);
  if (cp != null) {
    String[] itemsOld=cp.getItems();
    String userExpr=cp.getText();
    cp.removeAll();
    for (    String oldItem : itemsOld) {
      IExpressionDescriptor desc=(IExpressionDescriptor)cp.getData(oldItem);
      addComboItem(cp,desc);
    }
    cp.setText(userExpr);
  }
}

Fixed version (ground truth):
@Override public void setExpressionType(String exprType){
  if (getExpressionType().equals(exprType)) {
    return;
  }
  super.setExpressionType(exprType);
  ComboProxy cp=ComboProxy.getInstance(control);
  if (cp != null) {
    String[] itemsOld=cp.getItems();
    String userExpr=cp.getText();
    cp.removeAll();
    for (    String oldItem : itemsOld) {
      IExpressionDescriptor desc=(IExpressionDescriptor)cp.getData(oldItem);
      if (desc != null) {
        addComboItem(cp,desc);
      }
 else {
        cp.add(oldItem);
      }
    }
    cp.setText(userExpr);
  }
}
Program: 67164
Project: 67164
Buggy source:
private Combo createExpressionValue(Composite parent){
  Combo expressionValue=new Combo(parent,SWT.None);
  expressionValue.addListener(SWT.Verify,expValueVerifyListener);
  expressionValue.addListener(SWT.Selection,expValueSelectionListener);
  Listener listener=new Listener(){
    public void handleEvent(    Event event){
      updateButtons();
    }
  }
;
  expressionValue.addListener(SWT.Modify,listener);
  IExpressionButton ceb=ChartExpressionButtonUtil.createExpressionButton(parent,expressionValue,(ExtendedItemHandle)designHandle,expressionProvider);
  ceb.addListener(listener);
  ceb.setPredefinedQuery(new String[]{CHOICE_SELECT_VALUE});
  return expressionValue;
}

Fixed version (ground truth):
private Combo createExpressionValue(Composite parent){
  Combo expressionValue=new Combo(parent,SWT.None);
  expressionValue.add(CHOICE_SELECT_VALUE);
  expressionValue.addListener(SWT.Verify,expValueVerifyListener);
  expressionValue.addListener(SWT.Selection,expValueSelectionListener);
  Listener listener=new Listener(){
    public void handleEvent(    Event event){
      updateButtons();
    }
  }
;
  expressionValue.addListener(SWT.Modify,listener);
  IExpressionButton ceb=ChartExpressionButtonUtil.createExpressionButton(parent,expressionValue,(ExtendedItemHandle)designHandle,expressionProvider);
  ceb.addListener(listener);
  return expressionValue;
}
Program: 67165
Project: 67165
Buggy source:
private int create2ValueComposite(Composite condition){
  if (expressionValue1 != null && !expressionValue1.isDisposed()) {
    return 0;
  }
  if (valueListComposite != null && !valueListComposite.isDisposed()) {
    valueListComposite.dispose();
    valueListComposite=null;
  }
  GridData expgd=new GridData();
  expgd.widthHint=100;
  expressionValue1=createExpressionValue(condition);
  expressionValue1.setLayoutData(expgd);
  dummy1=createDummy(condition,3);
  andLable=new Label(condition,SWT.NONE);
  andLable.setText(Messages.getString("String_Node_Str"));
  andLable.setEnabled(false);
  andLable.setVisible(false);
  dummy2=createDummy(condition,3);
  expressionValue2=createExpressionValue(condition);
  expressionValue2.setLayoutData(expgd);
  expressionValue2.setVisible(false);
  if (operator.getItemCount() > 0 && operator.getSelectionIndex() == -1) {
    operator.select(0);
  }
  condition.getParent().layout(true,true);
  return 1;
}

Fixed version (ground truth):
private int create2ValueComposite(Composite condition){
  if (expressionValue1 != null && !expressionValue1.isDisposed()) {
    return 0;
  }
  if (valueListComposite != null && !valueListComposite.isDisposed()) {
    valueListComposite.dispose();
    valueListComposite=null;
  }
  GridData expgd=new GridData();
  expgd.widthHint=100;
  expressionValue1=createExpressionValue(condition);
  expressionValue1.setLayoutData(expgd);
  dummy1=createDummy(condition,3);
  andLable=new Label(condition,SWT.NONE);
  andLable.setText(Messages.getString("String_Node_Str"));
  andLable.setEnabled(false);
  andLable.setVisible(false);
  dummy2=createDummy(condition,3);
  expressionValue2=createExpressionValue(condition);
  expressionValue2.setLayoutData(expgd);
  expressionValue2.setVisible(false);
  ExpressionButtonUtil.getExpressionButton(expressionValue2).getControl().setVisible(false);
  condition.getParent().layout(true,true);
  return 1;
}