nus-yam/ex-repair huggingface dataset:
Program: 68808
Project: 68808
Buggy source:
public static String convertBorderWeight(double width){
  String w=StyleConstant.NULL;
  if (width >= 749 && width < 1499) {
    w="String_Node_Str";
  }
 else   if (width >= 1499 && width < 2249) {
    w="String_Node_Str";
  }
 else   if (width >= 2249) {
    w="String_Node_Str";
  }
 else {
    w="String_Node_Str";
  }
  return w;
}

Fixed version (ground truth):
public static String convertBorderWeight(int width){
  String w=StyleConstant.NULL;
  if (width >= 749 && width < 1499) {
    w="String_Node_Str";
  }
 else   if (width >= 1499 && width < 2249) {
    w="String_Node_Str";
  }
 else   if (width >= 2249) {
    w="String_Node_Str";
  }
 else {
    w="String_Node_Str";
  }
  return w;
}
Program: 68809
Project: 68809
Buggy source:
public void addCaption(String text,IStyle style){
  ContainerSizeInfo rule=getCurrentContainer().getSizeInfo();
  StyleEntry entry=StyleBuilder.createEmptyStyleEntry();
  entry.setProperty(StyleEntry.H_ALIGN_PROP,"String_Node_Str");
  entry.setProperty(StyleEntry.FONT_SIZE_PROP,StyleBuilder.convertFontSize(style.getFontSize()));
  Data data=createData(text,entry);
  data.setSizeInfo(rule);
  addData(data);
}

Fixed version (ground truth):
public void addCaption(String text,IStyle style){
  ContainerSizeInfo rule=getCurrentContainer().getSizeInfo();
  StyleEntry entry=StyleBuilder.createEmptyStyleEntry();
  entry.setProperty(StyleEntry.H_ALIGN_PROP,"String_Node_Str");
  entry.setProperty(StyleEntry.FONT_SIZE_PROP,StyleBuilder.convertFontSize(style.getProperty(IStyle.STYLE_FONT_SIZE)));
  Data data=createData(text,entry);
  data.setSizeInfo(rule);
  addData(data);
}
Program: 68810
Project: 68810
Buggy source:
private float getPadding(String padding){
  float value=0;
  try {
    value=Float.parseFloat(padding) / 50;
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,e.getMessage(),e);
  }
  return value;
}

Fixed version (ground truth):
private int getPadding(CSSValue padding){
  return PropertyUtil.getDimensionValue(padding) / 50;
}
Program: 68811
Project: 68811
Buggy source:
private int getCellWidth(int cellWidth,IStyle style){
  float leftPadding=getPadding(style.getPaddingLeft());
  float rightPadding=getPadding(style.getPaddingRight());
  if (leftPadding > cellWidth) {
    leftPadding=0;
  }
  if (rightPadding > cellWidth) {
    rightPadding=0;
  }
  if ((leftPadding + rightPadding) > cellWidth) {
    rightPadding=0;
  }
  return (int)(cellWidth - leftPadding - rightPadding);
}

Fixed version (ground truth):
private int getCellWidth(int cellWidth,IStyle style){
  int leftPadding=getPadding(style.getProperty(IStyle.STYLE_PADDING_LEFT));
  int rightPadding=getPadding(style.getProperty(IStyle.STYLE_PADDING_RIGHT));
  if (leftPadding > cellWidth) {
    leftPadding=0;
  }
  if (rightPadding > cellWidth) {
    rightPadding=0;
  }
  if ((leftPadding + rightPadding) > cellWidth) {
    rightPadding=0;
  }
  return (int)(cellWidth - leftPadding - rightPadding);
}
Program: 68812
Project: 68812
Buggy source:
private void writePosition(String verticalAlign,CSSValue fontSize){
  int size=WordUtil.parseFontSize(((FloatValue)fontSize).getFloatValue());
  if ("String_Node_Str".equalsIgnoreCase(verticalAlign)) {
    writeAttrTag("String_Node_Str",(int)(size * 1 / 3));
  }
 else   if ("String_Node_Str".equalsIgnoreCase(verticalAlign)) {
    writeAttrTag("String_Node_Str",(int)(-size * 1 / 3));
  }
}

Fixed version (ground truth):
private void writePosition(String verticalAlign,CSSValue fontSize){
  int size=WordUtil.parseFontSize(PropertyUtil.getDimensionValue(fontSize));
  if ("String_Node_Str".equalsIgnoreCase(verticalAlign)) {
    writeAttrTag("String_Node_Str",(int)(size * 1 / 3));
  }
 else   if ("String_Node_Str".equalsIgnoreCase(verticalAlign)) {
    writeAttrTag("String_Node_Str",(int)(-size * 1 / 3));
  }
}
Program: 68813
Project: 68813
Buggy source:
private void writeLetterSpacing(IStyle style){
  CSSValue letterSpacing=style.getProperty(StyleConstants.STYLE_LETTER_SPACING);
  writeAttrTag("String_Node_Str",WordUtil.parseSpacing(((FloatValue)letterSpacing).getFloatValue()));
}

Fixed version (ground truth):
private void writeLetterSpacing(IStyle style){
  int letterSpacing=PropertyUtil.getDimensionValue(style.getProperty(StyleConstants.STYLE_LETTER_SPACING));
  writeAttrTag("String_Node_Str",WordUtil.parseSpacing(letterSpacing));
}
Program: 68814
Project: 68814
Buggy source:
private void writeBorderProperty(String style,String color,CSSValue width,int margin){
  writer.attribute("String_Node_Str",WordUtil.parseBorderStyle(style));
  writer.attribute("String_Node_Str",WordUtil.parseBorderSize(((FloatValue)width).getFloatValue()));
  writer.attribute("String_Node_Str",validateBorderSpace(margin));
  writer.attribute("String_Node_Str",WordUtil.parseColor(color));
}

Fixed version (ground truth):
private void writeBorderProperty(String style,String color,CSSValue width,int margin){
  writer.attribute("String_Node_Str",WordUtil.parseBorderStyle(style));
  writer.attribute("String_Node_Str",WordUtil.parseBorderSize(PropertyUtil.getDimensionValue(width)));
  writer.attribute("String_Node_Str",validateBorderSpace(margin));
  writer.attribute("String_Node_Str",WordUtil.parseColor(color));
}
Program: 68815
Project: 68815
Buggy source:
private void drawImageBorderStyle(String pos,String style,CSSValue width){
  String direct="String_Node_Str" + pos;
  writer.openTag(direct);
  writer.attribute("String_Node_Str",WordUtil.parseImageBorderStyle(style));
  writer.attribute("String_Node_Str",WordUtil.parseBorderSize(((FloatValue)width).getFloatValue()));
  writer.closeTag(direct);
}

