nus-yam/ex-repair huggingface dataset:
Program: 67811
Project: 67811
Buggy source:
public void actionPerformed(ActionEvent e){
  int i=jcbModels.getSelectedIndex();
  cm=PrimitiveCharts.createChart(i);
  if (cm instanceof ChartWithAxes) {
    jcbTransposed.setEnabled(true);
    jcbLogarithmic.setEnabled(true);
    jcbPercent.setEnabled(true);
    ChartWithAxes cwa=((ChartWithAxes)cm);
    cwa.setTransposed(jcbTransposed.isSelected());
    Axis ax=cwa.getPrimaryOrthogonalAxis(cwa.getPrimaryBaseAxes()[0]);
    if (jcbLogarithmic.isSelected()) {
      if (ax.getType() == AxisType.LINEAR_LITERAL) {
        ax.setType(AxisType.LOGARITHMIC_LITERAL);
      }
    }
 else {
      if (ax.getType() == AxisType.LOGARITHMIC_LITERAL) {
        ax.setType(AxisType.LINEAR_LITERAL);
      }
    }
    if (jcbPercent.isSelected() == true) {
      ax.setFormatSpecifier(JavaNumberFormatSpecifierImpl.create("String_Node_Str"));
    }
 else {
      ax.setFormatSpecifier(null);
    }
  }
 else   if (cm instanceof ChartWithoutAxes) {
    jcbTransposed.setEnabled(false);
    jcbLogarithmic.setEnabled(false);
    jcbPercent.setEnabled(false);
  }
  if (jcbModels.getSelectedIndex() == 7) {
    cm.setDimension(ChartDimension.TWO_DIMENSIONAL_LITERAL);
  }
 else {
switch (jcbDimensions.getSelectedIndex()) {
case 0:
      cm.setDimension(ChartDimension.TWO_DIMENSIONAL_LITERAL);
    break;
case 1:
  cm.setDimension(ChartDimension.TWO_DIMENSIONAL_WITH_DEPTH_LITERAL);
break;
}
}
bNeedsGeneration=true;
scv.repaint();
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  int i=jcbModels.getSelectedIndex();
  cm=PrimitiveCharts.createChart(i);
  if (cm instanceof ChartWithAxes) {
    jcbTransposed.setEnabled(true);
    jcbLogarithmic.setEnabled(true);
    jcbPercent.setEnabled(true);
    ChartWithAxes cwa=((ChartWithAxes)cm);
    cwa.setTransposed(jcbTransposed.isSelected());
    Axis ax=cwa.getPrimaryOrthogonalAxis(cwa.getPrimaryBaseAxes()[0]);
    if (jcbLogarithmic.isSelected()) {
      if (ax.getType() == AxisType.LINEAR_LITERAL) {
        ax.setType(AxisType.LOGARITHMIC_LITERAL);
      }
    }
 else {
      if (ax.getType() == AxisType.LOGARITHMIC_LITERAL) {
        ax.setType(AxisType.LINEAR_LITERAL);
      }
    }
    if (jcbPercent.isSelected() == true) {
      ax.setFormatSpecifier(JavaNumberFormatSpecifierImpl.create("String_Node_Str"));
    }
 else {
      ax.setFormatSpecifier(null);
    }
  }
 else   if (cm instanceof ChartWithoutAxes) {
    jcbTransposed.setEnabled(false);
    jcbLogarithmic.setEnabled(false);
    jcbPercent.setEnabled(false);
  }
  if (jcbModels.getSelectedIndex() == 7 || jcbModels.getSelectedIndex() == 6 || jcbModels.getSelectedIndex() == 9) {
    cm.setDimension(ChartDimension.TWO_DIMENSIONAL_LITERAL);
  }
 else {
switch (jcbDimensions.getSelectedIndex()) {
case 0:
      cm.setDimension(ChartDimension.TWO_DIMENSIONAL_LITERAL);
    break;
case 1:
  cm.setDimension(ChartDimension.TWO_DIMENSIONAL_WITH_DEPTH_LITERAL);
break;
}
}
bNeedsGeneration=true;
scv.repaint();
}
Program: 67814
Project: 67814
Buggy source:
/** 
 * Converts Fill if possible. If Fill is MultipleFill type, convert to positive/negative Color according to the value. If not MultipleFill type, return original fill for positive value, or negative fill for negative value.
 * @param fill Fill to convert
 * @param dValue numeric value
 * @param fNegative Fill for negative value. Useless for positive value or MultipleFill
 */
public static Fill convertFill(Fill fill,double dValue,Fill fNegative){
  if (dValue >= 0) {
    if (fill instanceof MultipleFill) {
      fill=goFactory.copyOf((ColorDefinition)((MultipleFill)fill).getFills().get(0));
    }
  }
 else {
    if (fill instanceof MultipleFill) {
      fill=goFactory.copyOf((ColorDefinition)((MultipleFill)fill).getFills().get(1));
    }
 else     if (fNegative != null) {
      fill=fNegative;
    }
  }
  return fill;
}

Fixed version (ground truth):
/** 
 * Converts Fill if possible. If Fill is MultipleFill type, convert to positive/negative Color according to the value. If not MultipleFill type, return original fill for positive value, or negative fill for negative value.
 * @param fill Fill to convert
 * @param dValue numeric value
 * @param fNegative Fill for negative value. Useless for positive value or MultipleFill
 */
public static Fill convertFill(Fill fill,double dValue,Fill fNegative){
  if (dValue >= 0) {
    if (fill instanceof MultipleFill) {
      fill=goFactory.copyOf(((MultipleFill)fill).getFills().get(0));
    }
  }
 else {
    if (fill instanceof MultipleFill) {
      fill=goFactory.copyOf(((MultipleFill)fill).getFills().get(1));
    }
 else     if (fNegative != null) {
      fill=fNegative;
    }
  }
  return fill;
}
Program: 67815
Project: 67815
Buggy source:
public void widgetSelected(SelectionEvent e){
  if (e.getSource() instanceof Tree) {
    if (((TreeItem)e.item).getItemCount() != 0) {
      preview.renderModel(null);
      description.setText(icp.getDefaultDescription());
      ChartExamplesView.setActionsEnabled(false);
    }
 else {
      String sKey=hmItemToKey.get(e.item);
      setClassName(icp.getClassName(sKey));
      String methodName=icp.getMethodName(className);
      setChartModel(ImportChartModel.getChartModel(className,methodName));
      preview.renderModel(getChartModel());
      description.setText(icp.getDescription(className));
      ChartExamplesView.setActionsEnabled(true);
    }
  }
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  if (e.getSource() instanceof Tree) {
    if (((TreeItem)e.item).getItemCount() != 0) {
      preview.renderModel(null);
      description.setText(icp.getDefaultDescription());
      ChartExamplesView.setActionsEnabled(false);
    }
 else {
      String sKey=hmItemToKey.get(e.item);
      setClassName(icp.getClassName(sKey));
      String methodName=icp.getMethodName(className);
      setChartModel(ImportChartModel.getChartModel(className,methodName));
      preview.renderModel(getChartModel().copyInstance());
      description.setText(icp.getDescription(className));
      ChartExamplesView.setActionsEnabled(true);
    }
  }
}
Program: 67816
Project: 67816
Buggy source:
/** 
 * @param resultSet
 * @param levelNames
 * @return
 * @throws DataException
 */
