nus-yam/ex-repair huggingface dataset:
Program: 68589
Project: 68589
Buggy source:
public void run(){
  if (previewPainter != null) {
    Chart cm=(Chart)getParameter(ChartLivePreviewThread.PARAM_CHART_MODEL);
    if (cm instanceof ChartWithAxes) {
      ChartAdapter.beginIgnoreNotifications();
      checkDataTypeForChartWithAxes(cm);
      ChartAdapter.endIgnoreNotifications();
    }
 else {
      ChartWizard.removeAllExceptions(ChartWizard.CheckSeriesBindingType_ID);
    }
    previewPainter.renderModel(cm);
  }
}

Fixed version (ground truth):
public void run(){
  if (previewPainter != null) {
    Chart cm=(Chart)getParameter(ChartLivePreviewThread.PARAM_CHART_MODEL);
    if (cm instanceof ChartWithAxes) {
      ChartAdapter.beginIgnoreNotifications();
      checkDataTypeForChartWithAxes();
      ChartAdapter.endIgnoreNotifications();
    }
 else {
      ChartWizard.removeAllExceptions(ChartWizard.CheckSeriesBindingType_ID);
    }
    previewPainter.renderModel(cm);
  }
}
Program: 68590
Project: 68590
Buggy source:
public void doPreview(){
  LivePreviewTask lpt=new LivePreviewTask(Messages.getString("String_Node_Str"),null);
  lpt.addTask(new LivePreviewTask(){
    public void run(){
      if (previewPainter != null) {
        setParameter(ChartLivePreviewThread.PARAM_CHART_MODEL,ChartUIUtil.prepareLivePreview(chartModel,getDataServiceProvider(),((ChartWizardContext)context).getActionEvaluator()));
      }
    }
  }
);
  lpt.addTask(new LivePreviewTask(){
    public void run(){
      if (previewCanvas != null && previewCanvas.getDisplay() != null && !previewCanvas.getDisplay().isDisposed()) {
        previewCanvas.getDisplay().syncExec(new Runnable(){
          public void run(){
            if (previewPainter != null) {
              Chart cm=(Chart)getParameter(ChartLivePreviewThread.PARAM_CHART_MODEL);
              if (cm instanceof ChartWithAxes) {
                ChartAdapter.beginIgnoreNotifications();
                checkDataTypeForChartWithAxes(cm);
                ChartAdapter.endIgnoreNotifications();
              }
 else {
                ChartWizard.removeAllExceptions(ChartWizard.CheckSeriesBindingType_ID);
              }
              previewPainter.renderModel(cm);
            }
          }
        }
);
      }
    }
  }
);
  ((ChartLivePreviewThread)((ChartWizardContext)context).getLivePreviewThread()).setParentShell(getPreviewCanvas().getShell());
  ((ChartLivePreviewThread)((ChartWizardContext)context).getLivePreviewThread()).add(lpt);
}

Fixed version (ground truth):
public void doPreview(){
  LivePreviewTask lpt=new LivePreviewTask(Messages.getString("String_Node_Str"),null);
  lpt.addTask(new LivePreviewTask(){
    public void run(){
      if (previewPainter != null) {
        setParameter(ChartLivePreviewThread.PARAM_CHART_MODEL,ChartUIUtil.prepareLivePreview(chartModel,getDataServiceProvider(),((ChartWizardContext)context).getActionEvaluator()));
      }
    }
  }
);
  lpt.addTask(new LivePreviewTask(){
    public void run(){
      if (previewCanvas != null && previewCanvas.getDisplay() != null && !previewCanvas.getDisplay().isDisposed()) {
        previewCanvas.getDisplay().syncExec(new Runnable(){
          public void run(){
            if (previewPainter != null) {
              Chart cm=(Chart)getParameter(ChartLivePreviewThread.PARAM_CHART_MODEL);
              if (cm instanceof ChartWithAxes) {
                ChartAdapter.beginIgnoreNotifications();
                checkDataTypeForChartWithAxes();
                ChartAdapter.endIgnoreNotifications();
              }
 else {
                ChartWizard.removeAllExceptions(ChartWizard.CheckSeriesBindingType_ID);
              }
              previewPainter.renderModel(cm);
            }
          }
        }
);
      }
    }
  }
);
  ((ChartLivePreviewThread)((ChartWizardContext)context).getLivePreviewThread()).setParentShell(getPreviewCanvas().getShell());
  ((ChartLivePreviewThread)((ChartWizardContext)context).getLivePreviewThread()).add(lpt);
}
Program: 68591
Project: 68591
Buggy source:
private void checkDataTypeForChartWithAxes(Chart cm){
  List<SeriesDefinition> sdList=new ArrayList<SeriesDefinition>();
  sdList.addAll(ChartUIUtil.getBaseSeriesDefinitions(cm));
  for (int i=0; i < sdList.size(); i++) {
    SeriesDefinition sd=sdList.get(i);
    Series series=sd.getDesignTimeSeries();
    checkDataTypeForBaseSeries(ChartUIUtil.getDataQuery(sd,0),series);
  }
  sdList.clear();
  sdList.addAll(ChartUIUtil.getAllOrthogonalSeriesDefinitions(cm));
  for (int i=0; i < sdList.size(); i++) {
    SeriesDefinition sd=sdList.get(i);
    Series series=sd.getDesignTimeSeries();
    checkDataTypeForOrthoSeries(ChartUIUtil.getDataQuery(sd,0),series);
  }
}

Fixed version (ground truth):
private void checkDataTypeForChartWithAxes(){
  List<SeriesDefinition> sdList=new ArrayList<SeriesDefinition>();
  sdList.addAll(ChartUIUtil.getBaseSeriesDefinitions(getChartModel()));
  for (int i=0; i < sdList.size(); i++) {
    SeriesDefinition sd=sdList.get(i);
    Series series=sd.getDesignTimeSeries();
    checkDataTypeForBaseSeries(ChartUIUtil.getDataQuery(sd,0),series);
  }
  sdList.clear();
  sdList.addAll(ChartUIUtil.getAllOrthogonalSeriesDefinitions(getChartModel()));
  for (int i=0; i < sdList.size(); i++) {
    SeriesDefinition sd=sdList.get(i);
    Series series=sd.getDesignTimeSeries();
    checkDataTypeForOrthoSeries(ChartUIUtil.getDataQuery(sd,0),series);
  }
}
Program: 68592
Project: 68592
Buggy source:
/** 
 * If the BaseFont can NOT find the correct physical glyph, we need to simulate the proper style for the font. The "simulate" flag will be set if we need to simulate it.
 */