Fixed version (ground truth):
private void drawImageBorderStyle(String pos,String style,CSSValue width){
  String direct="String_Node_Str" + pos;
  writer.openTag(direct);
  writer.attribute("String_Node_Str",WordUtil.parseImageBorderStyle(style));
  writer.attribute("String_Node_Str",WordUtil.parseBorderSize(PropertyUtil.getDimensionValue(width)));
  writer.closeTag(direct);
}
Program: 68816
Project: 68816
Buggy source:
protected void writeFontSize(IStyle style){
  CSSValue fontSize=style.getProperty(StyleConstants.STYLE_FONT_SIZE);
  int size=WordUtil.parseFontSize(((FloatValue)fontSize).getFloatValue());
  writeAttrTag("String_Node_Str",size);
  writeAttrTag("String_Node_Str",size);
}

Fixed version (ground truth):
protected void writeFontSize(IStyle style){
  CSSValue fontSize=style.getProperty(StyleConstants.STYLE_FONT_SIZE);
  int size=WordUtil.parseFontSize(PropertyUtil.getDimensionValue(fontSize));
  writeAttrTag("String_Node_Str",size);
  writeAttrTag("String_Node_Str",size);
}
Program: 68817
Project: 68817
Buggy source:
public void flush() throws BirtException {
  if (page != null) {
    context.getPageHintManager().addTableColumnHints(columnHints);
    context.getPageHintManager().generatePageRowHints(getTableKeys());
    page.flush();
    pageBreakEvent();
    if (!page.finished) {
      context.setPageNumber(context.getPageNumber() + 1);
      context.setPageCount(context.getPageCount() + 1);
    }
    generator.reset();
    context.getPageHintManager().clearPageHint();
    currentNode=null;
  }
}

Fixed version (ground truth):
public void flush() throws BirtException {
  if (page != null) {
    context.getPageHintManager().addTableColumnHints(columnHints);
    context.getPageHintManager().generatePageRowHints(getTableKeys());
    updatePageNumber();
    page.flush();
    pageBreakEvent();
    if (!page.finished) {
      context.setPageNumber(context.getPageNumber() + 1);
      context.setPageCount(context.getPageCount() + 1);
    }
    generator.reset();
    context.getPageHintManager().clearPageHint();
    currentNode=null;
  }
}
Program: 68819
Project: 68819
Buggy source:
void setAxisCoordinate(double _dAxisRenderingCoordinate){
  dAxisRenderingCoordinate=_dAxisRenderingCoordinate;
}

Fixed version (ground truth):
public void setAxisCoordinate(double _dAxisRenderingCoordinate){
  dAxisRenderingCoordinate=_dAxisRenderingCoordinate;
}
Program: 68820
Project: 68820
Buggy source:
/** 
 * The axes correspond to the lines/planes being rendered within the plot block. This is rendered with Z-order=2
 */
private final void renderAxesStructure(IPrimitiveRenderer ipr,Plot p) throws ChartException {
  final PlotWithAxes pwa=(PlotWithAxes)getComputations();
  final AllAxes aax=pwa.getAxes();
  if (pwa.getDimension() == IConstants.THREE_D) {
    renderEachAxis(ipr,p,aax.getPrimaryBase(),IConstants.BASE_AXIS);
    renderEachAxis(ipr,p,aax.getAncillaryBase(),IConstants.ANCILLARY_AXIS);
    renderEachAxis(ipr,p,aax.getPrimaryOrthogonal(),IConstants.ORTHOGONAL_AXIS);
  }
 else {
    final int iCount=aax.getOverlayCount() + 2;
    final OneAxis[] oaxa=new OneAxis[iCount];
    oaxa[0]=aax.getPrimaryBase();
    oaxa[1]=aax.getPrimaryOrthogonal();
    for (int i=0; i < iCount - 2; i++) {
      oaxa[i + 2]=aax.getOverlay(i);
    }
    for (int i=0; i < iCount; i++) {
      renderEachAxis(ipr,p,oaxa[i],IConstants.AXIS);
    }
  }
}

Fixed version (ground truth):
/** 
 * The axes correspond to the lines/planes being rendered within the plot block. This is rendered with Z-order=2
 */
private final void renderAxesStructure(IPrimitiveRenderer ipr,Plot p) throws ChartException {
  final PlotWithAxes pwa=(PlotWithAxes)getComputations();
  final AllAxes aax=pwa.getAxes();
  if (pwa.getDimension() == IConstants.THREE_D) {
    renderEachAxis(ipr,p,aax.getPrimaryBase(),IConstants.BASE_AXIS);
    renderEachAxis(ipr,p,aax.getAncillaryBase(),IConstants.ANCILLARY_AXIS);
    renderEachAxis(ipr,p,aax.getPrimaryOrthogonal(),IConstants.ORTHOGONAL_AXIS);
  }
 else {
    final int iCount=aax.getOverlayCount() + 2;
    final OneAxis[] oaxa=new OneAxis[iCount];
    oaxa[0]=aax.getPrimaryBase();
    oaxa[1]=aax.getPrimaryOrthogonal();
    for (int i=0; i < iCount - 2; i++) {
      oaxa[i + 2]=aax.getOverlay(i);
      IntersectionValue iv=oaxa[i + 2].getIntersectionValue();
      if (iv.getType() == IConstants.VALUE) {
        oaxa[i + 2].setAxisCoordinate(Methods.getLocation(aax.getPrimaryBase().getScale(),iv.getValue()));
      }
    }
    for (int i=0; i < iCount; i++) {
      renderEachAxis(ipr,p,oaxa[i],IConstants.AXIS);
    }
  }
}
Program: 68821
Project: 68821
Buggy source:
@Override public void onCreate(IOnCreateEvent event) throws BirtException {
  DesignElementHandle modelHandle=event.getHandle();
  if (!(modelHandle instanceof ExtendedItemHandle)) {
    return;
  }
  CrosstabReportItemHandle crosstab=(CrosstabReportItemHandle)((ExtendedItemHandle)modelHandle).getReportItem();
  IReportEventContext context=event.getContext();
  CrosstabCreationHandler handler=new CrosstabCreationHandler((ExtendedItemHandle)modelHandle,context.getApplicationClassLoader());
  handler.handleCrosstab(crosstab,(ITableContent)event.getContent(),context);
}