private static IAggregationResultSet getMatchedResultSet(IAggregationResultSet[] resultSet,DimLevel[] levelNames) throws DataException {
  for (int i=0; i < resultSet.length; i++) {
    IAggregationResultSet rSet=resultSet[i];
    if (levelNames.length != rSet.getLevelCount())     continue;
    boolean match=true;
    for (int j=0; j < rSet.getLevelCount(); j++) {
      if (!levelNames[j].equals(rSet.getLevel(j))) {
        match=false;
        break;
      }
    }
    if (match) {
      if (!isEdgeResultSet(rSet))       return rSet;
    }
  }
  throw new DataException(ResourceConstants.INVALID_SORT_DEFN);
}

Fixed version (ground truth):
/** 
 * @param resultSet
 * @param levelNames
 * @return
 * @throws DataException
 */
private static IAggregationResultSet getMatchedResultSet(IAggregationResultSet[] resultSet,DimLevel[] levelNames,String aggregationName) throws DataException {
  for (int i=0; i < resultSet.length; i++) {
    IAggregationResultSet rSet=resultSet[i];
    if (levelNames.length != rSet.getLevelCount())     continue;
    boolean match=true;
    for (int j=0; j < rSet.getLevelCount(); j++) {
      if (!levelNames[j].equals(rSet.getLevel(j))) {
        match=false;
        break;
      }
    }
    if (match) {
      if (!isEdgeResultSet(rSet) && existAggregation(rSet.getAggregationDefinition(),aggregationName))       return rSet;
    }
  }
  throw new DataException(ResourceConstants.INVALID_SORT_DEFN);
}
Program: 67817
Project: 67817
Buggy source:
/** 
 * @param resultSet
 * @param level
 * @return
 * @throws DataException 
 */
private static int getBaseResultSetIndex(IAggregationResultSet[] resultSet,DimLevel level) throws DataException {
  for (int i=0; i < resultSet.length; i++) {
    if (isEdgeResultSet(resultSet[i]) && (resultSet[i].getLevelIndex(level) >= 0)) {
      return i;
    }
  }
  throw new DataException("String_Node_Str",level);
}

Fixed version (ground truth):
/** 
 * @param resultSet
 * @param aggregationName
 * @param level
 * @return
 * @throws DataException
 */
private static int getBaseResultSetIndex(IAggregationResultSet[] resultSet,String aggregationName,DimLevel level) throws DataException {
  for (int i=0; i < resultSet.length; i++) {
    if (isEdgeResultSet(resultSet[i]) && (resultSet[i].getLevelIndex(level) >= 0)) {
      return i;
    }
  }
  throw new DataException("String_Node_Str",level);
}
Program: 67818
Project: 67818
Buggy source:
private void initPageBuffer(PageContent pageContent){
  MasterPageDesign pageDesign=(MasterPageDesign)pageContent.getGenerateBy();
  if (pageDesign.getOnPageStart() != null || pageDesign.getOnPageEnd() != null) {
    bufferAllContents=true;
  }
 else {
    bufferAllContents=false;
  }
  this.contents.clear();
  this.pageContent=pageContent;
}

Fixed version (ground truth):
private void initPageBuffer(PageContent pageContent){
  MasterPageDesign pageDesign=(MasterPageDesign)pageContent.getGenerateBy();
  Report report=pageContent.getReportContent().getDesign();
  if (pageDesign.getOnPageStart() != null || pageDesign.getOnPageEnd() != null || report.getOnPageStart() != null || report.getOnPageEnd() != null) {
    bufferAllContents=true;
  }
 else {
    bufferAllContents=false;
  }
  this.contents.clear();
  this.pageContent=pageContent;
}
Program: 67819
Project: 67819
Buggy source:
private void initOptions(){
  ConfigurableOption wrappingText=initializeWrappingText();
  ConfigurableOption chartDpi=new ConfigurableOption(CHART_DPI);
  chartDpi.setDisplayName(getMessage("String_Node_Str"));
  chartDpi.setDataType(IConfigurableOption.DataType.INTEGER);
  chartDpi.setDisplayType(IConfigurableOption.DisplayType.TEXT);
  chartDpi.setDefaultValue(new Integer(192));
  chartDpi.setToolTip(null);
  chartDpi.setDescription(getMessage("String_Node_Str"));
  options=new IConfigurableOption[]{wrappingText,chartDpi};
}

Fixed version (ground truth):
private void initOptions(){
  ConfigurableOption wrappingText=initializeWrappingText();
  ConfigurableOption chartDpi=new ConfigurableOption(CHART_DPI);
  chartDpi.setDisplayName(getMessage("String_Node_Str"));
  chartDpi.setDataType(IConfigurableOption.DataType.INTEGER);
  chartDpi.setDisplayType(IConfigurableOption.DisplayType.TEXT);
  chartDpi.setDefaultValue(new Integer(192));
  chartDpi.setToolTip("String_Node_Str");
  chartDpi.setDescription(getMessage("String_Node_Str"));
  options=new IConfigurableOption[]{wrappingText,chartDpi};
}
Program: 67823
Project: 67823
Buggy source:
private void initOptions(){
  ConfigurableOption chartDpi=new ConfigurableOption(CHART_DPI);
  chartDpi.setDisplayName(getMessage("String_Node_Str"));
  chartDpi.setDataType(IConfigurableOption.DataType.INTEGER);
  chartDpi.setDisplayType(IConfigurableOption.DisplayType.TEXT);
  chartDpi.setDefaultValue(new Integer(192));
  chartDpi.setToolTip(null);
  chartDpi.setDescription(getMessage("String_Node_Str"));
  options=new IConfigurableOption[]{chartDpi};
}

Fixed version (ground truth):
private void initOptions(){
  ConfigurableOption chartDpi=new ConfigurableOption(CHART_DPI);
  chartDpi.setDisplayName(getMessage("String_Node_Str"));
  chartDpi.setDataType(IConfigurableOption.DataType.INTEGER);
  chartDpi.setDisplayType(IConfigurableOption.DisplayType.TEXT);
  chartDpi.setDefaultValue(new Integer(192));
  chartDpi.setToolTip("String_Node_Str");
  chartDpi.setDescription(getMessage("String_Node_Str"));
  options=new IConfigurableOption[]{chartDpi};
}
Program: 67824
Project: 67824
Buggy source:
protected void okPressed(){
  super.okPressed();
  try {
    DataSetUIUtil.updateColumnCache(this.getHandle());
  }
 catch (  Exception e) {
    ExceptionHandler.handle(e);
  }
  if (super.rootNode.hasSubNodes()) {
    PropertyNode[] nodes=rootNode.getSubNodes();
    for (int n=0; n < nodes.length; n++) {
      if (nodes[n].getPage() instanceof DataSetParametersPage) {
        if (viewer == null && viewer.getTree() == null)         return;
        DataSetParametersPage page=(DataSetParametersPage)nodes[n].getPage();
        if (!page.canFinish() && !viewer.getTree().isDisposed()) {
          TreeItem firstNode=viewer.getTree().getItems()[n];
          StructuredSelection select=new StructuredSelection(firstNode.getData());
          viewer.setSelection(select);
          String name=((DataSetParametersPage)nodes[n].getPage()).getNoneValuedParameterName();
          this.setMessage(Messages.getFormattedString("String_Node_Str",new Object[]{name}),IMessageProvider.ERROR);
          return;
        }
      }
    }
  }
}