private boolean needSimulate(BaseFont font){
  if (fontStyle != Font.NORMAL) {
    String[][] familyNames=bf.getFamilyFontName();
    String[][] fullNames=bf.getFullFontName();
    String familyName=getEnglishName(familyNames);
    String fullName=getEnglishName(fullNames);
    return familyName.equals(fullName);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * If the BaseFont can NOT find the correct physical glyph, we need to simulate the proper style for the font. The "simulate" flag will be set if we need to simulate it.
 */
private boolean needSimulate(BaseFont font){
  if (fontStyle != Font.NORMAL) {
    String[][] fullNames=bf.getFullFontName();
    String fullName=getEnglishName(fullNames);
    String lcf=fullName.toLowerCase();
    int fs=Font.NORMAL;
    if (lcf.indexOf("String_Node_Str") != -1) {
      fs|=Font.BOLD;
    }
    if (lcf.indexOf("String_Node_Str") != -1 || lcf.indexOf("String_Node_Str") != -1) {
      fs|=Font.ITALIC;
    }
    if ((fontStyle & Font.BOLDITALIC) == fs) {
      return false;
    }
 else {
      return true;
    }
  }
  return false;
}
Program: 68593
Project: 68593
Buggy source:
/** 
 * Creates iText BaseFont with the given font family name.
 * @param ffn the specified font family name.
 * @return the created BaseFont.
 */
public BaseFont createFont(String familyName,int fontStyle){
  String key=familyName + fontStyle;
synchronized (baseFonts) {
    BaseFont font=(BaseFont)baseFonts.get(key);
    if (font == null) {
      if (baseFonts.containsKey(key)) {
        return null;
      }
      try {
        String fontEncoding=(String)fontEncodings.get(familyName);
        if (fontEncoding == null) {
          fontEncoding=BaseFont.IDENTITY_H;
        }
        font=FontFactory.getFont(familyName,fontEncoding,BaseFont.EMBEDDED,14,fontStyle).getBaseFont();
        baseFonts.put(key,font);
      }
 catch (      Throwable de) {
        baseFonts.put(key,font);
        return null;
      }
    }
    return font;
  }
}

Fixed version (ground truth):
/** 
 * Creates iText BaseFont with the given font family name.
 * @param ffn the specified font family name.
 * @return the created BaseFont.
 */
public BaseFont createFont(String familyName,int fontStyle){
  String key=familyName + fontStyle;
  BaseFont bf=null;
synchronized (baseFonts) {
    if (baseFonts.containsKey(key)) {
      bf=(BaseFont)baseFonts.get(key);
    }
 else {
      try {
        String fontEncoding=(String)fontEncodings.get(familyName);
        if (fontEncoding == null) {
          fontEncoding=BaseFont.IDENTITY_H;
        }
        bf=FontFactory.getFont(familyName,fontEncoding,BaseFont.EMBEDDED,14,fontStyle).getBaseFont();
      }
 catch (      Throwable de) {
        logger.log(Level.WARNING,de.getMessage(),de);
      }
      baseFonts.put(key,bf);
    }
    if (bf == null && fontStyle != Font.NORMAL) {
      return createFont(familyName,Font.NORMAL);
    }
  }
  return bf;
}
Program: 68594
Project: 68594
Buggy source:
private Data createDateData(Object txt,StyleEntry entry,String timeFormat,String dlocale){
  ULocale dateLocale=getLocale(dlocale);
  timeFormat=ExcelUtil.parse(txt,timeFormat,dateLocale);
  timeFormat=DateTimeUtil.formatDateTime(timeFormat,dateLocale);
  entry.setProperty(StyleConstant.DATE_FORMAT_PROP,timeFormat);
  entry.setProperty(StyleConstant.DATA_TYPE_PROP,SheetData.DATE);
  return createData(txt,entry,SheetData.DATE);
}

Fixed version (ground truth):
private Data createDateData(Object txt,StyleEntry entry,String timeFormat,String dlocale){
  ULocale dateLocale=getLocale(dlocale);
  timeFormat=ExcelUtil.parse(txt,timeFormat,dateLocale);
  timeFormat=DateTimeUtil.formatDateTime(timeFormat,dateLocale);
  entry.setProperty(StyleConstant.DATE_FORMAT_PROP,timeFormat);
  entry.setProperty(StyleConstant.DATA_TYPE_PROP,SheetData.DATE);
  return createData(txt,entry);
}
Program: 68595
Project: 68595
Buggy source:
protected Data createEmptyData(StyleEntry style){
  return createData(EMPTY,style,Data.STRING);
}

Fixed version (ground truth):
protected Data createEmptyData(StyleEntry style){
  return createData(EMPTY,style);
}
Program: 68596
Project: 68596
Buggy source:
public String getSupportedImageFormats(String emitterId){
  if (emitterId != null) {
    for (    EmitterInfo emitterInfo : emitterExtensions) {
      if (emitterId.equals(emitterInfo.getID())) {
        String supportedImageFormats=emitterInfo.getSupportedImageFormats();
        if (null != supportedImageFormats) {
          return supportedImageFormats;
        }
 else {
          return DEFAULT_SUPPORTED_IMAGE_FORMATS;
        }
      }
    }
  }
  return DEFAULT_SUPPORTED_IMAGE_FORMATS;
}

Fixed version (ground truth):
public String getSupportedImageFormats(String emitterId){
  if (emitterId != null) {
    EmitterInfo emitterInfo=(EmitterInfo)emitters.get(emitterId);
    if (emitterInfo != null) {
      String supportedImageFormats=emitterInfo.getSupportedImageFormats();
      if (null != supportedImageFormats) {
        return supportedImageFormats;
      }
    }
  }
  return DEFAULT_SUPPORTED_IMAGE_FORMATS;
}
Program: 68599
Project: 68599
Buggy source:
int invokeNewDataSet(){
  DataService.getInstance().createDataSet();
  return Window.OK;
}

Fixed version (ground truth):
int invokeNewDataSet(){
  int count=getDataServiceProvider().getAllDataSets().length;
  DataService.getInstance().createDataSet();
  if (getDataServiceProvider().getAllDataSets().length == count) {
    return Window.CANCEL;
  }
 else {
    return Window.OK;
  }
}
Program: 68600
Project: 68600
Buggy source:
public Object evaluate(IBaseExpression expr){
  return null;
}

Fixed version (ground truth):
public Object evaluate(String language,String expr) throws BirtException {
  return null;
}
Program: 68601
Project: 68601
Buggy source:
public String getDisplayExpression(){
  if (cmbDefinition != null && isTableSharedBinding()) {
    return getDisplayExpressionForSharedBinding(cmbDefinition,query.getDefinition());
  }
 else {
    return btnBuilder.getExpressionString();
  }
}

Fixed version (ground truth):
public String getDisplayExpression(){
  if (cmbDefinition != null && isTableSharedBinding()) {
    return getDisplayExpressionForSharedBinding(cmbDefinition,query.getDefinition());
  }
 else {
    String expr=query.getDefinition();
    return (expr == null) ? "String_Node_Str" : expr;
  }
}
Program: 68602
Project: 68602
Buggy source:
public static void showException(String key,String errorMessage){
  if (errorMessage != null) {
    try {
      WizardBase.showException(errorMessage);
    }
 catch (    Exception e) {
    }
    errors.put(key,errorMessage);
  }
}

Fixed version (ground truth):
public static void showException(String key,final String errorMessage){
  if (errorMessage != null) {
    try {
      Display.getDefault().syncExec(new Runnable(){
        public void run(){
          WizardBase.showException(errorMessage);
        }
      }
);
    }
 catch (    Exception e) {
    }
    errors.put(key,errorMessage);
  }
}
Program: 68603
Project: 68603
Buggy source:
public static void removeException(String key){
  boolean removed=false;
  String error=errors.get(key);
  if (error != null && error.equals(WizardBase.getErrors())) {
    try {
      WizardBase.removeException();
    }
 catch (    Exception e) {
    }
    removed=true;
  }
  errors.remove(key);
  if ((removed || WizardBase.getErrors() == null) && errors.size() > 0) {
    String es=errors.values().toArray(new String[errors.size()])[0];
    WizardBase.showException(es);
  }
}

Fixed version (ground truth):
public static void removeException(String key){
  boolean removed=false;
  String error=errors.get(key);
  if (error != null && error.equals(WizardBase.getErrors())) {
    try {
      Display.getDefault().syncExec(new Runnable(){
        public void run(){
          WizardBase.removeException();
        }
      }
);
    }
 catch (    Exception e) {
    }
    removed=true;
  }
  errors.remove(key);
  if ((removed || WizardBase.getErrors() == null) && errors.size() > 0) {
    final String es=errors.values().toArray(new String[errors.size()])[0];
    Display.getDefault().syncExec(new Runnable(){
      public void run(){
        WizardBase.showException(es);
      }
    }
);
  }
}
Program: 68604
Project: 68604
Buggy source:
/** 
 * Remove all the exceptions which the keys contain the argument.
 * @param subKey
 */
public static void removeAllExceptions(String subKey){
  boolean removed=false;
  Iterator<String> iter=errors.keySet().iterator();
  List<String> needToRemove=new ArrayList<String>(2);
  while (iter.hasNext()) {
    String key=iter.next();
    if (key.indexOf(subKey) > -1) {
      needToRemove.add(key);
    }
  }
  for (  String s : needToRemove) {
    String e=errors.get(s);
    if (e != null && e.equals(WizardBase.getErrors())) {
      WizardBase.removeException();
      removed=true;
    }
    errors.remove(s);
  }
  if ((removed || WizardBase.getErrors() == null) && errors.size() > 0) {
    String es=errors.values().toArray(new String[errors.size()])[0];
    WizardBase.showException(es);
  }
}

Fixed version (ground truth):
/** 
 * Remove all the exceptions which the keys contain the argument.
 * @param subKey
 */
public static void removeAllExceptions(String subKey){
  boolean removed=false;
  Iterator<String> iter=errors.keySet().iterator();
  List<String> needToRemove=new ArrayList<String>(2);
  while (iter.hasNext()) {
    String key=iter.next();
    if (key.indexOf(subKey) > -1) {
      needToRemove.add(key);
    }
  }
  for (  String s : needToRemove) {
    String e=errors.get(s);
    if (e != null && e.equals(WizardBase.getErrors())) {
      Display.getDefault().syncExec(new Runnable(){
        public void run(){
          WizardBase.removeException();
        }
      }
);
      removed=true;
    }
    errors.remove(s);
  }
  if ((removed || WizardBase.getErrors() == null) && errors.size() > 0) {
    final String es=errors.values().toArray(new String[errors.size()])[0];
    Display.getDefault().syncExec(new Runnable(){
      public void run(){
        WizardBase.showException(es);
      }
    }
);
  }
}
Program: 68605
Project: 68605
Buggy source:
public ImageData(IImageContent image,int styleId,int datatype,Image imageInfo,XlsContainer currentContainer){
  super();
  this.styleId=styleId;
  this.dataType=datatype;
  height=ExcelUtil.convertImageSize(image.getHeight(),(int)(imageInfo.getHeight() * ExcelUtil.PX_PT));
  int imageWidth=(int)ExcelUtil.convertImageSize(image.getWidth(),(int)(imageInfo.getWidth() * ExcelUtil.PX_PT));
  width=Math.min(currentContainer.getSizeInfo().getWidth(),imageWidth);
  altText=image.getAltText();
  imageUrl=image.getURI();
  this.imageData=imageInfo.getData();
  rowSpanInDesign=0;
  this.imageInfo=imageInfo;
}

Fixed version (ground truth):
public ImageData(IImageContent image,int styleId,int datatype,Image imageInfo,XlsContainer currentContainer){
  super();
  this.dataType=datatype;
  this.styleId=styleId;
  height=ExcelUtil.convertDimensionType(image.getHeight(),(int)(imageInfo.getHeight() * ExcelUtil.PX_PT)) / 1000;
  int imageWidth=(int)ExcelUtil.convertDimensionType(image.getWidth(),(int)(imageInfo.getWidth() * ExcelUtil.PX_PT));
  width=Math.min(currentContainer.getSizeInfo().getWidth(),imageWidth);
  altText=image.getAltText();
  imageUrl=image.getURI();
  this.imageData=imageInfo.getData();
  rowSpanInDesign=0;
  this.imageInfo=imageInfo;
}
Program: 68606
Project: 68606
Buggy source:
private int getLetterNumber(ContainerArea area){
  int count=0;
  Iterator iter=area.getChildren();
  while (iter.hasNext()) {
    AbstractArea child=(AbstractArea)iter.next();
    if (child instanceof TextArea) {
      String text=((TextArea)child).getText();
      count=(text.length() > 1 ? (text.length() - 1) : 0) - 1;
    }
 else     if (child instanceof ContainerArea) {
      count+=getLetterNumber((ContainerArea)child);
    }
  }
  return count;
}

Fixed version (ground truth):
private int getLetterNumber(ContainerArea area){
  int count=0;
  Iterator iter=area.getChildren();
  while (iter.hasNext()) {
    AbstractArea child=(AbstractArea)iter.next();
    if (child instanceof TextArea) {
      String text=((TextArea)child).getText();
      count=text.length();
    }
 else     if (child instanceof ContainerArea) {
      count+=getLetterNumber((ContainerArea)child);
    }
  }
  return count;
}
Program: 68607
Project: 68607
Buggy source:
protected void justify(){
  int spacing=width - currentIP;
  int whiteSpaceNumber=getWhiteSpaceNumber(this);
  if (whiteSpaceNumber > 0) {
    int wordSpacing=spacing / whiteSpaceNumber;
    adjustWordSpacing(wordSpacing,this);
  }
 else {
    int letterNumber=getLetterNumber(this);
    if (letterNumber > 0) {
      int letterSpacing=spacing / letterNumber;
      adjustLetterSpacing(letterSpacing,this);
    }
  }
}

Fixed version (ground truth):
protected void justify(){
  int spacing=width - currentIP;
  int whiteSpaceNumber=getWhiteSpaceNumber(this);
  if (whiteSpaceNumber > 0) {
    int wordSpacing=spacing / whiteSpaceNumber;
    adjustWordSpacing(wordSpacing,this);
  }
 else {
    int letterNumber=getLetterNumber(this);
    if (letterNumber > 0) {
      int letterSpacing=spacing / (letterNumber - 1);
      adjustLetterSpacing(letterSpacing,this);
    }
  }
}
Program: 68608
Project: 68608
Buggy source:
private int adjustLetterSpacing(int letterSpacing,ContainerArea area){
  Iterator iter=area.getChildren();
  int delta=0;
  while (iter.hasNext()) {
    AbstractArea child=(AbstractArea)iter.next();
    if (child instanceof TextArea) {
      TextArea textArea=(TextArea)child;
      String text=textArea.getText();
      int letterNumber=(text.length() > 1 ? (text.length() - 1) : 0);
      TextStyle style=textArea.getStyle();
      int original=style.getLetterSpacing();
      style.setLetterSpacing(original + letterSpacing);
      int spacing=letterSpacing * letterNumber;
      child.setWidth(child.getWidth() + spacing);
      child.setPosition(child.getX() + delta,child.getY());
      delta+=spacing;
    }
 else     if (child instanceof ContainerArea) {
      child.setPosition(child.getX() + delta,child.getY());
      int spacing=adjustLetterSpacing(letterSpacing,(ContainerArea)child);
      child.setWidth(child.getWidth() + spacing);
      delta+=spacing;
    }
 else {
      child.setPosition(child.getX() + delta,child.getY());
    }
  }
  return delta;
}

Fixed version (ground truth):
private int adjustLetterSpacing(int letterSpacing,ContainerArea area){
  Iterator iter=area.getChildren();
  int delta=0;
  while (iter.hasNext()) {
    AbstractArea child=(AbstractArea)iter.next();
    if (child instanceof TextArea) {
      TextArea textArea=(TextArea)child;
      String text=textArea.getText();
      int letterSpacingNumber=(text.length() > 1 ? (text.length() - 1) : 0);
      TextStyle style=new TextStyle(textArea.getStyle());
      int original=style.getLetterSpacing();
      style.setLetterSpacing(original + letterSpacing);
      textArea.setStyle(style);
      int spacing=letterSpacing * letterSpacingNumber;
      child.setWidth(child.getWidth() + spacing);
      child.setPosition(child.getX() + delta,child.getY());
      delta+=spacing;
    }
 else     if (child instanceof ContainerArea) {
      child.setPosition(child.getX() + delta,child.getY());
      int spacing=adjustLetterSpacing(letterSpacing,(ContainerArea)child);
      child.setWidth(child.getWidth() + spacing);
      delta+=spacing;
    }
 else {
      child.setPosition(child.getX() + delta,child.getY());
    }
  }
  return delta;
}
Program: 68609
Project: 68609
Buggy source:
/** 
 * @param value
 * @param parent with of parent, the unit is 1/1000 point.
 * @return
 */
public static int convertDimensionType(DimensionType value,int parent){
  if (value == null) {
    return parent * 1000;
  }
  if (DimensionType.UNITS_PERCENTAGE.equals(value.getUnits())) {
    return (int)(value.getMeasure() / 100 * parent);
  }
  if (DimensionType.UNITS_PX.equalsIgnoreCase(value.getUnits())) {
    return (int)(value.getMeasure() * PX_PT * 1000);
  }
  if (DimensionType.UNITS_EM.equalsIgnoreCase(value.getUnits()) || DimensionType.UNITS_EX.equalsIgnoreCase(value.getUnits())) {
    return (int)(value.getMeasure() * 12 * 1000);
  }
 else {
    return (int)(value.convertTo(DimensionType.UNITS_PT) * 1000);
  }
}

Fixed version (ground truth):
/** 
 * @param value
 * @param parent with of parent, the unit is 1/1000 point.
 * @return
 */
public static int convertDimensionType(DimensionType value,float parent){
  if (value == null) {
    return (int)(parent * 1000);
  }
  if (DimensionType.UNITS_PERCENTAGE.equals(value.getUnits())) {
    return (int)(value.getMeasure() / 100 * parent);
  }
  if (DimensionType.UNITS_PX.equalsIgnoreCase(value.getUnits())) {
    return (int)(value.getMeasure() * PX_PT * 1000);
  }
  if (DimensionType.UNITS_EM.equalsIgnoreCase(value.getUnits()) || DimensionType.UNITS_EX.equalsIgnoreCase(value.getUnits())) {
    return (int)(value.getMeasure() * 12 * 1000);
  }
 else {
    return (int)(value.convertTo(DimensionType.UNITS_PT) * 1000);
  }
}
Program: 68610
Project: 68610
Buggy source:
public ImageData(IImageContent image,int styleId,int datatype,Image imageInfo,XlsContainer currentContainer){
  super();
  this.dataType=datatype;
  this.styleId=styleId;
  height=ExcelUtil.convertDimensionType(image.getHeight(),(int)(imageInfo.getHeight() * ExcelUtil.PX_PT)) / 1000;
  int imageWidth=(int)ExcelUtil.convertDimensionType(image.getWidth(),(int)(imageInfo.getWidth() * ExcelUtil.PX_PT));
  width=Math.min(currentContainer.getSizeInfo().getWidth(),imageWidth);
  altText=image.getAltText();
  imageUrl=image.getURI();
  this.imageData=imageInfo.getData();
  rowSpanInDesign=0;
  this.imageInfo=imageInfo;
}

Fixed version (ground truth):
public ImageData(IImageContent image,int styleId,int datatype,Image imageInfo,XlsContainer currentContainer){
  super();
  this.dataType=datatype;
  this.styleId=styleId;
  height=ExcelUtil.convertDimensionType(image.getHeight(),imageInfo.getHeight() * ExcelUtil.PX_PT) / 1000;
  int imageWidth=(int)ExcelUtil.convertDimensionType(image.getWidth(),imageInfo.getWidth() * ExcelUtil.PX_PT);
  width=Math.min(currentContainer.getSizeInfo().getWidth(),imageWidth);
  altText=image.getAltText();
  imageUrl=image.getURI();
  this.imageData=imageInfo.getData();
  rowSpanInDesign=0;
  this.imageInfo=imageInfo;
}
Program: 68611
Project: 68611
Buggy source:
OdaDataSetRuntime(IOdaDataSetDesign dataSet,IQueryExecutor executor,DataEngineSession session){
  super(dataSet,executor,session);
  Object[] params={dataSet,executor};
  logger.entering(OdaDataSetRuntime.class.getName(),"String_Node_Str",params);
  queryText=dataSet.getQueryText();
  publicProperties=new HashMap();
  publicProperties.putAll(dataSet.getPublicProperties());
  logger.exiting(OdaDataSetRuntime.class.getName(),"String_Node_Str");
  logger.log(Level.FINER,"String_Node_Str");
}

Fixed version (ground truth):
OdaDataSetRuntime(IOdaDataSetDesign dataSet,IQueryExecutor executor,DataEngineSession session){
  super(dataSet,executor,session);
  Object[] params={dataSet,executor};
  logger.entering(OdaDataSetRuntime.class.getName(),"String_Node_Str",params);
  queryText=dataSet.getQueryText();
  publicProperties=new HashMap();
  publicProperties.putAll(dataSet.getPublicProperties());
  ResultExtensionExplorer extensionExplorer=ResultExtensionExplorer.getInstance();
  ExtensionContributor[] contributors=null;
  try {
    OdaDataSourceRuntime dataSourceRuntime=(OdaDataSourceRuntime)((DataEngineImpl)session.getEngine()).getDataSourceRuntime(dataSet.getDataSourceName());
    contributors=extensionExplorer.getContributorsOfDataSet(dataSourceRuntime.getExtensionID(),dataSet.getExtensionID());
  }
 catch (  IllegalArgumentException e) {
  }
catch (  OdaException e) {
  }
  ExtensionContributor contributor=null;
  if (contributors != null && contributors.length > 0) {
    contributor=contributors[0];
    validationContext=new ValidationContext(contributor);
  }
  logger.exiting(OdaDataSetRuntime.class.getName(),"String_Node_Str");
  logger.log(Level.FINER,"String_Node_Str");
}
Program: 68612
Project: 68612
Buggy source:
public static QuerySpecification optimizeExecution(String dataSourceId,IOdaDataSetDesign dataSetDesign,IQueryDefinition query,DataEngineSession session,Map appContext,IQueryContextVisitor contextVisitor){
  return null;
}

Fixed version (ground truth):
public static QuerySpecification optimizeExecution(String dataSourceId,ValidationContext validationContext,IOdaDataSetDesign dataSetDesign,IQueryDefinition query,DataEngineSession session,Map appContext,IQueryContextVisitor contextVisitor){
  return null;
}
Program: 68613
Project: 68613
Buggy source:
PreparedIncreCacheDSQuery(DataEngineImpl dataEngine,IQueryDefinition queryDefn,IBaseDataSetDesign dataSetDesign,Map appContext) throws DataException {
  super(dataEngine,queryDefn,dataSetDesign,appContext,null,null);
}

Fixed version (ground truth):
PreparedIncreCacheDSQuery(DataEngineImpl dataEngine,IQueryDefinition queryDefn,IBaseDataSetDesign dataSetDesign,Map appContext) throws DataException {
  super(dataEngine,queryDefn,dataSetDesign,appContext,null);
}
Program: 68614
Project: 68614
Buggy source:
/** 
 * @param driverName
 * @param driverProps
 * @return
 * @throws DataException
 */
private IDataSource getDataSource(String driverName,Map driverProps) throws DataException {
  PreparedOdaDSQuery self=PreparedOdaDSQuery.this;
  Collection paramHints=null;
  return DataSourceFactory.getFactory().getDataSource(driverName,driverProps,self.dataEngine.getSession());
}

Fixed version (ground truth):
/** 
 * @param driverName
 * @param driverProps
 * @return
 * @throws DataException
 */
private IDataSource getDataSource(String driverName,Map driverProps) throws DataException {
  PreparedOdaDSQuery self=PreparedOdaDSQuery.this;
  return DataSourceFactory.getFactory().getDataSource(driverName,driverProps,self.dataEngine.getSession());
}
Program: 68615
Project: 68615
Buggy source:
/** 
 * @param dataEngine
 * @param queryDefn
 * @param dataSetDesign
 * @throws DataException
 */
PreparedOdaDSQuery(DataEngineImpl dataEngine,IQueryDefinition queryDefn,IBaseDataSetDesign dataSetDesign,Map appContext,QuerySpecification querySpec,IQueryContextVisitor visitor) throws DataException {
  super(dataEngine,queryDefn,dataSetDesign,appContext != null ? appContext : new HashMap(),visitor);
  Object[] params={dataEngine,queryDefn,dataSetDesign,appContext};
  this.querySpec=querySpec;
  logger.exiting(PreparedOdaDSQuery.class.getName(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param dataEngine
 * @param queryDefn
 * @param dataSetDesign
 * @throws DataException
 */
PreparedOdaDSQuery(DataEngineImpl dataEngine,IQueryDefinition queryDefn,IBaseDataSetDesign dataSetDesign,Map appContext,IQueryContextVisitor visitor) throws DataException {
  super(dataEngine,queryDefn,dataSetDesign,appContext != null ? appContext : new HashMap(),visitor);
  Object[] params={dataEngine,queryDefn,dataSetDesign,appContext};
  logger.exiting(PreparedOdaDSQuery.class.getName(),"String_Node_Str");
}
Program: 68616
Project: 68616
Buggy source:
/** 
 * Build size style string say, "width: 10.0mm;". The min-height should be implemented by sepcial way.
 * @param content The <code>StringBuffer</code> to which the result is output.
 * @param name The property name
 * @param value The values of the property
 */
public void buildSize(StringBuffer content,String name,DimensionType value){
  if (value != null) {
    if (HTMLTags.ATTR_MIN_HEIGHT.equals(name)) {
      if (fixedReport) {
        content.append("String_Node_Str");
        content.append(value.toString());
        content.append(';');
      }
 else {
        content.append("String_Node_Str");
        content.append(value.toString());
        content.append("String_Node_Str");
        content.append(value.toString());
        content.append(';');
      }
    }
 else     if (HTMLTags.ATTR_MIN_WIDTH.equals(name)) {
      if (fixedReport) {
        content.append("String_Node_Str");
        content.append(value.toString());
        content.append(';');
      }
 else {
        content.append("String_Node_Str");
        content.append(value.toString());
        content.append("String_Node_Str");
        content.append(value.toString());
        content.append(';');
      }
    }
 else {
      content.append(' ');
      content.append(name);
      content.append("String_Node_Str");
      content.append(value.toString());
      content.append(';');
    }
  }
}

Fixed version (ground truth):
/** 
 * Build size style string say, "width: 10.0mm;". The min-height should be implemented by sepcial way.
 * @param content The <code>StringBuffer</code> to which the result is output.
 * @param name The property name
 * @param value The values of the property
 */
public void buildSize(StringBuffer content,String name,DimensionType value){
  if (value != null) {
    String size=formatSize(value);
    if (HTMLTags.ATTR_MIN_HEIGHT.equals(name)) {
      if (fixedReport) {
        content.append("String_Node_Str");
        content.append(size);
        content.append(';');
      }
 else {
        content.append("String_Node_Str");
        content.append(size);
        content.append("String_Node_Str");
        content.append(size);
        content.append(';');
      }
    }
 else     if (HTMLTags.ATTR_MIN_WIDTH.equals(name)) {
      if (fixedReport) {
        content.append("String_Node_Str");
        content.append(size);
        content.append(';');
      }
 else {
        content.append("String_Node_Str");
        content.append(size);
        content.append("String_Node_Str");
        content.append(size);
        content.append(';');
      }
    }
 else {
      content.append(' ');
      content.append(name);
      content.append("String_Node_Str");
      content.append(size);
      content.append(';');
    }
  }
}
Program: 68617
Project: 68617
Buggy source:
private float getContentHeight(IContent content){
  return content.getHeight() == null ? 0 : ExcelUtil.convertDimensionType(content.getHeight(),0) / 1000;
}

Fixed version (ground truth):
private float getContentHeight(IContent content){
  return ExcelUtil.convertDimensionType(content.getHeight(),0) / 1000;
}
Program: 68618
Project: 68618
Buggy source:
public void endRow(IRowContent row){
  DimensionType height=row.getHeight();
  float rowHeight=height != null ? ExcelUtil.convertDimensionType(height,0) / 1000 : 0;
  engine.endRow(rowHeight);
}

Fixed version (ground truth):
public void endRow(IRowContent row){
  DimensionType height=row.getHeight();
  float rowHeight=ExcelUtil.convertDimensionType(height,0) / 1000;
  engine.endRow(rowHeight);
}
Program: 68619
Project: 68619
Buggy source:
/** 
 * @param value
 * @param parent with of parent, the unit is 1/1000 point.
 * @return
 */
public static int convertDimensionType(DimensionType value,int parent){
  if (DimensionType.UNITS_PERCENTAGE.equals(value.getUnits())) {
    return (int)(value.getMeasure() / 100 * parent);
  }
  if (DimensionType.UNITS_PX.equalsIgnoreCase(value.getUnits())) {
    return (int)(value.getMeasure() * PX_PT * 1000);
  }
  if (DimensionType.UNITS_EM.equalsIgnoreCase(value.getUnits()) || DimensionType.UNITS_EX.equalsIgnoreCase(value.getUnits())) {
    return (int)(value.getMeasure() * 12 * 1000);
  }
 else {
    return (int)(value.convertTo(DimensionType.UNITS_PT) * 1000);
  }
}

Fixed version (ground truth):
/** 
 * @param value
 * @param parent with of parent, the unit is 1/1000 point.
 * @return
 */
public static int convertDimensionType(DimensionType value,int parent){
  if (value == null) {
    return parent * 1000;
  }
  if (DimensionType.UNITS_PERCENTAGE.equals(value.getUnits())) {
    return (int)(value.getMeasure() / 100 * parent);
  }
  if (DimensionType.UNITS_PX.equalsIgnoreCase(value.getUnits())) {
    return (int)(value.getMeasure() * PX_PT * 1000);
  }
  if (DimensionType.UNITS_EM.equalsIgnoreCase(value.getUnits()) || DimensionType.UNITS_EX.equalsIgnoreCase(value.getUnits())) {
    return (int)(value.getMeasure() * 12 * 1000);
  }
 else {
    return (int)(value.convertTo(DimensionType.UNITS_PT) * 1000);
  }
}
Program: 68621
Project: 68621
Buggy source:
@Override public void start(BundleContext context) throws Exception {
  super.start(context);
  JavaUtilLoggerImpl.setStateDir(getStateLocation().toOSString());
  initChartComputation(this);
  initImageWriterFactory(this);
  initChartModelHelper(this);
  initChartScriptMenuHelper(this);
}

Fixed version (ground truth):
@Override public void start(BundleContext context) throws Exception {
  super.start(context);
  JavaUtilLoggerImpl.setStateDir(getStateLocation().toOSString());
}
Program: 68622
Project: 68622
Buggy source:
public void start(BundleContext context) throws Exception {
  super.start(context);
}

Fixed version (ground truth):
public void start(BundleContext context) throws Exception {
  super.start(context);
  initChartComputation(this);
  initImageWriterFactory(this);
  initChartModelHelper(this);
  initChartScriptMenuHelper(this);
}
Program: 68623
Project: 68623
Buggy source:
/** 
 * @deprecated backward for 2.1.0 document. This method can only insert a fragment of given offset as a child of current fragment.
 */
public void insertFragment(Object offset){
  this.segment.insertEdge(offset,true);
  this.segment.insertEdge(offset,false);
  Fragment frag=addChildFragment(offset);
  frag.segment.insertEdge(Segment.LEFT_MOST_EDGE,true);
  frag.segment.insertEdge(Segment.RIGHT_MOST_EDGE,false);
}

Fixed version (ground truth):
/** 
 * @deprecated backward for 2.1.0 document. This method can only insert a fragment of given offset as a child of current fragment.
 */
public void insertFragment(Object offset){
  this.segment.insertSection(offset,offset);
  Fragment frag=addChildFragment(offset);
  frag.segment.insertSection(Segment.LEFT_MOST_EDGE,Segment.RIGHT_MOST_EDGE);
}
Program: 68624
Project: 68624
Buggy source:
private List getSelectValueList() throws BirtException {
  List selectValueList=new ArrayList();
  ReportItemHandle reportItem=DEUtil.getBindingHolder(currentItem);
  if (bindingName != null && reportItem != null) {
    selectValueList=dataSetHandle != null ? SelectValueFetcher.getSelectValueList(ExpressionButtonUtil.getExpression(expression),reportItem.getDataSet(),false) : SelectValueFetcher.getSelectValueFromBinding(ExpressionButtonUtil.getExpression(expression),reportItem.getDataSet(),DEUtil.getVisiableColumnBindingsList(designHandle).iterator(),false);
  }
 else {
    ExceptionHandler.openErrorMessageBox(Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
  }
  return selectValueList;
}

Fixed version (ground truth):
private List getSelectValueList() throws BirtException {
  List selectValueList=new ArrayList();
  ReportItemHandle reportItem=DEUtil.getBindingHolder(currentItem);
  if (bindingName != null && reportItem != null) {
    selectValueList=dataSetHandle != null ? SelectValueFetcher.getSelectValueList(ExpressionButtonUtil.getExpression(expression),reportItem.getDataSet(),false) : SelectValueFetcher.getSelectValueFromBinding(ExpressionButtonUtil.getExpression(expression),reportItem.getDataSet(),DEUtil.getVisiableColumnBindingsList(designHandle).iterator(),DEUtil.getGroups(designHandle).iterator(),false);
  }
 else {
    ExceptionHandler.openErrorMessageBox(Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
  }
  return selectValueList;
}
Program: 68628
Project: 68628
Buggy source:
/** 
 * @param dataSet
 * @param queryDefn
 * @param useColumnHints
 * @return
 * @throws BirtException
 */
public IQueryResults execute(DataSetHandle dataSet,IQueryDefinition queryDefn,boolean useColumnHints,boolean useFilters,boolean clearCache,ExecutionContext context,DataRequestSession session) throws BirtException {
  IBaseDataSetDesign dataSetDesign=session.getModelAdaptor().adaptDataSet(dataSet);
  if (!(dataSet instanceof JointDataSetHandle || dataSet instanceof DerivedDataSetHandle) && context != null) {
    context.setReportContext(new ReportContextImpl(context));
    dataSetDesign=new ModelDteApiAdapter(context).appendRuntimeInfoToDataSet(dataSet,(BaseDataSetDesign)dataSetDesign);
  }
  if (clearCache) {
    IBaseDataSourceDesign dataSourceDesign=session.getModelAdaptor().adaptDataSource(dataSet.getDataSource());
    session.clearCache(dataSourceDesign,dataSetDesign);
  }
  if (!useColumnHints) {
    dataSetDesign.getResultSetHints().clear();
  }
  if (!useFilters) {
    dataSetDesign.getFilters().clear();
  }
  if (!(dataSet instanceof JointDataSetHandle || dataSet instanceof DerivedDataSetHandle) && context != null) {
    if (dataSet.getDataSource() != null) {
      session.defineDataSource(session.getModelAdaptor().adaptDataSource(dataSet.getDataSource()));
    }
    session.defineDataSet(dataSetDesign);
  }
  IQueryResults resultSet=executeQuery(session,queryDefn);
  saveResultToDataItems(dataSet,resultSet);
  return resultSet;
}

Fixed version (ground truth):
/** 
 * @param dataSetHandle
 * @param dataSetDesign
 * @param queryDefn
 * @return
 * @throws BirtException
 */
public IQueryResults execute(DataSetHandle dataSetHandle,IBaseDataSetDesign dataSetDesign,IQueryDefinition queryDefn,ExecutionContext context,DataRequestSession session) throws BirtException {
  if (!(dataSetHandle instanceof JointDataSetHandle || dataSetHandle instanceof DerivedDataSetHandle) && context != null) {
    if (dataSetHandle.getDataSource() != null) {
      session.defineDataSource(session.getModelAdaptor().adaptDataSource(dataSetHandle.getDataSource()));
    }
    session.defineDataSet(dataSetDesign);
  }
  IQueryResults resultSet=executeQuery(session,queryDefn);
  saveResultToDataItems(dataSetHandle,resultSet);
  return resultSet;
}
Program: 68629
Project: 68629
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public String getDefinition(){
  return definition;
}

Fixed version (ground truth):
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public String getDefinition(){
  if (definition == null) {
    return null;
  }
  return definition.trim();
}
Program: 68630
Project: 68630
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public void setDefinition(String newDefinition){
  String oldDefinition=definition;
  definition=newDefinition;
  if (eNotificationRequired())   eNotify(new ENotificationImpl(this,Notification.SET,DataPackage.QUERY__DEFINITION,oldDefinition,definition));
}

Fixed version (ground truth):
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public void setDefinition(String newDefinition){
  String def=newDefinition;
  if (def != null) {
    def=def.trim();
  }
  String oldDefinition=definition;
  definition=def;
  if (eNotificationRequired())   eNotify(new ENotificationImpl(this,Notification.SET,DataPackage.QUERY__DEFINITION,oldDefinition,definition));
}
Program: 68631
Project: 68631
Buggy source:
/** 
 * Adds measure or row/column edge according to query expression.
 */
private void bindExpression(String expr,ICubeQueryDefinition cubeQuery,CubeHandle cube) throws BirtException {
  if (expr != null && expr.length() > 0) {
    String bindingName=null;
    IBinding colBinding=null;
    if (ChartExpressionUtil.isCubeBinding(expr,false)) {
      bindingName=ChartExpressionUtil.getCubeBindingName(expr,false);
      colBinding=registeredBindings.get(bindingName);
    }
 else {
      bindingName=ChartUtil.escapeSpecialCharacters(expr);
      colBinding=new Binding(bindingName);
      colBinding.setDataType(DataType.ANY_TYPE);
      colBinding.setExpression(new ScriptExpression(expr));
      cubeQuery.addBinding(colBinding);
      List<String> nameList=ChartExpressionUtil.getCubeBindingNameList(expr);
      if (nameList.size() == 0) {
        return;
      }
 else       if (nameList.size() == 1) {
        bindingName=nameList.get(0);
        colBinding=registeredBindings.get(bindingName);
      }
 else {
        for (        String bn : nameList) {
          bindBinding(registeredBindings.get(bn),cubeQuery,cube);
        }
        return;
      }
    }
    bindBinding(colBinding,cubeQuery,cube);
  }
}

Fixed version (ground truth):
/** 
 * Adds measure or row/column edge according to query expression.
 */
private void bindExpression(String expression,ICubeQueryDefinition cubeQuery,CubeHandle cube) throws BirtException {
  if (expression == null) {
    return;
  }
  String expr=expression.trim();
  if (expr != null && expr.length() > 0) {
    String bindingName=null;
    IBinding colBinding=null;
    if (ChartExpressionUtil.isCubeBinding(expr,false)) {
      bindingName=ChartExpressionUtil.getCubeBindingName(expr,false);
      colBinding=registeredBindings.get(bindingName);
    }
 else {
      bindingName=ChartUtil.escapeSpecialCharacters(expr);
      colBinding=new Binding(bindingName);
      colBinding.setDataType(DataType.ANY_TYPE);
      colBinding.setExpression(new ScriptExpression(expr));
      cubeQuery.addBinding(colBinding);
      List<String> nameList=ChartExpressionUtil.getCubeBindingNameList(expr);
      if (nameList.size() == 0) {
        return;
      }
 else       if (nameList.size() == 1) {
        bindingName=nameList.get(0);
        colBinding=registeredBindings.get(bindingName);
      }
 else {
        for (        String bn : nameList) {
          bindBinding(registeredBindings.get(bn),cubeQuery,cube);
        }
        return;
      }
    }
    bindBinding(colBinding,cubeQuery,cube);
  }
}
Program: 68633
Project: 68633
Buggy source:
/** 
 * @param members
 * @throws IOException
 */
DimensionPositionSeeker(IDiskArray member) throws IOException {
  IDiskArray members=getSortedDimensionKeys(member);
  this.memberArray=new DimensionKey[Math.min(Constants.MAX_LIST_BUFFER_SIZE,members.size())];
  for (int i=0; i < memberArray.length; i++) {
    memberArray[i]=(DimensionKey)members.get(i);
  }
  if (members.size() > Constants.MAX_LIST_BUFFER_SIZE) {
    this.diskMemberArray=members;
    this.diskPostion=memberArray.length;
    this.position=this.diskPostion;
  }
}

Fixed version (ground truth):
/** 
 * @param members
 * @throws IOException
 */
DimensionPositionSeeker(IDiskArray member) throws IOException {
  IDiskArray members=getSortedDimensionKeys(member);
  String useMemoryOnly=System.getProperty("String_Node_Str");
  if (useMemoryOnly != null && useMemoryOnly.equalsIgnoreCase("String_Node_Str")) {
    this.memberArray=new DimensionKey[members.size()];
  }
 else {
    this.memberArray=new DimensionKey[Math.min(Constants.MAX_LIST_BUFFER_SIZE,members.size())];
  }
  for (int i=0; i < memberArray.length; i++) {
    memberArray[i]=(DimensionKey)members.get(i);
  }
  if (members.size() > Constants.MAX_LIST_BUFFER_SIZE) {
    this.diskMemberArray=members;
    this.diskPostion=memberArray.length;
    this.position=this.diskPostion;
  }
}
Program: 68634
Project: 68634
Buggy source:
private void restructMemoryDelegate(){
  byte[] tmpBuf=new byte[memoryDelegate.length * 2];
  System.arraycopy(memoryDelegate,0,tmpBuf,0,memoryDelegate.length);
  memoryDelegate=tmpBuf;
}

Fixed version (ground truth):
private void restructMemoryDelegate(){
  byte[] tmpBuf=null;
  if (memoryDelegate.length * 2 < 0 || memoryDelegate.length * 2l > Integer.MAX_VALUE) {
    tmpBuf=new byte[Integer.MAX_VALUE];
    this.pureMemory=false;
  }
 else {
    tmpBuf=new byte[memoryDelegate.length * 2];
  }
  System.arraycopy(memoryDelegate,0,tmpBuf,0,memoryDelegate.length);
  memoryDelegate=tmpBuf;
}
Program: 68635
Project: 68635
Buggy source:
/** 
 * @param ds
 */
protected void addDataSetSettingPage(DataSetHandle ds){
  IPropertyPage settingPage=new DataSetSettingsPage();
  addPageTo("String_Node_Str",DATASET_SETTINGS_PAGE,Messages.getString("String_Node_Str"),null,settingPage);
}

Fixed version (ground truth):
/** 
 * @param ds
 */
protected void addDataSetSettingPage(DataSetHandle ds){
  IPropertyPage settingPage=new AdvancedDataSetSettingsPage();
  addPageTo("String_Node_Str",DATASET_SETTINGS_PAGE,Messages.getString("String_Node_Str"),null,settingPage);
}
Program: 68636
Project: 68636
Buggy source:
public boolean canLeave(){
  try {
    ((OdaDataSetHandle)((DataSetEditor)getContainer()).getHandle()).setProperty(IOdaDataSetModel.RESULT_SET_NUMBER_PROP,null);
    ((OdaDataSetHandle)((DataSetEditor)getContainer()).getHandle()).setResultSetName(null);
    if (selectResultSetCheckBox == null)     return true;
    if (selectResultSetCheckBox.getSelection()) {
      if (resultSetNumber.getSelection()) {
        ((OdaDataSetHandle)((DataSetEditor)getContainer()).getHandle()).setResultSetNumber(new Integer(this.numberText));
      }
 else       if (resultSetName.getSelection()) {
        ((OdaDataSetHandle)((DataSetEditor)getContainer()).getHandle()).setResultSetName(this.nameText);
      }
    }
    if (changed) {
      Iterator it=((DataSetEditor)getContainer()).getHandle().resultSetIterator();
      while (it.hasNext()) {
        it.remove();
      }
    }
    changed=false;
    if (canFinish())     return super.performOk();
 else     return false;
  }
 catch (  Exception e) {
    return true;
  }
}

Fixed version (ground truth):
public boolean canLeave(){
  try {
    ((OdaDataSetHandle)((DataSetEditor)getContainer()).getHandle()).setProperty(IOdaDataSetModel.RESULT_SET_NUMBER_PROP,null);
    ((OdaDataSetHandle)((DataSetEditor)getContainer()).getHandle()).setResultSetName(null);
    if (!updateResultSetSetting())     return true;
    return canLeavePage();
  }
 catch (  Exception e) {
    return true;
  }
}