Fixed version (ground truth):
@Override public void onCreate(IOnCreateEvent event) throws BirtException {
  DesignElementHandle modelHandle=event.getHandle();
  if (!(modelHandle instanceof ExtendedItemHandle)) {
    return;
  }
  CrosstabReportItemHandle crosstab=(CrosstabReportItemHandle)((ExtendedItemHandle)modelHandle).getReportItem();
  IReportEventContext context=event.getContext();
  CrosstabCreationHandler handler=new CrosstabCreationHandler((ExtendedItemHandle)modelHandle,context.getApplicationClassLoader());
  handler.handleCrosstab(crosstab,(ITableContent)event.getContent(),context,RunningState.CREATE);
}
Program: 68822
Project: 68822
Buggy source:
@Override public void onRender(IOnRenderEvent event) throws BirtException {
  DesignElementHandle modelHandle=event.getHandle();
  if (!(modelHandle instanceof ExtendedItemHandle)) {
    return;
  }
  CrosstabReportItemHandle crosstab=(CrosstabReportItemHandle)((ExtendedItemHandle)modelHandle).getReportItem();
  IReportEventContext context=event.getContext();
  CrosstabRenderingHandler handler=new CrosstabRenderingHandler((ExtendedItemHandle)modelHandle,context.getApplicationClassLoader());
  handler.handleCrosstab(crosstab,(ITableContent)event.getContent(),context);
}

Fixed version (ground truth):
@Override public void onRender(IOnRenderEvent event) throws BirtException {
  DesignElementHandle modelHandle=event.getHandle();
  if (!(modelHandle instanceof ExtendedItemHandle)) {
    return;
  }
  CrosstabReportItemHandle crosstab=(CrosstabReportItemHandle)((ExtendedItemHandle)modelHandle).getReportItem();
  IReportEventContext context=event.getContext();
  CrosstabRenderingHandler handler=new CrosstabRenderingHandler((ExtendedItemHandle)modelHandle,context.getApplicationClassLoader());
  handler.handleCrosstab(crosstab,(ITableContent)event.getContent(),context,RunningState.RENDER);
}
Program: 68823
Project: 68823
Buggy source:
public CrosstabInstanceImpl(ITableContent content,DesignElementHandle modelHandle){
  this.content=content;
  this.modelHandle=modelHandle;
}

Fixed version (ground truth):
public CrosstabInstanceImpl(ITableContent content,DesignElementHandle modelHandle,RunningState runningState){
  this.content=content;
  this.modelHandle=modelHandle;
  this.runningState=runningState;
}
Program: 68824
Project: 68824
Buggy source:
public void setRepeatColumnHeader(boolean repeat){
  content.setHeaderRepeat(repeat);
}

Fixed version (ground truth):
public void setRepeatColumnHeader(boolean repeat){
  if (runningState == RunningState.CREATE) {
    content.setHeaderRepeat(repeat);
  }
 else   if (runningState == RunningState.RENDER) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
 else {
    throw new UnsupportedOperationException("String_Node_Str");
  }
}
Program: 68825
Project: 68825
Buggy source:
public void handleCrosstab(CrosstabReportItemHandle crosstab,ITableContent content,IReportContext context) throws BirtException {
  if (handler == null || crosstab == null) {
    return;
  }
  ICrosstabInstance crosstabInst=new CrosstabInstanceImpl(content,crosstab.getModelHandle());
  handler.callFunction(CrosstabScriptHandler.ON_CREATE_CROSSTAB,crosstabInst,context);
}

Fixed version (ground truth):
public void handleCrosstab(CrosstabReportItemHandle crosstab,ITableContent content,IReportContext context,RunningState runningState) throws BirtException {
  if (handler == null || crosstab == null) {
    return;
  }
  ICrosstabInstance crosstabInst=new CrosstabInstanceImpl(content,crosstab.getModelHandle(),runningState);
  handler.callFunction(CrosstabScriptHandler.ON_CREATE_CROSSTAB,crosstabInst,context);
}
Program: 68826
Project: 68826
Buggy source:
public void handleCrosstab(CrosstabReportItemHandle crosstab,ITableContent content,IReportContext context) throws BirtException {
  if (handler == null || crosstab == null) {
    return;
  }
  ICrosstabInstance crosstabInst=new CrosstabInstanceImpl(content,crosstab.getModelHandle());
  handler.callFunction(CrosstabScriptHandler.ON_RENDER_CROSSTAB,crosstabInst,context);
}

Fixed version (ground truth):
public void handleCrosstab(CrosstabReportItemHandle crosstab,ITableContent content,IReportContext context,RunningState runningState) throws BirtException {
  if (handler == null || crosstab == null) {
    return;
  }
  ICrosstabInstance crosstabInst=new CrosstabInstanceImpl(content,crosstab.getModelHandle(),runningState);
  handler.callFunction(CrosstabScriptHandler.ON_RENDER_CROSSTAB,crosstabInst,context);
}
Program: 68827
Project: 68827
Buggy source:
/** 
 * Implements   {@link ValueManager#computeValue(CSSStylableElement,String,CSSEngine,int,StyleMap,Value)}.
 */
public Value computeValue(CSSStylableElement elt,CSSEngine engine,int idx,Value value){
  if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
switch (value.getPrimitiveType()) {
case CSSPrimitiveValue.CSS_NUMBER:
      return value;
case CSSPrimitiveValue.CSS_PX:
    float v=value.getFloatValue();
  CSSContext cx=engine.getCSSContext();
float ratio=cx.getPixelUnitToMillimeter();
return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,v * ratio / 25.4f * 72000.0f);
case CSSPrimitiveValue.CSS_MM:
v=value.getFloatValue();
return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,v / 25.4f * 72000.0f);
case CSSPrimitiveValue.CSS_CM:
v=value.getFloatValue();
return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,v / 2.54f * 72000.0f);
case CSSPrimitiveValue.CSS_IN:
v=value.getFloatValue();
return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,v * 72000.0f);
case CSSPrimitiveValue.CSS_PT:
v=value.getFloatValue();
return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,v * 1000.0f);
case CSSPrimitiveValue.CSS_PC:
v=value.getFloatValue();
return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,v * 12.0f * 1000.0f);
case CSSPrimitiveValue.CSS_EMS:
v=value.getFloatValue();
Value fontSize=(Value)elt.getComputedStyle().getProperty(IStyle.STYLE_FONT_SIZE);
float fs=fontSize.getFloatValue();
return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,v * fs);
case CSSPrimitiveValue.CSS_EXS:
v=value.getFloatValue();
fontSize=(Value)elt.getComputedStyle().getProperty(IStyle.STYLE_FONT_SIZE);
fs=fontSize.getFloatValue();
return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,v * fs * 0.5f);
}
}
return value;
}

Fixed version (ground truth):
/** 
 * Implements   {@link ValueManager#computeValue(CSSStylableElement,String,CSSEngine,int,StyleMap,Value)}.
 */