Fixed version (ground truth):
protected void okPressed(){
  super.okPressed();
  try {
    DataSetUIUtil.updateColumnCache(this.getHandle(),false);
  }
 catch (  Exception e) {
    ExceptionHandler.handle(e);
    return;
  }
  if (super.rootNode.hasSubNodes()) {
    PropertyNode[] nodes=rootNode.getSubNodes();
    for (int n=0; n < nodes.length; n++) {
      if (nodes[n].getPage() instanceof DataSetParametersPage) {
        if (viewer == null && viewer.getTree() == null)         return;
        DataSetParametersPage page=(DataSetParametersPage)nodes[n].getPage();
        if (!page.canFinish() && !viewer.getTree().isDisposed()) {
          TreeItem firstNode=viewer.getTree().getItems()[n];
          StructuredSelection select=new StructuredSelection(firstNode.getData());
          viewer.setSelection(select);
          String name=((DataSetParametersPage)nodes[n].getPage()).getNoneValuedParameterName();
          this.setMessage(Messages.getFormattedString("String_Node_Str",new Object[]{name}),IMessageProvider.ERROR);
          return;
        }
      }
    }
  }
}
Program: 67825
Project: 67825
Buggy source:
public boolean performFinish(){
  if (!canFinish())   return false;
  if (useTransaction) {
    Utility.getCommandStack().startTrans(CREATE_DATA_SET_TRANS_NAME);
  }
  dataSetHandle=dataSetPage.createSelectedDataSet();
  if (dataSetHandle != null) {
    if (dataSetHandle instanceof ScriptDataSetHandle) {
      columnDefPage.saveResult(dataSetHandle);
    }
    if (useTransaction) {
      Utility.getCommandStack().commit();
    }
    try {
      createSelectedDataSetTearDown(dataSetHandle);
      DataSetUIUtil.updateColumnCache(dataSetHandle);
    }
 catch (    Exception e) {
      if (e instanceof SWTException) {
        SWTException swtException=(SWTException)e;
        if (swtException.code == SWT.ERROR_WIDGET_DISPOSED)         Utility.log(e);
      }
      ExceptionHandler.handle(e);
    }
  }
 else {
    if (useTransaction) {
      Utility.getCommandStack().rollback();
    }
    return false;
  }
  return true;
}

Fixed version (ground truth):
public boolean performFinish(){
  if (!canFinish())   return false;
  if (useTransaction) {
    Utility.getCommandStack().startTrans(CREATE_DATA_SET_TRANS_NAME);
  }
  dataSetHandle=dataSetPage.createSelectedDataSet();
  if (dataSetHandle != null) {
    if (dataSetHandle instanceof ScriptDataSetHandle) {
      columnDefPage.saveResult(dataSetHandle);
    }
    if (useTransaction) {
      Utility.getCommandStack().commit();
    }
    try {
      createSelectedDataSetTearDown(dataSetHandle);
      DataSetUIUtil.updateColumnCache(dataSetHandle,false);
    }
 catch (    Exception e) {
      if (e instanceof SWTException) {
        SWTException swtException=(SWTException)e;
        if (swtException.code == SWT.ERROR_WIDGET_DISPOSED)         Utility.log(e);
      }
      ExceptionHandler.handle(e);
    }
  }
 else {
    if (useTransaction) {
      Utility.getCommandStack().rollback();
    }
    return false;
  }
  return true;
}
Program: 67827
Project: 67827
Buggy source:
public boolean performFinish(){
  if (!canFinish())   return false;
  if (dataSetPage != null && dataSetPage instanceof JointDataSetPage) {
    if (useTransaction) {
      Utility.getCommandStack().startTrans(CREATE_DATA_SET_TRANS_NAME);
    }
    DataSetHandle joinDataSetHandle=((JointDataSetPage)dataSetPage).createSelectedDataSet();
    try {
      if (joinDataSetHandle != null)       DataSetUIUtil.updateColumnCache(joinDataSetHandle);
    }
 catch (    SemanticException e) {
      ExceptionHandler.handle(e);
    }
    if (useTransaction) {
      Utility.getCommandStack().commit();
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean performFinish(){
  if (!canFinish())   return false;
  if (dataSetPage != null && dataSetPage instanceof JointDataSetPage) {
    if (useTransaction) {
      Utility.getCommandStack().startTrans(CREATE_DATA_SET_TRANS_NAME);
    }
    DataSetHandle joinDataSetHandle=((JointDataSetPage)dataSetPage).createSelectedDataSet();
    try {
      if (joinDataSetHandle != null)       DataSetUIUtil.updateColumnCache(joinDataSetHandle,false);
    }
 catch (    Exception e) {
      ExceptionHandler.handle(e);
    }
    if (useTransaction) {
      Utility.getCommandStack().commit();
    }
  }
  return true;
}
Program: 67828
Project: 67828
Buggy source:
/** 
 * Add this method according to GUI's requirement.This method is only for temporarily usage.
 * @param dataSetHandle
 * @return
 * @throws SemanticException
 * @deprecated
 */
public static CachedMetaDataHandle getCachedMetaDataHandle(DataSetHandle dataSetHandle) throws SemanticException {
  if (!hasMetaData(dataSetHandle)) {
    updateColumnCache(dataSetHandle,true);
  }
  return dataSetHandle.getCachedMetaDataHandle();
}

Fixed version (ground truth):
/** 
 * Add this method according to GUI's requirement.This method is only for temporarily usage.
 * @param dataSetHandle
 * @return
 * @throws SemanticException
 * @deprecated
 */
public static CachedMetaDataHandle getCachedMetaDataHandle(DataSetHandle dataSetHandle) throws SemanticException {
  if (!hasMetaData(dataSetHandle)) {
    try {
      updateColumnCache(dataSetHandle,true);
    }
 catch (    BirtException e) {
      logger.entering(DataSetUIUtil.class.getName(),"String_Node_Str",new Object[]{e});
    }
  }
  return dataSetHandle.getCachedMetaDataHandle();
}
Program: 67829
Project: 67829
Buggy source:
/** 
 * Save the column meta data to data set handle.
 * @param dataSetHandle
 * @param holdEvent
 */
public static void updateColumnCache(DataSetHandle dataSetHandle,boolean holdEvent){
  try {
    DataService.getInstance().updateColumnCache(dataSetHandle,holdEvent);
  }
 catch (  BirtException ex) {
    logger.entering(DataSetUIUtil.class.getName(),"String_Node_Str",new Object[]{ex});
  }
}

Fixed version (ground truth):
/** 
 * Save the column meta data to data set handle.
 * @param dataSetHandle
 * @param holdEvent
 * @throws BirtException
 */
public static void updateColumnCache(DataSetHandle dataSetHandle,boolean holdEvent) throws BirtException {
  DataService.getInstance().updateColumnCache(dataSetHandle,holdEvent);
}
Program: 67830
Project: 67830
Buggy source:
private Vector<OrthogonalSampleData> getConvertedOrthogonalSampleDataRepresentation(EList<OrthogonalSampleData> osdList,List<AxisType> axisTypes){
  Vector<OrthogonalSampleData> vNewOrthogonalSampleData=new Vector<OrthogonalSampleData>();
  for (int i=0; i < osdList.size(); i++) {
    OrthogonalSampleData osd=osdList.get(i);
    osd.setDataSetRepresentation(ChartUIUtil.getConvertedSampleDataRepresentation(axisTypes.get(i),osd.getDataSetRepresentation(),i));
    vNewOrthogonalSampleData.add(osd);
  }
  return vNewOrthogonalSampleData;
}

Fixed version (ground truth):
private Vector<OrthogonalSampleData> getConvertedOrthogonalSampleDataRepresentation(EList<OrthogonalSampleData> osdList,List<AxisType> axisTypes){
  Vector<OrthogonalSampleData> vNewOrthogonalSampleData=new Vector<OrthogonalSampleData>();
  for (int i=0; i < axisTypes.size(); i++) {
    OrthogonalSampleData osd=osdList.get(i);
    osd.setDataSetRepresentation(ChartUIUtil.getConvertedSampleDataRepresentation(axisTypes.get(i),osd.getDataSetRepresentation(),i));
    vNewOrthogonalSampleData.add(osd);
  }
  return vNewOrthogonalSampleData;
}
Program: 67831
Project: 67831
Buggy source:
public static String getResultSetId(ReportContent report,InstanceID instanceID){
  Report design=report.getDesign();
  ArrayList<QueryTask> plan=createPlan(design,instanceID);
  StringBuilder sb=new StringBuilder();
  ExecutionContext executionContext=report.getExecutionContext();
  try {
    for (int current=plan.size() - 1; current >= 0; current--) {
      QueryTask task=plan.get(current);
      IDataQueryDefinition query=task.getQuery();
      if (task.getParent() == null) {
        String rset=getResultSetID(executionContext,null,"String_Node_Str",query);
        if (rset == null)         return null;
        sb.append(rset);
      }
 else {
        if (sb.length() == 0) {
          throw new EngineException(MessageConstants.INVALID_INSTANCE_ID_ERROR,instanceID);
        }
        long rowid=task.getRowID();
        if (query instanceof ISubqueryDefinition) {
          String queryName=query.getName();
          sb.insert(0,"String_Node_Str");
          sb.append("String_Node_Str").append(rowid).append("String_Node_Str").append(queryName);
        }
 else {
          String rset=getResultSetID(executionContext,sb.toString(),String.valueOf(rowid),query);
          sb.setLength(0);
          if (rset != null) {
            sb.append(rset);
          }
 else {
          }
        }
      }
    }
  }
 catch (  EngineException ex) {
    executionContext.addException(ex);
  }
  return sb.toString();
}

Fixed version (ground truth):
public static String getResultSetId(ReportContent report,InstanceID instanceID){
  Report design=report.getDesign();
  ArrayList<QueryTask> plan=createPlan(design,instanceID);
  StringBuilder sb=new StringBuilder();
  ExecutionContext executionContext=report.getExecutionContext();
  try {
    for (int current=plan.size() - 1; current >= 0; current--) {
      QueryTask task=plan.get(current);
      IDataQueryDefinition query=task.getQuery();
      if (task.getParent() == null) {
        String rset=getResultSetID(executionContext,null,"String_Node_Str",query);
        if (rset == null)         return null;
        sb.append(rset);
      }
 else {
        if (sb.length() == 0) {
          throw new EngineException(MessageConstants.INVALID_INSTANCE_ID_ERROR,instanceID);
        }
        long rowid=task.getRowID();
        if (query instanceof ISubqueryDefinition) {
          String queryName=query.getName();
          sb.insert(0,"String_Node_Str");
          sb.append("String_Node_Str").append(rowid).append("String_Node_Str").append(queryName);
        }
 else {
          String id=task.getCellID();
          if (id == null) {
            id=String.valueOf(rowid);
          }
          String rset=getResultSetID(executionContext,sb.toString(),id,query);
          sb.setLength(0);
          if (rset != null) {
            sb.append(rset);
          }
 else {
          }
        }
      }
    }
  }
 catch (  EngineException ex) {
    executionContext.addException(ex);
  }
  return sb.toString();
}
Program: 67833
Project: 67833
Buggy source:
private FontSplitter getFontSplitter(IContent content){
  FontMappingManager fontManager=FontMappingManagerFactory.getInstance().getFontMappingManager("String_Node_Str",Locale.getDefault());
  String text=((TextContent)content).getText();
  FontSplitter fontSplitter=new FontSplitter(fontManager,new Chunk(text),(TextContent)content,true);
  return fontSplitter;
}

Fixed version (ground truth):
private FontSplitter getFontSplitter(IContent content,String text){
  FontMappingManager fontManager=FontMappingManagerFactory.getInstance().getFontMappingManager("String_Node_Str",Locale.getDefault());
  FontSplitter fontSplitter=new FontSplitter(fontManager,new Chunk(text),(TextContent)content,true);
  return fontSplitter;
}
Program: 67834
Project: 67834
Buggy source:
void writeContent(int type,String txt,IStyle style,IStyle inlineStyle,String fontFamily,HyperlinkInfo info,InlineFlag inlineFlag,TextFlag flag,int paragraphWidth);

Fixed version (ground truth):
void writeContent(int type,String txt,IStyle style,IStyle inlineStyle,String fontFamily,HyperlinkInfo info,InlineFlag inlineFlag,TextFlag flag,int paragraphWidth,boolean runIsRtl);
Program: 67835
Project: 67835
Buggy source:
public void writeText(int type,String txt,IStyle style,String fontFamily,HyperlinkInfo info,TextFlag flag,int paragraphWidth){
  if (flag == TextFlag.START) {
    writeTextInParagraph(type,txt,style,fontFamily,info,paragraphWidth);
  }
 else   if (flag == TextFlag.END) {
    writer.closeTag("String_Node_Str");
  }
 else   if (flag == TextFlag.MIDDLE) {
    writeTextInRun(type,txt,style,fontFamily,info,false,paragraphWidth);
  }
 else {
    writeTextInParagraph(type,txt,style,fontFamily,info,paragraphWidth);
    writer.closeTag("String_Node_Str");
  }
}

Fixed version (ground truth):
public void writeText(int type,String txt,IStyle style,String fontFamily,HyperlinkInfo info,TextFlag flag,int paragraphWidth,boolean runIsRtl){
  if (flag == TextFlag.START) {
    writeTextInParagraph(type,txt,style,fontFamily,info,paragraphWidth,runIsRtl);
  }
 else   if (flag == TextFlag.END) {
    writer.closeTag("String_Node_Str");
  }
 else   if (flag == TextFlag.MIDDLE) {
    writeTextInRun(type,txt,style,fontFamily,info,false,paragraphWidth,runIsRtl);
  }
 else {
    writeTextInParagraph(type,txt,style,fontFamily,info,paragraphWidth,runIsRtl);
    writer.closeTag("String_Node_Str");
  }
}
Program: 67836
Project: 67836
Buggy source:
public void writeTextInRun(int type,String txt,IStyle style,String fontFamily,HyperlinkInfo info,boolean isInline,int paragraphWidth){
}

Fixed version (ground truth):
public void writeTextInRun(int type,String txt,IStyle style,String fontFamily,HyperlinkInfo info,boolean isInline,int paragraphWidth,boolean runIsRtl){
  if ("String_Node_Str".equals(txt)) {
    return;
  }
  if (needNewParagraph(txt)) {
    writer.closeTag("String_Node_Str");
    startParagraph(style,isInline,paragraphWidth);
    return;
  }
  openHyperlink(info);
  boolean isField=WordUtil.isField(type);
  String direction=style.getDirection();
  if (isField) {
    writeField(true);
  }
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writeRunProperties(style,fontFamily,info);
  if (isInline) {
    writeAlign(style.getTextAlign(),direction);
    writeBackgroundColor(style.getBackgroundColor());
    writePosition(style.getVerticalAlign(),style.getProperty(StyleConstants.STYLE_FONT_SIZE));
    writeRunBorders(style);
  }
  if (!isField && runIsRtl) {
    writer.openTag("String_Node_Str");
    writer.closeTag("String_Node_Str");
  }
  writer.closeTag("String_Node_Str");
  if (isField) {
    writeAutoText(type);
  }
 else {
    writeString(txt,style);
  }
  writer.closeTag("String_Node_Str");
  if (isField) {
    writeField(false);
  }
  closeHyperlink(info);
}
Program: 67837
Project: 67837
Buggy source:
/** 
 * @param direction
 * @author bidi_hcg
 */
protected void writeBidi(boolean rtl){
  if (rtl) {
    writer.openTag("String_Node_Str");
    writer.closeTag("String_Node_Str");
  }
 else {
    writeAttrTag("String_Node_Str","String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * @param direction
 * @author bidi_hcg
 */
protected void writeBidi(boolean rtl){
  writeAttrTag("String_Node_Str",rtl ? "String_Node_Str" : "String_Node_Str");
}
Program: 67838
Project: 67838
Buggy source:
private void writeTextInParagraph(int type,String txt,IStyle style,String fontFamily,HyperlinkInfo info,int paragraphWidth){
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  CSSValue lineHeight=style.getProperty(StyleConstants.STYLE_LINE_HEIGHT);
  if (!"String_Node_Str".equalsIgnoreCase(lineHeight.getCssText())) {
    writeSpacing(lineHeight);
  }
  writeAlign(style.getTextAlign(),style.getDirection());
  writeBackgroundColor(style.getBackgroundColor());
  writeParagraphBorders(style);
  int indent=PropertyUtil.getDimensionValue(style.getProperty(StyleConstants.STYLE_TEXT_INDENT),paragraphWidth * 1000) / 1000 * 20;
  if (indent != 0) {
    writeIndent(indent);
  }
  writer.closeTag("String_Node_Str");
  writeTextInRun(type,txt,style,fontFamily,info,false,paragraphWidth);
}

Fixed version (ground truth):
private void writeTextInParagraph(int type,String txt,IStyle style,String fontFamily,HyperlinkInfo info,int paragraphWidth,boolean runIsRtl){
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  CSSValue lineHeight=style.getProperty(StyleConstants.STYLE_LINE_HEIGHT);
  if (!"String_Node_Str".equalsIgnoreCase(lineHeight.getCssText())) {
    writeSpacing(lineHeight);
  }
  writeAlign(style.getTextAlign(),style.getDirection());
  writeBackgroundColor(style.getBackgroundColor());
  writeParagraphBorders(style);
  int indent=PropertyUtil.getDimensionValue(style.getProperty(StyleConstants.STYLE_TEXT_INDENT),paragraphWidth * 1000) / 1000 * 20;
  if (indent != 0) {
    writeIndent(indent);
  }
  writeBidi(CSSConstants.CSS_RTL_VALUE.equals(style.getDirection()));
  writer.closeTag("String_Node_Str");
  writeTextInRun(type,txt,style,fontFamily,info,false,paragraphWidth,runIsRtl);
}
Program: 67839
Project: 67839
Buggy source:
public void writeContent(int type,String txt,IStyle style,IStyle inlineStyle,String fontFamily,HyperlinkInfo info,InlineFlag inlineFlag,TextFlag flag,int paragraphWidth){
  if (inlineFlag == InlineFlag.BLOCK) {
    writeText(type,txt,style,fontFamily,info,flag,paragraphWidth);
  }
 else {
    boolean isInline=true;
    if (inlineFlag == InlineFlag.FIRST_INLINE && flag == TextFlag.START) {
      startParagraph(style,isInline,paragraphWidth);
    }
    if (inlineStyle != null)     writeTextInRun(type,txt,inlineStyle,fontFamily,info,isInline,paragraphWidth);
 else     writeTextInRun(type,txt,style,fontFamily,info,isInline,paragraphWidth);
  }
}

Fixed version (ground truth):
public void writeContent(int type,String txt,IStyle style,IStyle inlineStyle,String fontFamily,HyperlinkInfo info,InlineFlag inlineFlag,TextFlag flag,int paragraphWidth,boolean runIsRtl){
  if (inlineFlag == InlineFlag.BLOCK) {
    writeText(type,txt,style,fontFamily,info,flag,paragraphWidth,runIsRtl);
  }
 else {
    boolean isInline=true;
    if (inlineFlag == InlineFlag.FIRST_INLINE && flag == TextFlag.START) {
      startParagraph(style,isInline,paragraphWidth);
    }
    if (inlineStyle != null)     writeTextInRun(type,txt,inlineStyle,fontFamily,info,isInline,paragraphWidth,runIsRtl);
 else     writeTextInRun(type,txt,style,fontFamily,info,isInline,paragraphWidth,runIsRtl);
  }
}
Program: 67840
Project: 67840
Buggy source:
public BarAxisIdLookup(ChartWithAxes cwa,Axis curAxis){
  Axis[] axs=cwa.getOrthogonalAxes(cwa.getBaseAxes()[0],true);
  int count=0, id=0;
  for (  Axis axis : axs) {
    if (axis.isSideBySide()) {
      SeriesDefinition sd=axis.getSeriesDefinitions().get(0);
      if (sd.getDesignTimeSeries() instanceof BarSeries) {
        if (curAxis == axis) {
          id=count;
        }
        count++;
      }
    }
  }
  if (count > 1 && curAxis.isSideBySide()) {
    barAxisId=id;
    barAxisCount=count;
  }
 else {
    barAxisId=0;
    barAxisCount=1;
  }
}

Fixed version (ground truth):
public BarAxisIdLookup(ChartWithAxes cwa,Axis curAxis){
  Axis[] axs=cwa.getOrthogonalAxes(cwa.getBaseAxes()[0],true);
  int count=0, id=0;
  for (  Axis axis : axs) {
    if (axis.isSideBySide() && axis.getSeriesDefinitions().size() > 0) {
      SeriesDefinition sd=axis.getSeriesDefinitions().get(0);
      if (sd.getDesignTimeSeries() instanceof BarSeries) {
        if (curAxis == axis) {
          id=count;
        }
        count++;
      }
    }
  }
  if (count > 1 && curAxis.isSideBySide()) {
    barAxisId=id;
    barAxisCount=count;
  }
 else {
    barAxisId=0;
    barAxisCount=1;
  }
}
Program: 67841
Project: 67841
Buggy source:
/** 
 * @throws IOException
 */
public void close() throws IOException {
  diskIndex.close();
}

Fixed version (ground truth):
/** 
 * @throws IOException
 */
public void close() throws IOException {
  if (diskIndex != null)   diskIndex.close();
}
Program: 67842
Project: 67842
Buggy source:
public boolean onBroughtToTop(IReportEditorPage prePage){
  if (getEditorInput() != prePage.getEditorInput()) {
    setInput(prePage.getEditorInput());
  }
  if (isDirtyModel()) {
    doSave(null);
  }
  if (prePage.isDirty()) {
    prePage.doSave(null);
  }
  boolean ret=refresh();
  if (ret == false && isMissingParameter()) {
    editor.setActivePage(prePage.getId());
  }
  return ret;
}

Fixed version (ground truth):
public boolean onBroughtToTop(IReportEditorPage prePage){
  if (getEditorInput() != prePage.getEditorInput()) {
    setInput(prePage.getEditorInput());
  }
  boolean bool=true;
  if (isDirtyModel()) {
    doSave(null);
    bool=false;
  }
  if (prePage.isDirty() && bool) {
    prePage.doSave(null);
  }
  boolean ret=refresh();
  if (ret == false && isMissingParameter()) {
    editor.setActivePage(prePage.getId());
  }
  return ret;
}
Program: 67843
Project: 67843
Buggy source:
public GroupSortingDialog(Shell shell,ChartWizardContext wizardContext,SeriesDefinition sd,boolean disableAggregation){
  super(shell);
  this.wizardContext=wizardContext;
  this.sd=sd;
  this.fEnableAggregation=disableAggregation;
}

Fixed version (ground truth):
public GroupSortingDialog(Shell shell,ChartWizardContext wizardContext,SeriesDefinition sd,boolean disableAggregation){
  super(shell);
  setShellStyle(SWT.CLOSE | SWT.TITLE | SWT.RESIZE);
  this.wizardContext=wizardContext;
  this.sd=sd;
  this.fEnableAggregation=disableAggregation;
}
Program: 67845
Project: 67845
Buggy source:
/** 
 * Get the connection with SWING device to render the graphics.
 */
SwingHighlightViewer(){
  contextMap=new HashMap();
  final PluginSettings ps=PluginSettings.instance();
  try {
    idr=ps.getDevice("String_Node_Str");
  }
 catch (  ChartException ex) {
    ex.printStackTrace();
  }
  cm=PrimitiveCharts.highlight_AreaChart();
}

Fixed version (ground truth):
/** 
 * Get the connection with SWING device to render the graphics.
 */
SwingHighlightViewer(){
  contextMap=new HashMap();
  PlatformConfig config=new PlatformConfig();
  config.setProperty(PluginSettings.PROP_STANDALONE,"String_Node_Str");
  final PluginSettings ps=PluginSettings.instance();
  try {
    idr=ps.getDevice("String_Node_Str");
  }
 catch (  ChartException ex) {
    ex.printStackTrace();
  }
  cm=PrimitiveCharts.highlight_AreaChart();
}
Program: 67846
Project: 67846
Buggy source:
public void paint(Graphics g){
  super.paint(g);
  if (bi == null) {
    updateBuffer();
  }
  g.drawImage(bi,0,0,this);
}

Fixed version (ground truth):
@Override public void paint(Graphics g){
  super.paint(g);
  if (bi == null) {
    updateBuffer();
  }
  g.drawImage(bi,0,0,this);
}
Program: 67847
Project: 67847
Buggy source:
/** 
 * Contructs the layout with a container for displaying chart and a control panel for selecting interactivity.
 * @param args
 */
public static void main(String[] args){
  final SwingHighlightViewer siv=new SwingHighlightViewer();
  JFrame jf=new JFrame();
  jf.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  jf.addComponentListener(siv);
  Container co=jf.getContentPane();
  co.setLayout(new BorderLayout());
  co.add(siv,BorderLayout.CENTER);
  Dimension dScreen=Toolkit.getDefaultToolkit().getScreenSize();
  Dimension dApp=new Dimension(600,400);
  jf.setSize(dApp);
  jf.setLocation((dScreen.width - dApp.width) / 2,(dScreen.height - dApp.height) / 2);
  jf.setTitle(siv.getClass().getName() + "String_Node_Str" + siv.idr.getClass().getName()+ "String_Node_Str");
  ControlPanel cp=siv.new ControlPanel(siv);
  co.add(cp,BorderLayout.SOUTH);
  siv.idr.setProperty(IDeviceRenderer.UPDATE_NOTIFIER,siv);
  jf.addWindowListener(new WindowAdapter(){
    public void windowClosing(    WindowEvent e){
      siv.idr.dispose();
    }
  }
);
  jf.setVisible(true);
}

Fixed version (ground truth):
/** 
 * Contructs the layout with a container for displaying chart and a control panel for selecting interactivity.
 * @param args
 */
public static void main(String[] args){
  final SwingHighlightViewer siv=new SwingHighlightViewer();
  JFrame jf=new JFrame();
  jf.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  jf.addComponentListener(siv);
  Container co=jf.getContentPane();
  co.setLayout(new BorderLayout());
  co.add(siv,BorderLayout.CENTER);
  Dimension dScreen=Toolkit.getDefaultToolkit().getScreenSize();
  Dimension dApp=new Dimension(600,400);
  jf.setSize(dApp);
  jf.setLocation((dScreen.width - dApp.width) / 2,(dScreen.height - dApp.height) / 2);
  jf.setTitle(siv.getClass().getName() + "String_Node_Str" + siv.idr.getClass().getName()+ "String_Node_Str");
  ControlPanel cp=siv.new ControlPanel(siv);
  co.add(cp,BorderLayout.SOUTH);
  siv.idr.setProperty(IDeviceRenderer.UPDATE_NOTIFIER,siv);
  jf.addWindowListener(new WindowAdapter(){
    @Override public void windowClosing(    WindowEvent e){
      siv.idr.dispose();
    }
  }
);
  jf.setVisible(true);
}
Program: 67848
Project: 67848
Buggy source:
public void repaintChart(){
  repaint();
}

Fixed version (ground truth):
public void repaintChart(){
  updateBuffer();
  repaint();
}
Program: 67849
Project: 67849
Buggy source:
public void windowClosing(WindowEvent e){
  siv.idr.dispose();
}

Fixed version (ground truth):
@Override public void windowClosing(WindowEvent e){
  siv.idr.dispose();
}
Program: 67850
Project: 67850
Buggy source:
public void paint(Graphics g){
  super.paint(g);
  if (bi == null) {
    updateBuffer();
  }
  g.drawImage(bi,0,0,this);
}

Fixed version (ground truth):
@Override public void paint(Graphics g){
  super.paint(g);
  if (bi == null) {
    updateBuffer();
  }
  g.drawImage(bi,0,0,this);
}
Program: 67851
Project: 67851
Buggy source:
/** 
 * Contructs the layout with a container for displaying chart and a control panel for selecting interactivity.
 * @param args
 */
public static void main(String[] args){
  final SwingShowTooltipViewer siv=new SwingShowTooltipViewer();
  JFrame jf=new JFrame();
  jf.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  jf.addComponentListener(siv);
  Container co=jf.getContentPane();
  co.setLayout(new BorderLayout());
  co.add(siv,BorderLayout.CENTER);
  Dimension dScreen=Toolkit.getDefaultToolkit().getScreenSize();
  Dimension dApp=new Dimension(600,400);
  jf.setSize(dApp);
  jf.setLocation((dScreen.width - dApp.width) / 2,(dScreen.height - dApp.height) / 2);
  jf.setTitle(siv.getClass().getName() + "String_Node_Str" + siv.idr.getClass().getName()+ "String_Node_Str");
  ControlPanel cp=siv.new ControlPanel(siv);
  co.add(cp,BorderLayout.SOUTH);
  siv.idr.setProperty(IDeviceRenderer.UPDATE_NOTIFIER,siv);
  jf.addWindowListener(new WindowAdapter(){
    public void windowClosing(    WindowEvent e){
      siv.idr.dispose();
    }
  }
);
  jf.setVisible(true);
}

Fixed version (ground truth):
/** 
 * Constructs the layout with a container for displaying chart and a control panel for selecting interactivity.
 * @param args
 */
public static void main(String[] args){
  final SwingShowTooltipViewer siv=new SwingShowTooltipViewer();
  JFrame jf=new JFrame();
  jf.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  jf.addComponentListener(siv);
  Container co=jf.getContentPane();
  co.setLayout(new BorderLayout());
  co.add(siv,BorderLayout.CENTER);
  Dimension dScreen=Toolkit.getDefaultToolkit().getScreenSize();
  Dimension dApp=new Dimension(600,400);
  jf.setSize(dApp);
  jf.setLocation((dScreen.width - dApp.width) / 2,(dScreen.height - dApp.height) / 2);
  jf.setTitle(siv.getClass().getName() + "String_Node_Str" + siv.idr.getClass().getName()+ "String_Node_Str");
  ControlPanel cp=siv.new ControlPanel(siv);
  co.add(cp,BorderLayout.SOUTH);
  siv.idr.setProperty(IDeviceRenderer.UPDATE_NOTIFIER,siv);
  jf.addWindowListener(new WindowAdapter(){
    @Override public void windowClosing(    WindowEvent e){
      siv.idr.dispose();
    }
  }
);
  jf.setVisible(true);
}
Program: 67852
Project: 67852
Buggy source:
public void repaintChart(){
  repaint();
}

Fixed version (ground truth):
public void repaintChart(){
  updateBuffer();
  repaint();
}
Program: 67853
Project: 67853
Buggy source:
/** 
 * Get the connection with SWING device to render the graphics.
 */
SwingShowTooltipViewer(){
  contextMap=new HashMap();
  final PluginSettings ps=PluginSettings.instance();
  try {
    idr=ps.getDevice("String_Node_Str");
  }
 catch (  ChartException ex) {
    ex.printStackTrace();
  }
  cm=PrimitiveCharts.showTooltip_AreaChart();
}

Fixed version (ground truth):
/** 
 * Get the connection with SWING device to render the graphics.
 */
SwingShowTooltipViewer(){
  contextMap=new HashMap();
  PlatformConfig config=new PlatformConfig();
  config.setProperty(PluginSettings.PROP_STANDALONE,"String_Node_Str");
  final PluginSettings ps=PluginSettings.instance();
  try {
    idr=ps.getDevice("String_Node_Str");
  }
 catch (  ChartException ex) {
    ex.printStackTrace();
  }
  cm=PrimitiveCharts.showTooltip_AreaChart();
}
Program: 67854
Project: 67854
Buggy source:
public void windowClosing(WindowEvent e){
  siv.idr.dispose();
}

Fixed version (ground truth):
@Override public void windowClosing(WindowEvent e){
  siv.idr.dispose();
}
Program: 67855
Project: 67855
Buggy source:
public void paint(Graphics g){
  super.paint(g);
  if (bi == null) {
    updateBuffer();
  }
  g.drawImage(bi,0,0,this);
}

Fixed version (ground truth):
@Override public void paint(Graphics g){
  super.paint(g);
  if (bi == null) {
    updateBuffer();
  }
  g.drawImage(bi,0,0,this);
}
Program: 67856
Project: 67856
Buggy source:
/** 
 * Contructs the layout with a container for displaying chart and a control panel for selecting interactivity.
 * @param args
 */
public static void main(String[] args){
  final SwingToggleVisibilityViewer siv=new SwingToggleVisibilityViewer();
  JFrame jf=new JFrame();
  jf.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  jf.addComponentListener(siv);
  Container co=jf.getContentPane();
  co.setLayout(new BorderLayout());
  co.add(siv,BorderLayout.CENTER);
  Dimension dScreen=Toolkit.getDefaultToolkit().getScreenSize();
  Dimension dApp=new Dimension(600,400);
  jf.setSize(dApp);
  jf.setLocation((dScreen.width - dApp.width) / 2,(dScreen.height - dApp.height) / 2);
  jf.setTitle(siv.getClass().getName() + "String_Node_Str" + siv.idr.getClass().getName()+ "String_Node_Str");
  ControlPanel cp=siv.new ControlPanel(siv);
  co.add(cp,BorderLayout.SOUTH);
  siv.idr.setProperty(IDeviceRenderer.UPDATE_NOTIFIER,siv);
  jf.addWindowListener(new WindowAdapter(){
    public void windowClosing(    WindowEvent e){
      siv.idr.dispose();
    }
  }
);
  jf.setVisible(true);
}

Fixed version (ground truth):
/** 
 * Constructs the layout with a container for displaying chart and a control panel for selecting interactivity.
 * @param args
 */
public static void main(String[] args){
  final SwingToggleVisibilityViewer siv=new SwingToggleVisibilityViewer();
  JFrame jf=new JFrame();
  jf.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  jf.addComponentListener(siv);
  Container co=jf.getContentPane();
  co.setLayout(new BorderLayout());
  co.add(siv,BorderLayout.CENTER);
  Dimension dScreen=Toolkit.getDefaultToolkit().getScreenSize();
  Dimension dApp=new Dimension(600,400);
  jf.setSize(dApp);
  jf.setLocation((dScreen.width - dApp.width) / 2,(dScreen.height - dApp.height) / 2);
  jf.setTitle(siv.getClass().getName() + "String_Node_Str" + siv.idr.getClass().getName()+ "String_Node_Str");
  ControlPanel cp=siv.new ControlPanel(siv);
  co.add(cp,BorderLayout.SOUTH);
  siv.idr.setProperty(IDeviceRenderer.UPDATE_NOTIFIER,siv);
  jf.addWindowListener(new WindowAdapter(){
    public void windowClosing(    WindowEvent e){
      siv.idr.dispose();
    }
  }
);
  jf.setVisible(true);
}
Program: 67857
Project: 67857
Buggy source:
/** 
 * Get the connection with SWING device to render the graphics.
 */
SwingToggleVisibilityViewer(){
  contextMap=new HashMap();
  final PluginSettings ps=PluginSettings.instance();
  try {
    idr=ps.getDevice("String_Node_Str");
  }
 catch (  ChartException ex) {
    ex.printStackTrace();
  }
  cm=PrimitiveCharts.toggleVisibility_AreaChart();
}

Fixed version (ground truth):
/** 
 * Get the connection with SWING device to render the graphics.
 */
SwingToggleVisibilityViewer(){
  contextMap=new HashMap();
  PlatformConfig config=new PlatformConfig();
  config.setProperty(PluginSettings.PROP_STANDALONE,"String_Node_Str");
  final PluginSettings ps=PluginSettings.instance();
  try {
    idr=ps.getDevice("String_Node_Str");
  }
 catch (  ChartException ex) {
    ex.printStackTrace();
  }
  cm=PrimitiveCharts.toggleVisibility_AreaChart();
}
Program: 67858
Project: 67858
Buggy source:
public void repaintChart(){
  repaint();
}

Fixed version (ground truth):
public void repaintChart(){
  updateBuffer();
  repaint();
}
Program: 67860
Project: 67860
Buggy source:
protected void initialize() throws BirtException {
  reader=new ImageReader(content,context.getSupportedImageFormats());
  int result=reader.read();
switch (result) {
case ImageReader.RESOURCE_UNREACHABLE:
    layout=createAltTextLayout(ImageReader.RESOURCE_UNREACHABLE);
  break;
case ImageReader.UNSUPPORTED_OBJECTS:
layout=createAltTextLayout(ImageReader.UNSUPPORTED_OBJECTS);
break;
case ImageReader.OBJECT_LOADED_SUCCESSFULLY:
layout=new ConcreteImageLayout(context,parent,content,reader.getByteArray());
break;
}
}

Fixed version (ground truth):
protected void initialize() throws BirtException {
  reader=new ImageReader(content,context.getSupportedImageFormats());
  int result=reader.read();
switch (result) {
case ImageReader.RESOURCE_UNREACHABLE:
    layout=createAltTextLayout(ImageReader.RESOURCE_UNREACHABLE);
  break;
case ImageReader.UNSUPPORTED_OBJECTS:
layout=createAltTextLayout(ImageReader.UNSUPPORTED_OBJECTS);
break;
case ImageReader.OBJECT_LOADED_SUCCESSFULLY:
if (reader.getType() == ImageReader.TYPE_IMAGE_OBJECT || reader.getType() == ImageReader.TYPE_CONVERTED_SVG_OBJECT) {
try {
imageObject=Image.getInstance(reader.getByteArray());
}
 catch (Exception e) {
logger.log(Level.WARNING,e.getLocalizedMessage());
}
if (imageObject == null) {
layout=createAltTextLayout(ImageReader.UNSUPPORTED_OBJECTS);
break;
}
}
layout=new ConcreteImageLayout(context,parent,content,reader.getByteArray());
break;
}
}
Program: 67861
Project: 67861
Buggy source:
/** 
 * Must run on UI thread
 * @return
 */
private boolean test(){
  if (!Constants.OS_WIN32.equalsIgnoreCase(Platform.getOS()) && !Constants.OS_LINUX.equalsIgnoreCase(Platform.getOS())) {
    return false;
  }
  if (!tested) {
    tested=true;
    Shell sh=new Shell();
    try {
      new Browser(sh,SWT.NONE);
      available=true;
    }
 catch (    SWTError se) {
      if (se.code == SWT.ERROR_NO_HANDLES) {
        available=false;
      }
    }
catch (    Exception e) {
    }
    if (sh != null && !sh.isDisposed())     sh.dispose();
  }
  return available;
}

Fixed version (ground truth):
/** 
 * Must run on UI thread
 * @return
 */
private boolean test(){
  if (!tested) {
    tested=true;
    Shell sh=new Shell();
    try {
      new Browser(sh,SWT.NONE);
      available=true;
    }
 catch (    SWTError se) {
      if (se.code == SWT.ERROR_NO_HANDLES) {
        available=false;
      }
    }
catch (    Exception e) {
    }
    if (sh != null && !sh.isDisposed())     sh.dispose();
  }
  return available;
}
Program: 67862
Project: 67862
Buggy source:
protected void initializeBounds(){
  Point size;
  if (!needRememberLastSize()) {
    size=getShell().computeSize(SWT.DEFAULT,SWT.DEFAULT,true);
  }
 else {
    size=getInitialSize();
  }
  Point location=getInitialLocation(size);
  getShell().setBounds(getConstrainedShellBounds(new Rectangle(location.x,location.y,size.x,size.y)));
}

Fixed version (ground truth):
protected void initializeBounds(){
  Shell shell=getShell();
  if (shell != null) {
    if (shell.getDisplay().getDismissalAlignment() == SWT.RIGHT) {
      Button defaultButton=shell.getDefaultButton();
      if (defaultButton != null && isContained(buttonBar,defaultButton)) {
        defaultButton.moveBelow(null);
        ((Composite)buttonBar).layout();
      }
    }
  }
  Point size;
  if (!needRememberLastSize()) {
    size=getShell().computeSize(SWT.DEFAULT,SWT.DEFAULT,true);
  }
 else {
    size=getInitialSize();
  }
  Point location=getInitialLocation(size);
  getShell().setBounds(getConstrainedShellBounds(new Rectangle(location.x,location.y,size.x,size.y)));
}