public Value computeValue(CSSStylableElement elt,CSSEngine engine,int idx,Value value){
  if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
switch (value.getPrimitiveType()) {
case CSSPrimitiveValue.CSS_NUMBER:
case CSSPrimitiveValue.CSS_PX:
case CSSPrimitiveValue.CSS_MM:
case CSSPrimitiveValue.CSS_CM:
case CSSPrimitiveValue.CSS_IN:
case CSSPrimitiveValue.CSS_PT:
case CSSPrimitiveValue.CSS_PC:
      return value;
case CSSPrimitiveValue.CSS_EMS:
    float v=value.getFloatValue();
  Value fontSize=(Value)elt.getComputedStyle().getProperty(IStyle.STYLE_FONT_SIZE);
float fs=fontSize.getFloatValue();
return new FloatValue(fontSize.getPrimitiveType(),v * fs);
case CSSPrimitiveValue.CSS_EXS:
v=value.getFloatValue();
fontSize=(Value)elt.getComputedStyle().getProperty(IStyle.STYLE_FONT_SIZE);
fs=fontSize.getFloatValue();
return new FloatValue(fontSize.getPrimitiveType(),v * fs * 0.5f);
}
}
return value;
}
Program: 68828
Project: 68828
Buggy source:
protected void doExecute() throws BirtException {
  IReportItemExecutor executor=bodyExecutor;
  IContent content;
  while (executor.hasNextChild()) {
    executor=executor.getNextChild();
    parentExecutors.add(executor);
    content=executor.execute();
    DocumentExtension docExt=(DocumentExtension)content.getExtension(IContent.DOCUMENT_EXTENSION);
{
      if (docExt != null) {
        if (docExt.getIndex() == offset) {
          bodyContent=content;
          childExecutor=executor;
          break;
        }
      }
    }
  }
}

Fixed version (ground truth):
protected void doExecute() throws BirtException {
  IReportItemExecutor executor=bodyExecutor;
  IContent content=null;
  while (executor.hasNextChild()) {
    executor=executor.getNextChild();
    parentExecutors.add(executor);
    content=executor.execute();
    DocumentExtension docExt=(DocumentExtension)content.getExtension(IContent.DOCUMENT_EXTENSION);
{
      if (docExt != null) {
        if (docExt.getIndex() == offset) {
          bodyContent=content;
          childExecutor=executor;
          break;
        }
      }
    }
  }
  IStyle cs=bodyContent.getComputedStyle();
  IStyle is=bodyContent.getInlineStyle();
  CSSEngine engine=bodyContent.getCSSEngine();
  IStyle mergedStyle=(is != null ? is : new StyleDeclaration(engine));
  for (int i=0; i < StyleConstants.NUMBER_OF_STYLE; i++) {
    if (isNullValue(mergedStyle.getProperty(i)) && engine.isInheritedProperty(i)) {
      mergedStyle.setProperty(i,cs.getProperty(i));
    }
  }
  bodyContent.setInlineStyle(mergedStyle);
}
Program: 68829
Project: 68829
Buggy source:
public void startImage(IImageContent image){
  IStyle style=image.getComputedStyle();
  InlineFlag inlineFlag=getInlineFlag(style);
  String uri=image.getURI();
  String mimeType=image.getMIMEType();
  String extension=image.getExtension();
  String altText=image.getAltText();
  context.addContainer(false);
  if (FlashFile.isFlash(mimeType,uri,extension)) {
    if (altText == null) {
      altText=messageFlashObjectNotSupported;
    }
    wordWriter.drawImage(null,0.0,0.0,null,style,inlineFlag,altText,uri);
    return;
  }
  try {
    Image imageInfo=EmitterUtil.parseImage(image,image.getImageSource(),uri,mimeType,extension);
    byte[] data=imageInfo.getData();
    if (data == null || data.length == 0) {
      wordWriter.drawImage(null,0.0,0.0,null,style,inlineFlag,altText,uri);
      return;
    }
    double height=WordUtil.convertImageSize(image.getHeight(),imageInfo.getHeight());
    double width=WordUtil.convertImageSize(image.getWidth(),imageInfo.getWidth());
    writeBookmark(image);
    writeToc(image);
    HyperlinkInfo hyper=getHyperlink(image);
    wordWriter.drawImage(data,height,width,hyper,style,inlineFlag,altText,uri);
  }
 catch (  IOException e) {
    logger.log(Level.WARNING,e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void startImage(IImageContent image){
  IStyle style=image.getComputedStyle();
  InlineFlag inlineFlag=getInlineFlag(style);
  String uri=image.getURI();
  String mimeType=image.getMIMEType();
  String extension=image.getExtension();
  String altText=image.getAltText();
  double height=WordUtil.convertImageSize(image.getHeight(),0);
  double width=WordUtil.convertImageSize(image.getWidth(),0);
  context.addContainer(false);
  if (FlashFile.isFlash(mimeType,uri,extension)) {
    if (altText == null) {
      altText=messageFlashObjectNotSupported;
    }
    wordWriter.drawImage(null,height,width,null,style,inlineFlag,altText,uri);
    return;
  }
  try {
    Image imageInfo=EmitterUtil.parseImage(image,image.getImageSource(),uri,mimeType,extension);
    byte[] data=imageInfo.getData();
    if (data == null || data.length == 0) {
      wordWriter.drawImage(null,0.0,0.0,null,style,inlineFlag,altText,uri);
      return;
    }
    height=WordUtil.convertImageSize(image.getHeight(),imageInfo.getHeight());
    width=WordUtil.convertImageSize(image.getWidth(),imageInfo.getWidth());
    writeBookmark(image);
    writeToc(image);
    HyperlinkInfo hyper=getHyperlink(image);
    wordWriter.drawImage(data,height,width,hyper,style,inlineFlag,altText,uri);
  }
 catch (  IOException e) {
    logger.log(Level.WARNING,e.getLocalizedMessage());
    wordWriter.drawImage(null,height,width,null,style,inlineFlag,altText,uri);
  }
}
Program: 68830
Project: 68830
Buggy source:
private void gRestore(){
  out.println("String_Node_Str");
}

Fixed version (ground truth):
private void gRestore(){
  out.println("String_Node_Str");
  graphics.pop();
}
Program: 68831
Project: 68831
Buggy source:
public void clipRestore(){
  out.println("String_Node_Str");
  graphics.pop();
}

Fixed version (ground truth):
public void clipRestore(){
  gRestore();
}
Program: 68832
Project: 68832
Buggy source:
private void gSave(){
  out.println("String_Node_Str");
}

Fixed version (ground truth):
private void gSave(){
  out.println("String_Node_Str");
  graphics.push(new Graphic());
}
Program: 68833
Project: 68833
Buggy source:
public void clipSave(){
  out.println("String_Node_Str");
  graphics.push(new Graphic());
}

Fixed version (ground truth):
public void clipSave(){
  gSave();
}
Program: 68834
Project: 68834
Buggy source:
/** 
 * Tests if two objects overlap in Z diretion.
 */
public boolean testZOverlap(Object3D near){
  return !((this.getZMin() > near.getZMax()) || (near.getZMin() > this.getZMax()));
}

Fixed version (ground truth):
/** 
 * Tests if two objects overlap in Z direction.
 */
public boolean testZOverlap(Object3D near){
  return !((this.getZMin() >= near.getZMax()) || (near.getZMin() >= this.getZMax()));
}
Program: 68835
Project: 68835
Buggy source:
/** 
 * Tests if two objects overlap in X diretion.
 */
protected boolean testXOverlap(Object3D near){
  return !(this.getXMin() > near.getXMax() || near.getXMin() > this.getXMax());
}

Fixed version (ground truth):
/** 
 * Tests if two objects overlap in X direction.
 */
protected boolean testXOverlap(Object3D near){
  return !(this.getXMin() >= near.getXMax() || near.getXMin() >= this.getXMax());
}
Program: 68836
Project: 68836
Buggy source:
/** 
 * Tests if two objects overlap in Y diretion.
 */
protected boolean testYOverlap(Object3D near){
  return !(this.getYMin() > near.getYMax() || near.getYMin() > this.getYMax());
}

Fixed version (ground truth):
/** 
 * Tests if two objects overlap in Y direction.
 */
protected boolean testYOverlap(Object3D near){
  return !(this.getYMin() >= near.getYMax() || near.getYMin() >= this.getYMax());
}
Program: 68837
Project: 68837
Buggy source:
public void createControl(Composite parent){
  getDataSheet().setChartModel(getChartModel());
  getDataSheet().addListener(this);
  if (topControl == null || topControl.isDisposed()) {
    topControl=new Composite(parent,SWT.NONE);
    GridLayout gridLayout=new GridLayout(3,false);
    gridLayout.marginWidth=0;
    gridLayout.marginHeight=0;
    topControl.setLayout(gridLayout);
    topControl.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL));
    dynamicArea=createDataComponentsUI();
    getCustomizeUI().init();
    foSashForm=new SashForm(topControl,SWT.VERTICAL);
{
      GridLayout layout=new GridLayout();
      foSashForm.setLayout(layout);
      GridData gridData=new GridData(GridData.FILL_BOTH);
      foSashForm.setLayoutData(gridData);
    }
    foSashForm.addListener(SWT.Resize,this);
    placeComponents();
    previewPainter=createPreviewPainter();
  }
 else {
    customizeUI();
  }
  resize();
  if (getChartModel() instanceof ChartWithAxes) {
    checkDataTypeForChartWithAxes();
  }
  doPreview();
  DataDefinitionTextManager.getInstance().refreshAll();
  ChartUIUtil.checkGroupType((ChartWizardContext)getContext(),getChartModel());
  ChartUIUtil.checkAggregateType((ChartWizardContext)getContext());
  bindHelp();
}

Fixed version (ground truth):
public void createControl(Composite parent){
  getDataSheet().setChartModel(getChartModel());
  getDataSheet().addListener(this);
  if (topControl == null || topControl.isDisposed()) {
    topControl=new Composite(parent,SWT.NONE);
    GridLayout gridLayout=new GridLayout(3,false);
    gridLayout.marginWidth=0;
    gridLayout.marginHeight=0;
    topControl.setLayout(gridLayout);
    topControl.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL));
    dynamicArea=createDataComponentsUI();
    getCustomizeUI().init();
    foSashForm=new SashForm(topControl,SWT.VERTICAL);
{
      GridLayout layout=new GridLayout();
      foSashForm.setLayout(layout);
      GridData gridData=new GridData(GridData.FILL_BOTH);
      gridData.widthHint=800;
      foSashForm.setLayoutData(gridData);
    }
    foSashForm.addListener(SWT.Resize,this);
    placeComponents();
    previewPainter=createPreviewPainter();
  }
 else {
    customizeUI();
  }
  resize();
  if (getChartModel() instanceof ChartWithAxes) {
    checkDataTypeForChartWithAxes();
  }
  doPreview();
  DataDefinitionTextManager.getInstance().refreshAll();
  ChartUIUtil.checkGroupType((ChartWizardContext)getContext(),getChartModel());
  ChartUIUtil.checkAggregateType((ChartWizardContext)getContext());
  bindHelp();
}
Program: 68838
Project: 68838
Buggy source:
private void createDataArea(){
  fDataArea=new ScrolledComposite(foSashForm,SWT.VERTICAL);
{
    GridLayout gl=new GridLayout();
    fDataArea.setLayout(gl);
    GridData gd=new GridData(GridData.FILL_VERTICAL);
    fDataArea.setLayoutData(gd);
    fDataArea.setExpandHorizontal(true);
    fDataArea.setExpandVertical(true);
  }
  Composite dataComposite=new Composite(fDataArea,SWT.NONE);
{
    GridLayout gl=new GridLayout(3,false);
    dataComposite.setLayout(gl);
    GridData gd=new GridData(GridData.FILL_BOTH);
    dataComposite.setLayoutData(gd);
  }
  fDataArea.setContent(dataComposite);
  GridData gd=new GridData(GridData.FILL_HORIZONTAL);
  gd.widthHint=fLeftSize.x;
  new Label(dataComposite,SWT.NONE).setLayoutData(gd);
  getDataSheet().createDataSelector(dataComposite);
  gd=new GridData(GridData.FILL_HORIZONTAL);
  gd.widthHint=fRightSize.x;
  new Label(dataComposite,SWT.NONE).setLayoutData(gd);
  new Label(dataComposite,SWT.NONE);
  getDataSheet().createDataDragSource(dataComposite);
  getDataSheet().createActionButtons(dataComposite);
  new Label(dataComposite,SWT.NONE);
  Point size=dataComposite.computeSize(SWT.DEFAULT,SWT.DEFAULT);
  fDataArea.setMinSize(size);
}

Fixed version (ground truth):
private void createDataArea(){
  fDataArea=new ScrolledComposite(foSashForm,SWT.VERTICAL);
{
    GridLayout gl=new GridLayout();
    fDataArea.setLayout(gl);
    GridData gd=new GridData(GridData.FILL_VERTICAL);
    fDataArea.setLayoutData(gd);
    fDataArea.setExpandHorizontal(true);
    fDataArea.setExpandVertical(true);
  }
  Composite dataComposite=new Composite(fDataArea,SWT.NONE);
{
    GridLayout gl=new GridLayout(2,false);
    gl.marginLeft=fLeftSize.x;
    dataComposite.setLayout(gl);
    GridData gd=new GridData(GridData.FILL_BOTH);
    dataComposite.setLayoutData(gd);
  }
  fDataArea.setContent(dataComposite);
  getDataSheet().createDataSelector(dataComposite);
  GridData gd=new GridData(GridData.FILL_HORIZONTAL);
  gd.widthHint=fRightSize.x;
  new Label(dataComposite,SWT.NONE).setLayoutData(gd);
  getDataSheet().createDataDragSource(dataComposite);
  getDataSheet().createActionButtons(dataComposite);
  new Label(dataComposite,SWT.NONE);
}
Program: 68839
Project: 68839
Buggy source:
/** 
 * add several common use page for Birt data set editor
 * @param ds
 */
protected void addCommonPages(DataSetHandle ds){
  if (ds instanceof ScriptDataSetHandle) {
    addOutputColumnsPage();
    addParametersPage();
    addFiltersPage();
    addDataSetSettingPage(ds);
    addResultSetPreviewPage();
  }
 else   if (ds instanceof OdaDataSetHandle) {
    addOutputColumnsPage();
    addComputedColumnsPage();
    if (includeInputParameterPage)     addParametersPage();
    addDataSetFilterPage();
    addPropertyBindingPage();
    addDataSetSettingPage(ds);
    if (includeOutputParameterPage)     addOutputParameterPreviewPage();
    addResultSetPreviewPage();
  }
 else   if (ds instanceof JointDataSetHandle) {
    addJointDataSetPage();
    addOutputColumnsPage();
    addComputedColumnsPage();
    addParametersPage();
    addFiltersPage();
    addResultSetPreviewPage();
  }
 else {
    IPropertyPage[] pages=ExtenalUIUtil.getCommonPages(ds);
    if (pages != null && pages.length > 0) {
      for (int i=0; i < pages.length; i++) {
        addPageTo("String_Node_Str",pages[i].getClass().getName(),pages[i].getName(),null,pages[i]);
      }
      addOutputColumnsPage();
      addComputedColumnsPage();
      addParametersPage();
      addFiltersPage();
      addResultSetPreviewPage();
    }
  }
}

Fixed version (ground truth):
/** 
 * add several common use page for Birt data set editor
 * @param ds
 */
protected void addCommonPages(DataSetHandle ds){
  if (ds instanceof ScriptDataSetHandle) {
    addScriptOutputColumnDefnPage();
    addParametersPage();
    addFiltersPage();
    addDataSetSettingPage(ds);
    addResultSetPreviewPage();
  }
 else   if (ds instanceof OdaDataSetHandle) {
    addOutputColumnsPage();
    addComputedColumnsPage();
    if (includeInputParameterPage)     addParametersPage();
    addDataSetFilterPage();
    addPropertyBindingPage();
    addDataSetSettingPage(ds);
    if (includeOutputParameterPage)     addOutputParameterPreviewPage();
    addResultSetPreviewPage();
  }
 else   if (ds instanceof JointDataSetHandle) {
    addJointDataSetPage();
    addOutputColumnsPage();
    addComputedColumnsPage();
    addParametersPage();
    addFiltersPage();
    addResultSetPreviewPage();
  }
 else {
    IPropertyPage[] pages=ExtenalUIUtil.getCommonPages(ds);
    if (pages != null && pages.length > 0) {
      for (int i=0; i < pages.length; i++) {
        addPageTo("String_Node_Str",pages[i].getClass().getName(),pages[i].getName(),null,pages[i]);
      }
      addOutputColumnsPage();
      addComputedColumnsPage();
      addParametersPage();
      addFiltersPage();
      addResultSetPreviewPage();
    }
  }
}
Program: 68840
Project: 68840
Buggy source:
protected void addOutputColumnsPage(){
  addPageTo("String_Node_Str",OUTPUTCOLUMN_PAGE,Messages.getString("String_Node_Str"),null,new AdvancedOutputColumnDefnPage());
}

Fixed version (ground truth):
protected void addOutputColumnsPage(){
  addPageTo("String_Node_Str",OUTPUTCOLUMN_PAGE,Messages.getString("String_Node_Str"),null,new AdvancedDataSetOutputColumnsPage());
}
Program: 68841
Project: 68841
Buggy source:
protected void verticalAlign(){
  Iterator iter=getChildren();
  while (iter.hasNext()) {
    AbstractArea child=(AbstractArea)iter.next();
    CSSValue vAlign=child.getVerticalAlign();
    if (IStyle.TOP_VALUE.equals(vAlign)) {
      continue;
    }
    int spacing=getContentHeight() - child.getAllocatedHeight();
    if (spacing < 0) {
      spacing=0;
    }
    if (vAlign == null || IStyle.BASELINE_VALUE.equals(vAlign)) {
      int lineHeight=parent.getLineHeight();
      if (lineHeight > 0) {
        child.setPosition(child.getX(),getBaseLine() - child.getBaseLine() + spacing / 2);
      }
 else {
        child.setPosition(child.getX(),getBaseLine() - child.getBaseLine());
      }
    }
 else     if (IStyle.BOTTOM_VALUE.equals(vAlign)) {
      child.setPosition(child.getX(),child.getY() + spacing);
    }
 else     if (IStyle.MIDDLE_VALUE.equals(vAlign)) {
      child.setPosition(child.getX(),child.getY() + spacing / 2);
    }
  }
}

Fixed version (ground truth):
protected void verticalAlign(){
  Iterator iter=getChildren();
  while (iter.hasNext()) {
    AbstractArea child=(AbstractArea)iter.next();
    CSSValue vAlign=child.getVerticalAlign();
    if (IStyle.TOP_VALUE.equals(vAlign)) {
      continue;
    }
    int spacing=getContentHeight() - child.getAllocatedHeight();
    if (spacing < 0) {
      spacing=0;
    }
    if ((vAlign == null && !isImageContainer(child)) || IStyle.BASELINE_VALUE.equals(vAlign)) {
      int lineHeight=parent.getLineHeight();
      if (lineHeight > 0) {
        child.setPosition(child.getX(),getBaseLine() - child.getBaseLine() + spacing / 2);
      }
 else {
        child.setPosition(child.getX(),getBaseLine() - child.getBaseLine());
      }
    }
 else     if (IStyle.BOTTOM_VALUE.equals(vAlign)) {
      child.setPosition(child.getX(),child.getY() + spacing);
    }
 else     if (IStyle.MIDDLE_VALUE.equals(vAlign)) {
      child.setPosition(child.getX(),child.getY() + spacing / 2);
    }
  }
}
Program: 68842
Project: 68842
Buggy source:
/** 
 * Create a Report Engine using a configuration. The user must set the BIRT_HOME in the EngineConfig.
 * @param config an engine configuration object used to configure the engine
 */
public ReportEngine(EngineConfig config){
  if (config == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.config=config;
  beans=new HashMap<String,Object>();
  mergeConfigToAppContext();
  intializeLogger();
  logger.log(Level.FINE,"String_Node_Str",config);
  this.helper=new ReportEngineHelper(this);
  openedDocuments=new LinkedObjectManager<ReportDocumentReader>();
}

Fixed version (ground truth):
/** 
 * Create a Report Engine using a configuration. The user must set the BIRT_HOME in the EngineConfig.
 * @param config an engine configuration object used to configure the engine
 */
public ReportEngine(EngineConfig config){
  if (config == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.config=config;
  beans=new HashMap<String,Object>();
  mergeConfigToAppContext();
  intializeLogger();
  logger.log(Level.FINE,"String_Node_Str",config);
  this.helper=new ReportEngineHelper(this);
  openedDocuments=new LinkedObjectManager<ReportDocumentReader>();
  IStatusHandler handler=config.getStatusHandler();
  if (handler != null) {
    handler.initialize();
  }
}
Program: 68844
Project: 68844
Buggy source:
protected void justify(){
  int spacing=width - currentIP;
  int blankNumber=getBlankNumber(this);
  if (blankNumber > 0) {
    int wordSpacing=spacing / blankNumber;
    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;
      adjustLetterSpacing(letterSpacing,this);
    }
  }
}
Program: 68845
Project: 68845
Buggy source:
private int adjustWordSpacing(int wordSpacing,ContainerArea area){
  if (wordSpacing == 0)   return 0;
  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 blankNumber=text.split("String_Node_Str").length - 1;
      if (blankNumber > 0) {
        TextStyle style=new TextStyle(textArea.getStyle());
        int original=style.getWordSpacing();
        style.setWordSpacing(original + wordSpacing);
        textArea.setStyle(style);
        int spacing=wordSpacing * blankNumber;
        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=adjustWordSpacing(wordSpacing,(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 adjustWordSpacing(int wordSpacing,ContainerArea area){
  if (wordSpacing == 0)   return 0;
  Iterator iter=area.getChildren();
  int delta=0;
  while (iter.hasNext()) {
    AbstractArea child=(AbstractArea)iter.next();
    if (child instanceof TextArea) {
      TextArea textArea=(TextArea)child;
      int whiteSpaceNumber=textArea.getWhiteSpaceNumber();
      if (whiteSpaceNumber > 0) {
        TextStyle style=new TextStyle(textArea.getStyle());
        int original=style.getWordSpacing();
        style.setWordSpacing(original + wordSpacing);
        textArea.setStyle(style);
        int spacing=wordSpacing * whiteSpaceNumber;
        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=adjustWordSpacing(wordSpacing,(ContainerArea)child);
      child.setWidth(child.getWidth() + spacing);
      delta+=spacing;
    }
 else {
      child.setPosition(child.getX() + delta,child.getY());
    }
  }
  return delta;
}
Program: 68846
Project: 68846
Buggy source:
/** 
 * Gets the text in visual order.
 * @param text the original text.
 * @return the text in visual order.
 */
public String getText(){
  if ((runLevel & 1) == 0) {
    return calculateText();
  }
 else {
    return flip(calculateText());
  }
}

Fixed version (ground truth):
/** 
 * Gets the text in visual order.
 * @param text the original text.
 * @return the text in visual order.
 */
public String getText(){
  if (cachedText == null) {
    if ((runLevel & 1) == 0) {
      cachedText=calculateText();
    }
 else {
      cachedText=flip(calculateText());
    }
  }
  return cachedText;
}
Program: 68848
Project: 68848
Buggy source:
public void startListBand(IListBandContent listBand){
  engine.addCell(0,1,0,listBand.getComputedStyle());
}

Fixed version (ground truth):
public void startListBand(IListBandContent listBand){
  engine.addCell(0,1,1,listBand.getComputedStyle());
}
Program: 68849
Project: 68849
Buggy source:
protected boolean doAction() throws Exception {
  if (Policy.TRACING_ACTIONS) {
    System.out.println("String_Node_Str");
  }
  DataSetHandle dsHandle=(DataSetHandle)getSelection();
  if (!(dsHandle instanceof JointDataSetHandle) && !(dsHandle instanceof DerivedDataSetHandle) && dsHandle.getDataSource() == null) {
    try {
      List dataSourceList=DEUtil.getDataSources();
      String[] names=new String[dataSourceList.size()];
      for (int i=0; i < names.length; i++) {
        names[i]=((DataSourceHandle)dataSourceList.get(i)).getName();
      }
      DataSourceSelectionDialog dataSorucedialog=new DataSourceSelectionDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(),Messages.getString("String_Node_Str"),names);
      if (dataSorucedialog.open() == Dialog.CANCEL)       return false;
      dsHandle.setDataSource(dataSorucedialog.getResult().toString());
    }
 catch (    SemanticException e) {
    }
  }
  DataSetEditor dialog=new DataSetEditor(PlatformUI.getWorkbench().getDisplay().getActiveShell(),dsHandle,false);
  return (dialog.open() == IDialogConstants.OK_ID);
}

Fixed version (ground truth):
protected boolean doAction() throws Exception {
  if (Policy.TRACING_ACTIONS) {
    System.out.println("String_Node_Str");
  }
  DataSetHandle dsHandle=(DataSetHandle)getSelection();
  if (!(dsHandle instanceof JointDataSetHandle) && !(dsHandle instanceof DerivedDataSetHandle) && dsHandle.getDataSource() == null) {
    try {
      List dataSourceList=DEUtil.getDataSources();
      String[] names=new String[dataSourceList.size()];
      for (int i=0; i < names.length; i++) {
        names[i]=((DataSourceHandle)dataSourceList.get(i)).getName();
      }
      DataSourceSelectionDialog dataSorucedialog=new DataSourceSelectionDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(),Messages.getString("String_Node_Str"),names);
      if (dataSorucedialog.open() == Dialog.CANCEL)       return false;
      dsHandle.setDataSource(dataSorucedialog.getResult().toString());
    }
 catch (    SemanticException e) {
    }
  }
  DataSetEditor dialog=new AdvancedDataSetEditor(PlatformUI.getWorkbench().getDisplay().getActiveShell(),dsHandle,false);
  return (dialog.open() == IDialogConstants.OK_ID);
}
Program: 68850
Project: 68850
Buggy source:
private boolean editDataSet(List existingDataSets,List newDataSets){
  if (existingDataSets == null || newDataSets == null) {
    return false;
  }
  if (newDataSets.size() <= existingDataSets.size()) {
    return false;
  }
  dataSetHandle=findNewDataSet(existingDataSets,newDataSets);
  if (dataSetHandle == null)   return false;
  if (dataSetHandle instanceof ScriptDataSetHandle) {
    return false;
  }
  DataSetEditor dialog=new DataSetEditor(PlatformUI.getWorkbench().getDisplay().getActiveShell(),dataSetHandle,true);
  return (dialog.open() == Window.OK);
}

Fixed version (ground truth):
private boolean editDataSet(List existingDataSets,List newDataSets){
  if (existingDataSets == null || newDataSets == null) {
    return false;
  }
  if (newDataSets.size() <= existingDataSets.size()) {
    return false;
  }
  dataSetHandle=findNewDataSet(existingDataSets,newDataSets);
  if (dataSetHandle == null)   return false;
  if (dataSetHandle instanceof ScriptDataSetHandle) {
    return false;
  }
  DataSetEditor dialog=new AdvancedDataSetEditor(PlatformUI.getWorkbench().getDisplay().getActiveShell(),dataSetHandle,true);
  return (dialog.open() == Window.OK);
}
Program: 68851
Project: 68851
Buggy source:
private boolean editDataSet(List existingDataSets,List newDataSets){
  if (existingDataSets == null || newDataSets == null) {
    return false;
  }
  if (newDataSets.size() <= existingDataSets.size()) {
    return false;
  }
  dataSetHandle=findNewDataSet(existingDataSets,newDataSets);
  if (dataSetHandle == null)   return false;
  if (dataSetHandle instanceof ScriptDataSetHandle) {
    return false;
  }
  DataSetEditor dialog=new DataSetEditor(PlatformUI.getWorkbench().getDisplay().getActiveShell(),dataSetHandle,false);
  return (dialog.open() == Window.OK);
}

Fixed version (ground truth):
private boolean editDataSet(List existingDataSets,List newDataSets){
  if (existingDataSets == null || newDataSets == null) {
    return false;
  }
  if (newDataSets.size() <= existingDataSets.size()) {
    return false;
  }
  dataSetHandle=findNewDataSet(existingDataSets,newDataSets);
  if (dataSetHandle == null)   return false;
  if (dataSetHandle instanceof ScriptDataSetHandle) {
    return false;
  }
  DataSetEditor dialog=new AdvancedDataSetEditor(PlatformUI.getWorkbench().getDisplay().getActiveShell(),dataSetHandle,false);
  return (dialog.open() == Window.OK);
}
Program: 68852
Project: 68852
Buggy source:
/** 
 * @param ds
 */
private 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 DataSetSettingsPage();
  addPageTo("String_Node_Str",DATASET_SETTINGS_PAGE,Messages.getString("String_Node_Str"),null,settingPage);
}
Program: 68853
Project: 68853
Buggy source:
/** 
 * The constructor.
 * @param parentShell
 */
public DataSetEditor(Shell parentShell,DataSetHandle ds,boolean needToFocusOnOutput){
  super(parentShell,ds);
  ExtenalUIUtil.validateDataSetHandle(ds);
  this.needToFocusOnOutput=needToFocusOnOutput;
  String dataSourceType, dataSetType;
  if (ds instanceof OdaDataSetHandle) {
    OdaDataSourceHandle dataSource=(OdaDataSourceHandle)((OdaDataSetHandle)ds).getDataSource();
    dataSourceType=dataSource.getExtensionID();
    dataSetType=((OdaDataSetHandle)ds).getExtensionID();
  }
 else   if (ds instanceof ScriptDataSetHandle) {
    dataSourceType=DataUIConstants.DATA_SOURCE_SCRIPT;
    dataSetType=DataUIConstants.DATA_SET_SCRIPT;
  }
 else   if (ds instanceof JointDataSetHandle) {
    dataSourceType="String_Node_Str";
    dataSetType="String_Node_Str";
  }
 else {
    dataSourceType=ExtenalUIUtil.getDataSourceType(ds);
    dataSetType=ExtenalUIUtil.getDataSetType(ds);
  }
  boolean containsDataSource=ExtenalUIUtil.containsDataSource(ds);
  if (containsDataSource) {
    addPageTo("String_Node_Str",DATA_SOURCE_SELECTION_PAGE,Messages.getString("String_Node_Str"),null,new DataSetDataSourceSelectionPage());
    if (DesignSessionUtil.hasValidOdaDesignUIExtension(dataSourceType)) {
      addCustomPageODAV3((OdaDataSetHandle)ds,dataSourceType,dataSetType);
    }
 else     addBirtPage(dataSourceType,dataSetType);
  }
  addCommonPage(ds);
  itemModelManager.start(ds);
}

Fixed version (ground truth):
/** 
 * The constructor.
 * @param parentShell
 */
public DataSetEditor(Shell parentShell,DataSetHandle ds,boolean needToFocusOnOutput){
  super(parentShell,ds);
  ExtenalUIUtil.validateDataSetHandle(ds);
  this.needToFocusOnOutput=needToFocusOnOutput;
  String dataSourceType, dataSetType;
  if (ds instanceof OdaDataSetHandle) {
    OdaDataSourceHandle dataSource=(OdaDataSourceHandle)((OdaDataSetHandle)ds).getDataSource();
    dataSourceType=dataSource.getExtensionID();
    dataSetType=((OdaDataSetHandle)ds).getExtensionID();
  }
 else   if (ds instanceof ScriptDataSetHandle) {
    dataSourceType=DataUIConstants.DATA_SOURCE_SCRIPT;
    dataSetType=DataUIConstants.DATA_SET_SCRIPT;
  }
 else   if (ds instanceof JointDataSetHandle) {
    dataSourceType="String_Node_Str";
    dataSetType="String_Node_Str";
  }
 else {
    dataSourceType=ExtenalUIUtil.getDataSourceType(ds);
    dataSetType=ExtenalUIUtil.getDataSetType(ds);
  }
  boolean containsDataSource=ExtenalUIUtil.containsDataSource(ds);
  if (containsDataSource) {
    addPageTo("String_Node_Str",DATA_SOURCE_SELECTION_PAGE,Messages.getString("String_Node_Str"),null,new DataSetDataSourceSelectionPage());
    if (DesignSessionUtil.hasValidOdaDesignUIExtension(dataSourceType)) {
      addCustomPageODAV3((OdaDataSetHandle)ds,dataSourceType,dataSetType);
    }
 else     addBirtPage(dataSourceType,dataSetType);
  }
  addCommonPages(ds);
  setPageFocus();
  itemModelManager.start(ds);
}