nus-yam/ex-repair huggingface dataset:
Program: 71434
Project: 71434
Buggy source:
/** 
 * @param streamType
 * @return
 */
private boolean useTempStream(int streamType){
  if (this.version < VersionManager.VERSION_2_2)   return false;
switch (streamType) {
case DataEngineContext.DATASET_DATA_STREAM:
    return false;
case DataEngineContext.DATASET_META_STREAM:
  return !(this.version < VersionManager.VERSION_2_2_0);
case DataEngineContext.DATASET_DATA_LEN_STREAM:
return false;
case DataEngineContext.EXPR_VALUE_STREAM:
return false;
case DataEngineContext.EXPR_ROWLEN_STREAM:
return this.version < VersionManager.VERSION_2_2_0;
case DataEngineContext.EXPR_META_STREAM:
return true;
case DataEngineContext.GROUP_INFO_STREAM:
return true;
case DataEngineContext.SUBQUERY_INFO_STREAM:
return false;
case DataEngineContext.QUERY_DEFN_STREAM:
return true;
case DataEngineContext.ORIGINAL_QUERY_DEFN_STREAM:
return false;
case DataEngineContext.ROW_INDEX_STREAM:
return true;
case DataEngineContext.QUERYID_INFO_STREAM:
return true;
case DataEngineContext.SUBQUERY_PARENTINDEX_STREAM:
return true;
case DataEngineContext.PLS_GROUPLEVEL_STREAM:
return true;
case DataEngineContext.META_STREAM:
return false;
case DataEngineContext.META_INDEX_STREAM:
return false;
default :
return false;
}
}

Fixed version (ground truth):
/** 
 * @param streamType
 * @return
 */
private boolean useTempStream(int streamType){
  if (this.version < VersionManager.VERSION_2_2)   return false;
switch (streamType) {
case DataEngineContext.DATASET_DATA_STREAM:
    return false;
case DataEngineContext.DATASET_META_STREAM:
  return !(this.version < VersionManager.VERSION_2_2_0);
case DataEngineContext.DATASET_DATA_LEN_STREAM:
return false;
case DataEngineContext.EXPR_VALUE_STREAM:
return false;
case DataEngineContext.EXPR_ROWLEN_STREAM:
return this.version < VersionManager.VERSION_2_2_0;
case DataEngineContext.EXPR_META_STREAM:
return true;
case DataEngineContext.GROUP_INFO_STREAM:
return true;
case DataEngineContext.SUBQUERY_INFO_STREAM:
return false;
case DataEngineContext.QUERY_DEFN_STREAM:
return true;
case DataEngineContext.ORIGINAL_QUERY_DEFN_STREAM:
return false;
case DataEngineContext.ROW_INDEX_STREAM:
return true;
case DataEngineContext.QUERYID_INFO_STREAM:
return true;
case DataEngineContext.SUBQUERY_PARENTINDEX_STREAM:
return true;
case DataEngineContext.PLS_GROUPLEVEL_STREAM:
return false;
case DataEngineContext.META_STREAM:
return false;
case DataEngineContext.META_INDEX_STREAM:
return false;
default :
return false;
}
}
Program: 71435
Project: 71435
Buggy source:
protected void paintChildren(Graphics graphics){
  IFigure child;
  for (int i=0; i < this.getChildren().size(); i++) {
    Rectangle clip=graphics.getClip(Rectangle.SINGLETON);
    child=(IFigure)this.getChildren().get(i);
    if (child.isVisible()) {
      Rectangle bounds=child.getBounds().getCopy();
      int extend=bounds.x + bounds.width - clip.x - clip.width;
      if (extend > 0) {
        clip.width=clip.width + extend;
      }
      if (child.intersects(clip)) {
        graphics.clipRect(bounds);
        child.paint(graphics);
        graphics.restoreState();
      }
    }
  }
}

Fixed version (ground truth):
protected void paintChildren(Graphics graphics){
  IFigure child;
  for (int i=0; i < this.getChildren().size(); i++) {
    Rectangle clip=graphics.getClip(Rectangle.SINGLETON);
    child=(IFigure)this.getChildren().get(i);
    if (child.isVisible()) {
      Rectangle bounds=child.getBounds().getCopy();
      int extend=bounds.x + bounds.width - clip.x - clip.width;
      if (extend > 0) {
        clip.width=clip.width + extend;
      }
      if (child.intersects(clip)) {
        graphics.setClip(clip.getCopy());
        graphics.clipRect(bounds);
        child.paint(graphics);
        graphics.restoreState();
      }
    }
  }
}
Program: 71436
Project: 71436
Buggy source:
public final void paintControl(PaintEvent e){
  Rectangle d=this.getClientArea();
  Image imgChart=new Image(this.getDisplay(),d);
  GC gcImage=new GC(imgChart);
  idr.setProperty(IDeviceRenderer.GRAPHICS_CONTEXT,gcImage);
  Bounds bo=BoundsImpl.create(0,0,d.width,d.height);
  bo.scale(72d / idr.getDisplayServer().getDpiResolution());
  Generator gr=Generator.instance();
  try {
    gcs=gr.build(idr.getDisplayServer(),cm,bo,null,null,null);
  }
 catch (  ChartException ce) {
    ce.printStackTrace();
  }
  if (bFirstPaint) {
    bFirstPaint=false;
    new Thread(new Runnable(){
      public void run(){
        while (true) {
          try {
            Thread.sleep(500);
          }
 catch (          Exception e) {
          }
          Display.getDefault().asyncExec(new Runnable(){
            public void run(){
              chartRefresh();
            }
          }
);
        }
      }
    }
).start();
  }
  try {
    gr.render(idr,gcs);
    GC gc=e.gc;
    gc.drawImage(imgChart,d.x,d.y);
  }
 catch (  ChartException ex) {
    ex.printStackTrace();
  }
}

Fixed version (ground truth):
public final void paintControl(PaintEvent e){
  Rectangle d=this.getClientArea();
  if (bFirstPaint) {
    imgChart=new Image(this.getDisplay(),d);
    gcImage=new GC(imgChart);
    idr.setProperty(IDeviceRenderer.GRAPHICS_CONTEXT,gcImage);
    bo=BoundsImpl.create(0,0,d.width,d.height);
    bo.scale(72d / idr.getDisplayServer().getDpiResolution());
  }
  Generator gr=Generator.instance();
  try {
    gcs=gr.build(idr.getDisplayServer(),cm,bo,null,null,null);
    gr.render(idr,gcs);
    GC gc=e.gc;
    gc.drawImage(imgChart,d.x,d.y);
  }
 catch (  ChartException ce) {
    ce.printStackTrace();
  }
  bFirstPaint=false;
  Display.getDefault().timerExec(500,new Runnable(){
    public void run(){
      chartRefresh();
    }
  }
);
}
Program: 71437
Project: 71437
Buggy source:
private void chartRefresh(){
  final Generator gr=Generator.instance();
  scrollData((ChartWithAxes)cm);
  try {
    gr.refresh(gcs);
  }
 catch (  ChartException ex) {
    ex.printStackTrace();
  }
  redraw();
}

Fixed version (ground truth):
private void chartRefresh(){
  if (!isDisposed()) {
    final Generator gr=Generator.instance();
    scrollData((ChartWithAxes)cm);
    try {
      gr.refresh(gcs);
    }
 catch (    ChartException ex) {
      ex.printStackTrace();
    }
    redraw();
  }
}
Program: 71438
Project: 71438
Buggy source:
/** 
 * execute application
 * @param args
 */
public static void main(String[] args){
  Display display=Display.getDefault();
  Shell shell=new Shell(display);
  shell.setSize(600,400);
  shell.setLayout(new GridLayout());
  c3dViewer=new SwtLiveChartViewer(shell,SWT.NO_BACKGROUND);
  c3dViewer.setLayoutData(new GridData(GridData.FILL_BOTH));
  c3dViewer.addPaintListener(c3dViewer);
  shell.open();
  while (!shell.isDisposed()) {
    if (!display.readAndDispatch())     display.sleep();
  }
  display.dispose();
}

Fixed version (ground truth):
/** 
 * execute application
 * @param args
 */
public static void main(String[] args){
  Display display=Display.getDefault();
  Shell shell=new Shell(display,SWT.CLOSE);
  shell.setSize(600,400);
  shell.setLayout(new GridLayout());
  c3dViewer=new SwtLiveChartViewer(shell,SWT.NO_BACKGROUND);
  c3dViewer.setLayoutData(new GridData(GridData.FILL_BOTH));
  c3dViewer.addPaintListener(c3dViewer);
  shell.open();
  while (!shell.isDisposed()) {
    if (!display.readAndDispatch())     display.sleep();
  }
  display.dispose();
}
Program: 71439
Project: 71439
Buggy source:
private void updateButtons(){
  boolean complete=uriEditor.getText() != null && uriEditor.getText().trim().length() > 0;
  previewButton.setEnabled(complete);
  getButton(IDialogConstants.OK_ID).setEnabled(complete);
  browseButton.setVisible(embedded.getSelection());
}

Fixed version (ground truth):
private void updateButtons(){
  boolean complete=uriEditor.getText() != null && uriEditor.getText().trim().length() > 0;
  URL url=null;
  try {
    url=new URL(uriEditor.getText().trim());
    if (selectedType == EMBEDDED_TYPE) {
      File file=new File(url.getPath());
      complete=file.exists() && file.isAbsolute();
    }
  }
 catch (  Exception e) {
    complete=false;
  }
  previewButton.setEnabled(complete);
  getButton(IDialogConstants.OK_ID).setEnabled(complete);
  browseButton.setVisible(embedded.getSelection());
}
Program: 71440
Project: 71440
Buggy source:
public String getCellValue(ICellContent cell){
  StringBuffer cellValue=new StringBuffer();
  Collection list=cell.getChildren();
  Iterator iter=list.iterator();
  while (iter.hasNext()) {
    Object child=iter.next();
    if (child instanceof ITextContent) {
      cellValue.append(((ITextContent)child).getText());
    }
    if (child instanceof IForeignContent) {
      cellValue.append(((IForeignContent)child).getRawValue());
    }
  }
  return cellValue.toString();
}

Fixed version (ground truth):
public String getCellValue(ICellContent cell){
  StringBuffer cellValue=new StringBuffer();
  Collection list=cell.getChildren();
  Iterator iter=list.iterator();
  while (iter.hasNext()) {
    processText(cellValue,iter.next());
  }
  return cellValue.toString();
}
Program: 71441
Project: 71441
Buggy source:
public String formatHeaderFooter(IContent headerFooter,boolean isHeader){
  StringBuffer headfoot=new StringBuffer();
  if (headerFooter != null) {
    Collection list=headerFooter.getChildren();
    Iterator iter=list.iterator();
    while (iter.hasNext()) {
      Object child=iter.next();
      if (child instanceof ITextContent) {
        headfoot.append(((ITextContent)child).getText());
      }
      if (child instanceof IForeignContent) {
        headfoot.append(((IForeignContent)child).getRawValue());
      }
      if (child instanceof ITableContent) {
        headfoot.append(getTableValue((ITableContent)child));
      }
    }
    return headfoot.toString();
  }
  return null;
}

Fixed version (ground truth):
public String formatHeaderFooter(IContent headerFooter,boolean isHeader){
  StringBuffer headfoot=new StringBuffer();
  if (headerFooter != null) {
    Collection list=headerFooter.getChildren();
    Iterator iter=list.iterator();
    while (iter.hasNext()) {
      Object child=iter.next();
      if (child instanceof ITableContent) {
        headfoot.append(getTableValue((ITableContent)child));
      }
 else       processText(headfoot,child);
    }
    return headfoot.toString();
  }
  return null;
}
Program: 71442
Project: 71442
Buggy source:
static boolean check(String source,int lineNumber){
  Context cx=Context.enter();
  Debugger oldDebugger=cx.getDebugger();
  Object oldContext=cx.getDebuggerContextData();
  boolean oldGenerate=cx.isGeneratingDebug();
  int oldLevel=cx.getOptimizationLevel();
  try {
    BreakableSourceChecker checker=new BreakableSourceChecker();
    checker.lineNumber=lineNumber + 1;
    cx.setDebugger(checker,null);
    cx.setGeneratingDebug(true);
    cx.setOptimizationLevel(-1);
    cx.compileString(source,"String_Node_Str",1,null);
    return checker.breakable;
  }
 catch (  Exception e) {
    return false;
  }
 finally {
    cx.setDebugger(oldDebugger,oldContext);
    cx.setGeneratingDebug(oldGenerate);
    cx.setOptimizationLevel(oldLevel);
    Context.exit();
  }
}

Fixed version (ground truth):
static boolean check(String source,int lineNumber){
  Context cx=Context.enter();
  Debugger oldDebugger=cx.getDebugger();
  Object oldContext=cx.getDebuggerContextData();
  boolean oldGenerate=cx.isGeneratingDebug();
  int oldLevel=cx.getOptimizationLevel();
  try {
    BreakableSourceChecker checker=new BreakableSourceChecker();
    checker.lineNumber=lineNumber + 2;
    cx.setDebugger(checker,null);
    cx.setGeneratingDebug(true);
    cx.setOptimizationLevel(-1);
    cx.compileString(addHeader(source),"String_Node_Str",1,null);
    return checker.breakable;
  }
 catch (  Exception e) {
    return false;
  }
 finally {
    cx.setDebugger(oldDebugger,oldContext);
    cx.setGeneratingDebug(oldGenerate);
    cx.setOptimizationLevel(oldLevel);
    Context.exit();
  }
}
Program: 71443
Project: 71443
Buggy source:
public void run(){
  transStar(NAME);
  try {
    LevelViewDialog dialog=new LevelViewDialog(UIUtil.getDefaultShell());
    List showLevels=new ArrayList();
    List nullLevelHandle=new ArrayList();
    int viewCount=viewHandle.getLevelCount();
    for (int i=0; i < viewCount; i++) {
      LevelViewHandle levelHandle=viewHandle.getLevel(i);
      if (levelHandle.getCubeLevel() == null) {
        nullLevelHandle.add(new Integer(levelHandle.getIndex()));
      }
 else {
        showLevels.add(levelHandle.getCubeLevel());
      }
    }
    dialog.setInput(viewHandle.getCubeDimension(),showLevels);
    if (dialog.open() == Window.OK) {
      CrosstabReportItemHandle reportHandle=viewHandle.getCrosstab();
      List result=(List)dialog.getResult();
      boolean isLevelRemoved=processor(showLevels,result,nullLevelHandle,false);
      if (isLevelRemoved) {
        boolean bool=CrosstabAdaptUtil.needRemoveInvaildBindings(reportHandle);
        processor(showLevels,result,nullLevelHandle,true);
        if (bool) {
          CrosstabAdaptUtil.removeInvalidBindings(reportHandle);
        }
      }
      AggregationCellProviderWrapper providerWrapper=new AggregationCellProviderWrapper(reportHandle);
      providerWrapper.updateAllAggregationCells(AggregationCellViewAdapter.SWITCH_VIEW_TYPE);
    }
  }
 catch (  SemanticException e) {
    rollBack();
    ExceptionHandler.handle(e);
    return;
  }
  transEnd();
}

Fixed version (ground truth):
public void run(){
  transStar(NAME);
  try {
    LevelViewDialog dialog=new LevelViewDialog(UIUtil.getDefaultShell());
    List showLevels=new ArrayList();
    List nullLevelHandle=new ArrayList();
    int viewCount=viewHandle.getLevelCount();
    for (int i=0; i < viewCount; i++) {
      LevelViewHandle levelHandle=viewHandle.getLevel(i);
      if (levelHandle.getCubeLevel() == null) {
        nullLevelHandle.add(new Integer(levelHandle.getIndex()));
      }
 else {
        showLevels.add(levelHandle.getCubeLevel());
      }
    }
    dialog.setInput(viewHandle.getCubeDimension(),showLevels);
    if (dialog.open() == Window.OK) {
      CrosstabReportItemHandle reportHandle=viewHandle.getCrosstab();
      List result=(List)dialog.getResult();
      boolean isLevelRemoved=processor(showLevels,result,nullLevelHandle,false);
      if (isLevelRemoved) {
        boolean bool=CrosstabAdaptUtil.needRemoveInvaildBindings(reportHandle);
        processor(showLevels,result,nullLevelHandle,true);
        if (bool) {
          CrosstabAdaptUtil.removeInvalidBindings(reportHandle);
        }
      }
 else {
        processor(showLevels,result,nullLevelHandle,true);
      }
      AggregationCellProviderWrapper providerWrapper=new AggregationCellProviderWrapper(reportHandle);
      providerWrapper.updateAllAggregationCells(AggregationCellViewAdapter.SWITCH_VIEW_TYPE);
    }
  }
 catch (  SemanticException e) {
    rollBack();
    ExceptionHandler.handle(e);
    return;
  }
  transEnd();
}
Program: 71446
Project: 71446
Buggy source:
public IParameterMetaData getParameterMetaData() throws OdaException {
  assertNotNull(callStat);
  if (this.cachedParameterMetaData != null)   return this.cachedParameterMetaData;
  int[] positionArray=paramUtil.getParameterPositions();
  List paramMetaList1=this.getCallableParamMetaData();
  List paramMetaList2=new ArrayList();
  int containsReturnValue=0;
  if (paramMetaList1.size() > 0) {
    if (((ParameterDefn)paramMetaList1.get(0)).getParamInOutType() == 5) {
      if (paramUtil.containsReturnValue())       paramMetaList2.add(((ParameterDefn)paramMetaList1.get(0)));
      containsReturnValue++;
    }
  }
  for (int i=0; i < positionArray.length; i++) {
    int index=positionArray[i];
    if (paramMetaList1.size() >= index)     paramMetaList2.add(paramMetaList1.get(index - 1 + containsReturnValue));
 else     throw new OdaException(ResourceConstants.PREPARESTATEMENT_PARAMETER_METADATA_CANNOT_GET);
  }
  cachedParameterMetaData=new SPParameterMetaData(paramMetaList2);
  return cachedParameterMetaData;
}

Fixed version (ground truth):
public IParameterMetaData getParameterMetaData() throws OdaException {
  assertNotNull(callStat);
  if (this.cachedParameterMetaData != null)   return this.cachedParameterMetaData;
  int[] positionArray=paramUtil.getParameterPositions();
  List paramMetaList1=this.getCallableParamMetaData();
  List paramMetaList2=new ArrayList();
  int containsReturnValue=0;
  if (paramMetaList1.size() > 0) {
    if (((ParameterDefn)paramMetaList1.get(0)).getParamInOutType() == 5) {
      if (paramUtil.containsReturnValue())       paramMetaList2.add(((ParameterDefn)paramMetaList1.get(0)));
      containsReturnValue++;
    }
  }
  for (int i=0; i < positionArray.length; i++) {
    int index=positionArray[i];
    if (paramMetaList1.size() >= index + containsReturnValue)     paramMetaList2.add(paramMetaList1.get(index - 1 + containsReturnValue));
 else     throw new OdaException(ResourceConstants.PREPARESTATEMENT_PARAMETER_METADATA_CANNOT_GET);
  }
  cachedParameterMetaData=new SPParameterMetaData(paramMetaList2);
  return cachedParameterMetaData;
}
Program: 71448
Project: 71448
Buggy source:
/** 
 * Updates AutoScale by checking step size and step number
 * @param sc
 * @param oStep
 * @param oStepNumber
 * @param rtc
 * @throws ChartException
 */
public static void setStepToScale(AutoScale sc,Object oStep,Integer oStepNumber,RunTimeContext rtc) throws ChartException {
  if (oStep != null) {
    sc.oStep=oStep;
    sc.bStepFixed=true;
    if (((Double)sc.oStep).doubleValue() <= 0) {
      throw new ChartException(ChartEnginePlugin.ID,ChartException.GENERATION,"String_Node_Str",new Object[]{oStep},Messages.getResourceBundle(rtc.getULocale()));
    }
  }
  if (oStepNumber != null) {
    sc.oStepNumber=oStepNumber;
    sc.bStepFixed=true;
    if (sc.oStepNumber.intValue() < 1) {
      throw new ChartException(ChartEnginePlugin.ID,ChartException.GENERATION,"String_Node_Str",new Object[]{oStepNumber},Messages.getResourceBundle(rtc.getULocale()));
    }
  }
}

Fixed version (ground truth):
/** 
 * Updates AutoScale by checking step size and step number
 * @param sc
 * @param oStep
 * @param oStepNumber
 * @param rtc
 * @throws ChartException
 */
public static void setStepToScale(AutoScale sc,Object oStep,Integer oStepNumber,RunTimeContext rtc) throws ChartException {
  if (oStep != null) {
    sc.setStep(oStep);
    sc.bStepFixed=true;
    if (((Double)sc.oStep).doubleValue() <= 0) {
      throw new ChartException(ChartEnginePlugin.ID,ChartException.GENERATION,"String_Node_Str",new Object[]{oStep},Messages.getResourceBundle(rtc.getULocale()));
    }
  }
  if (oStepNumber != null) {
    sc.oStepNumber=oStepNumber;
    sc.bStepFixed=true;
    if (sc.oStepNumber.intValue() < 1) {
      throw new ChartException(ChartEnginePlugin.ID,ChartException.GENERATION,"String_Node_Str",new Object[]{oStepNumber},Messages.getResourceBundle(rtc.getULocale()));
    }
  }
}
Program: 71450
Project: 71450
Buggy source:
private final void updateContext(ScaleContext sct){
  this.oMaximum=sct.getMax();
  this.oMinimum=sct.getMin();
  this.oMaximumWithMargin=sct.getMaxWithMargin();
  this.oMinimumWithMargin=sct.getMinWithMargin();
  this.oStep=sct.getStep();
  this.oUnit=sct.getUnit();
}

Fixed version (ground truth):
private final void updateContext(ScaleContext sct){
  this.oMaximum=sct.getMax();
  this.oMinimum=sct.getMin();
  this.oMaximumWithMargin=sct.getMaxWithMargin();
  this.oMinimumWithMargin=sct.getMinWithMargin();
  setStep(sct.getStep());
  this.oUnit=sct.getUnit();
}
Program: 71452
Project: 71452
Buggy source:
/** 
 * Computes min, max value, step size and step number of the Axis
 * @param oMinValue min value in data points. Double or CDateTime type.
 * @param oMaxValue max value in data points. Double or CDateTime type.
 */
public final void updateAxisMinMax(Object oMinValue,Object oMaxValue){
  if (rtc.getScale() != null && rtc.getScale().isShared()) {
    updateContext(rtc.getScale());
    return;
  }
  if (rtc.getScale() != null) {
    oMinValue=rtc.getScale().getMin();
    oMaxValue=rtc.getScale().getMax();
  }
  ScaleContext sct;
  if ((iType & LOGARITHMIC) == LOGARITHMIC) {
    if ((iType & PERCENT) == PERCENT) {
      oMaximum=new Double(100);
      oMinimum=new Double(1);
      oStep=new Double(10);
      bMaximumFixed=true;
      bMinimumFixed=true;
      bStepFixed=true;
      return;
    }
    sct=new ScaleContext(iMarginPercent,iType,oMinValue,oMaxValue,oStep);
  }
 else   if ((iType & DATE_TIME) == DATE_TIME) {
    int iUnit=asInteger(oUnit);
    sct=new ScaleContext(iMarginPercent,iType,iUnit,oMinValue,oMaxValue,oStep);
  }
 else {
    sct=new ScaleContext(iMarginPercent,iType,oMinValue,oMaxValue,oStep);
  }
  if ((iType & DATE_TIME) == DATE_TIME) {
    sct.setFixedValue(bMinimumFixed,bMaximumFixed,oMinimumFixed,oMaximumFixed);
  }
 else {
    sct.setFixedValue(bMinimumFixed,bMaximumFixed,oMinimum,oMaximum);
  }
  sct.setFixedStep(bStepFixed,oStepNumber);
  sct.computeMinMax();
  updateContext(sct);
  tmpSC=sct;
  updateSharedScaleContext(rtc,iType,tmpSC);
}

Fixed version (ground truth):
/** 
 * Computes min, max value, step size and step number of the Axis
 * @param oMinValue min value in data points. Double or CDateTime type.
 * @param oMaxValue max value in data points. Double or CDateTime type.
 */
public final void updateAxisMinMax(Object oMinValue,Object oMaxValue){
  if (rtc.getScale() != null && rtc.getScale().isShared()) {
    updateContext(rtc.getScale());
    return;
  }
  if (rtc.getScale() != null) {
    oMinValue=rtc.getScale().getMin();
    oMaxValue=rtc.getScale().getMax();
  }
  ScaleContext sct;
  if ((iType & LOGARITHMIC) == LOGARITHMIC) {
    if ((iType & PERCENT) == PERCENT) {
      oMaximum=new Double(100);
      oMinimum=new Double(1);
      setStep(new Double(10));
      bMaximumFixed=true;
      bMinimumFixed=true;
      bStepFixed=true;
      return;
    }
    sct=new ScaleContext(iMarginPercent,iType,oMinValue,oMaxValue,oStep);
  }
 else   if ((iType & DATE_TIME) == DATE_TIME) {
    int iUnit=asInteger(oUnit);
    sct=new ScaleContext(iMarginPercent,iType,iUnit,oMinValue,oMaxValue,oStep);
  }
 else {
    sct=new ScaleContext(iMarginPercent,iType,oMinValue,oMaxValue,oStep);
  }
  if ((iType & DATE_TIME) == DATE_TIME) {
    sct.setFixedValue(bMinimumFixed,bMaximumFixed,oMinimumFixed,oMaximumFixed);
  }
 else {
    sct.setFixedValue(bMinimumFixed,bMaximumFixed,oMinimum,oMaximum);
  }
  sct.setFixedStep(bStepFixed,oStepNumber);
  sct.computeMinMax();
  updateContext(sct);
  tmpSC=sct;
  updateSharedScaleContext(rtc,iType,tmpSC);
}
Program: 71454
Project: 71454
Buggy source:
/** 
 * @param url
 * @return
 * @throws ImageLoadingException
 */
final Image loadImage(URL url) throws ChartException {
  Image img=(Image)htCache.get(url);
  if (img != null) {
    logger.log(ILogger.INFORMATION,Messages.getString("String_Node_Str",new Object[]{url},idsSWING.getULocale()));
  }
 else {
    logger.log(ILogger.INFORMATION,Messages.getString("String_Node_Str",new Object[]{url},idsSWING.getULocale()));
    img=(new ImageIcon(url)).getImage();
    try {
      final MediaTracker tracker=new MediaTracker(p);
      tracker.addImage(img,0);
      tracker.waitForAll();
      if ((tracker.statusAll(true) & MediaTracker.ERRORED) != 0) {
        StringBuffer sb=new StringBuffer();
        Object[] oa=tracker.getErrorsAny();
        sb.append('[');
        for (int i=0; i < oa.length; i++) {
          sb.append(oa[i]);
          if (i < oa.length - 1) {
            sb.append("String_Node_Str");
          }
        }
        sb.append(']');
        throw new ChartException(ChartDeviceExtensionPlugin.ID,ChartException.IMAGE_LOADING,"String_Node_Str",new Object[]{sb.toString()},Messages.getResourceBundle(idsSWING.getULocale()));
      }
    }
 catch (    InterruptedException ex) {
      throw new ChartException(ChartDeviceExtensionPlugin.ID,ChartException.IMAGE_LOADING,ex);
    }
    htCache.put(url,img);
  }
  return img;
}

Fixed version (ground truth):
/** 
 * @param url
 * @return
 * @throws ChartException
 */
final Image loadImage(URL url) throws ChartException {
  Image img=(Image)htCache.get(url);
  if (img != null) {
    logger.log(ILogger.INFORMATION,Messages.getString("String_Node_Str",new Object[]{url},idsSWING.getULocale()));
  }
 else {
    logger.log(ILogger.INFORMATION,Messages.getString("String_Node_Str",new Object[]{url},idsSWING.getULocale()));
    img=(new ImageIcon(url)).getImage();
    try {
      final MediaTracker tracker=new MediaTracker(p);
      tracker.addImage(img,0);
      tracker.waitForAll();
      if ((tracker.statusAll(true) & MediaTracker.ERRORED) != 0) {
        StringBuffer sb=new StringBuffer();
        Object[] oa=tracker.getErrorsAny();
        sb.append('[');
        for (int i=0; i < oa.length; i++) {
          sb.append(oa[i]);
          if (i < oa.length - 1) {
            sb.append("String_Node_Str");
          }
        }
        sb.append(']');
        throw new ChartException(ChartDeviceExtensionPlugin.ID,ChartException.IMAGE_LOADING,"String_Node_Str",new Object[]{sb.toString()},Messages.getResourceBundle(idsSWING.getULocale()));
      }
    }
 catch (    InterruptedException ex) {
      throw new ChartException(ChartDeviceExtensionPlugin.ID,ChartException.IMAGE_LOADING,ex);
    }
    htCache.put(url,img);
  }
  return img;
}
Program: 71455
Project: 71455
Buggy source:
/** 
 * @param ipr
 * @param iLabelPosition IConstants. LEFT, RIGHT, ABOVE or BELOW
 * @param lo POINT WHERE THE CORNER OF THE ROTATED RECTANGLE (OR EDGE CENTERED) IS RENDERED
 * @param la
 * @throws RenderingException
 */
public final void renderTextAtLocation(IPrimitiveRenderer ipr,int iLabelPosition,Location lo,Label la) throws ChartException {
  final ColorDefinition cdText=la.getCaption().getColor();
  if (cdText == null) {
    throw new ChartException(ChartDeviceExtensionPlugin.ID,ChartException.RENDERING,"String_Node_Str",Messages.getResourceBundle(_sxs.getULocale()));
  }
  final Graphics2D g2d=(Graphics2D)((IDeviceRenderer)ipr).getGraphicsContext();
  g2d.setFont((java.awt.Font)_sxs.createFont(la.getCaption().getFont()));
switch (iLabelPosition & POSITION_MASK) {
case ABOVE:
    if (ChartUtil.isShadowDefined(la)) {
      showTopValue(ipr,lo,la,iLabelPosition,true);
    }
  showTopValue(ipr,lo,la,iLabelPosition,false);
break;
case BELOW:
if (ChartUtil.isShadowDefined(la)) {
showBottomValue(ipr,lo,la,iLabelPosition,true);
}
showBottomValue(ipr,lo,la,iLabelPosition,false);
break;
case LEFT:
if (ChartUtil.isShadowDefined(la)) {
showLeftValue(ipr,lo,la,iLabelPosition,true);
}
showLeftValue(ipr,lo,la,iLabelPosition,false);
break;
case RIGHT:
if (ChartUtil.isShadowDefined(la)) {
showRightValue(ipr,lo,la,iLabelPosition,true);
}
showRightValue(ipr,lo,la,iLabelPosition,false);
break;
case INSIDE:
if (ChartUtil.isShadowDefined(la)) {
showCenterValue(ipr,lo,la,true);
}
showCenterValue(ipr,lo,la,false);
break;
}
}

Fixed version (ground truth):
/** 
 * @param ipr
 * @param iLabelPosition IConstants. LEFT, RIGHT, ABOVE or BELOW
 * @param lo POINT WHERE THE CORNER OF THE ROTATED RECTANGLE (OR EDGE CENTERED) IS RENDERED
 * @param la
 * @throws ChartException
 */
public final void renderTextAtLocation(IPrimitiveRenderer ipr,int iLabelPosition,Location lo,Label la) throws ChartException {
  final ColorDefinition cdText=la.getCaption().getColor();
  if (cdText == null) {
    throw new ChartException(ChartDeviceExtensionPlugin.ID,ChartException.RENDERING,"String_Node_Str",Messages.getResourceBundle(_sxs.getULocale()));
  }
  final Graphics2D g2d=(Graphics2D)((IDeviceRenderer)ipr).getGraphicsContext();
  g2d.setFont((java.awt.Font)_sxs.createFont(la.getCaption().getFont()));
switch (iLabelPosition & POSITION_MASK) {
case ABOVE:
    if (ChartUtil.isShadowDefined(la)) {
      showTopValue(ipr,lo,la,iLabelPosition,true);
    }
  showTopValue(ipr,lo,la,iLabelPosition,false);
break;
case BELOW:
if (ChartUtil.isShadowDefined(la)) {
showBottomValue(ipr,lo,la,iLabelPosition,true);
}
showBottomValue(ipr,lo,la,iLabelPosition,false);
break;
case LEFT:
if (ChartUtil.isShadowDefined(la)) {
showLeftValue(ipr,lo,la,iLabelPosition,true);
}
showLeftValue(ipr,lo,la,iLabelPosition,false);
break;
case RIGHT:
if (ChartUtil.isShadowDefined(la)) {
showRightValue(ipr,lo,la,iLabelPosition,true);
}
showRightValue(ipr,lo,la,iLabelPosition,false);
break;
case INSIDE:
if (ChartUtil.isShadowDefined(la)) {
showCenterValue(ipr,lo,la,true);
}
showCenterValue(ipr,lo,la,false);
break;
}
}
Program: 71457
Project: 71457
Buggy source:
/** 
 * Serializes a <code>Document</code> object to a <code>String</code> in XML format.  This is a convevience method to save the output of the SVG generator to a string.
 * @param generatedDocument the generated graphic
 * @return String the XML-serialized form of the <code>Document</code>
 * @throws SVGGeneratorException If XML serialization failed
 */
protected String serializeGeneratedDocumentToString(Document generatedDocument) throws Exception {
  if (generatedDocument == null) {
    return null;
  }
  OutputStreamWriter writer=null;
  ByteArrayOutputStream stream=new ByteArrayOutputStream();
  writer=new OutputStreamWriter(stream,"String_Node_Str");
  DOMSource source=new DOMSource(generatedDocument);
  StreamResult result=new StreamResult(writer);
  TransformerFactory transFactory=TransformerFactory.newInstance();
  Transformer transformer=transFactory.newTransformer();
  transformer.transform(source,result);
  return stream.toString();
}

Fixed version (ground truth):
/** 
 * Serializes a <code>Document</code> object to a <code>String</code> in XML format. This is a convevience method to save the output of the SVG generator to a string.
 * @param generatedDocument the generated graphic
 * @return String the XML-serialized form of the <code>Document</code>
 * @throws Exception If XML serialization failed
 */
protected String serializeGeneratedDocumentToString(Document generatedDocument) throws Exception {
  if (generatedDocument == null) {
    return null;
  }
  OutputStreamWriter writer=null;
  ByteArrayOutputStream stream=new ByteArrayOutputStream();
  writer=new OutputStreamWriter(stream,"String_Node_Str");
  DOMSource source=new DOMSource(generatedDocument);
  StreamResult result=new StreamResult(writer);
  TransformerFactory transFactory=TransformerFactory.newInstance();
  Transformer transformer=transFactory.newTransformer();
  transformer.transform(source,result);
  return stream.toString();
}
Program: 71458
Project: 71458
Buggy source:
/** 
 * @param os
 * @throws RenderingException
 */
public void after() throws ChartException {
  super.after();
  ivRenderer.addInteractivity();
  addScripts();
  ((SVGGraphics2D)_g2d).flush();
  dom.getDocumentElement().appendChild(ivRenderer.getHotspotLayer());
  if (oOutputIdentifier instanceof OutputStream) {
    try {
      writeDocumentToOutputStream(dom,(OutputStream)oOutputIdentifier);
    }
 catch (    Exception ex) {
      throw new ChartException(ChartDeviceSVGPlugin.ID,ChartException.RENDERING,ex);
    }
  }
 else   if (oOutputIdentifier instanceof String) {
    FileOutputStream fos=null;
    try {
      fos=new FileOutputStream((String)oOutputIdentifier);
      writeDocumentToOutputStream(dom,fos);
      fos.close();
    }
 catch (    Exception ex) {
      throw new ChartException(ChartDeviceSVGPlugin.ID,ChartException.RENDERING,ex);
    }
  }
 else {
    throw new ChartException(ChartDeviceSVGPlugin.ID,ChartException.RENDERING,"String_Node_Str",new Object[]{oOutputIdentifier},null);
  }
  ivRenderer.clear();
}

Fixed version (ground truth):
/** 
 * @param os
 * @throws ChartException
 */
public void after() throws ChartException {
  super.after();
  ivRenderer.addInteractivity();
  addScripts();
  ((SVGGraphics2D)_g2d).flush();
  dom.getDocumentElement().appendChild(ivRenderer.getHotspotLayer());
  if (oOutputIdentifier instanceof OutputStream) {
    try {
      writeDocumentToOutputStream(dom,(OutputStream)oOutputIdentifier);
    }
 catch (    Exception ex) {
      throw new ChartException(ChartDeviceSVGPlugin.ID,ChartException.RENDERING,ex);
    }
  }
 else   if (oOutputIdentifier instanceof String) {
    FileOutputStream fos=null;
    try {
      fos=new FileOutputStream((String)oOutputIdentifier);
      writeDocumentToOutputStream(dom,fos);
      fos.close();
    }
 catch (    Exception ex) {
      throw new ChartException(ChartDeviceSVGPlugin.ID,ChartException.RENDERING,ex);
    }
  }
 else {
    throw new ChartException(ChartDeviceSVGPlugin.ID,ChartException.RENDERING,"String_Node_Str",new Object[]{oOutputIdentifier},null);
  }
  ivRenderer.clear();
}
Program: 71463
Project: 71463
Buggy source:
/** 
 * The default constructor
 * @param _ids The display server using which the chart is computed
 * @param _cwa An instance of the model (ChartWithAxes)
 * @throws ValidationException
 * @throws UndefinedValueException
 * @throws UnexpectedInputException
 */
public PlotWith2DAxes(IDisplayServer _ids,ChartWithAxes _cwa,RunTimeContext _rtc) throws IllegalArgumentException, ChartException {
  cwa=_cwa;
  ids=_ids;
  rtc=_rtc;
  ssl=new StackedSeriesLookup(_rtc);
  dPointToPixel=ids.getDpiResolution() / 72d;
  buildAxes();
  initAlignZeroHelper();
}

Fixed version (ground truth):
/** 
 * The default constructor
 * @param _ids The display server using which the chart is computed
 * @param _cwa An instance of the model (ChartWithAxes)
 * @throws IllegalArgumentException
 * @throws ChartException
 */
public PlotWith2DAxes(IDisplayServer _ids,ChartWithAxes _cwa,RunTimeContext _rtc) throws IllegalArgumentException, ChartException {
  cwa=_cwa;
  ids=_ids;
  rtc=_rtc;
  ssl=new StackedSeriesLookup(_rtc);
  dPointToPixel=ids.getDpiResolution() / 72d;
  buildAxes();
  initAlignZeroHelper();
}
Program: 71464
Project: 71464
Buggy source:
/** 
 * Returns a transposed or the original label position as requested depending on the plot's orientation
 * @param iBaseOrOrthogonal
 * @param iOriginalPosition
 * @return
 * @throws UnexpectedInputException
 */
public final int transposeLabelPosition(int iBaseOrOrthogonal,int iOriginalPosition) throws IllegalArgumentException {
  if (!cwa.isTransposed()) {
    return iOriginalPosition;
  }
  if (iBaseOrOrthogonal == IConstants.BASE) {
switch (iOriginalPosition) {
case IConstants.ABOVE:
      return IConstants.RIGHT;
case IConstants.BELOW:
    return IConstants.LEFT;
case IConstants.OUTSIDE:
case IConstants.INSIDE:
  return iOriginalPosition;
}
}
 else if (iBaseOrOrthogonal == IConstants.ORTHOGONAL) {
switch (iOriginalPosition) {
case IConstants.ABOVE:
return IConstants.RIGHT;
case IConstants.BELOW:
return IConstants.LEFT;
case IConstants.LEFT:
return IConstants.BELOW;
case IConstants.RIGHT:
return IConstants.ABOVE;
case IConstants.OUTSIDE:
case IConstants.INSIDE:
return iOriginalPosition;
}
}
throw new IllegalArgumentException(MessageFormat.format(Messages.getResourceBundle(rtc.getULocale()).getString("String_Node_Str"),new Object[]{new Integer(iBaseOrOrthogonal),new Integer(iOriginalPosition)}));
}

Fixed version (ground truth):
/** 
 * Returns a transposed or the original label position as requested depending on the plot's orientation
 * @param iBaseOrOrthogonal
 * @param iOriginalPosition
 * @return
 * @throws IllegalArgumentException
 */
public final int transposeLabelPosition(int iBaseOrOrthogonal,int iOriginalPosition) throws IllegalArgumentException {
  if (!cwa.isTransposed()) {
    return iOriginalPosition;
  }
  if (iBaseOrOrthogonal == IConstants.BASE) {
switch (iOriginalPosition) {
case IConstants.ABOVE:
      return IConstants.RIGHT;
case IConstants.BELOW:
    return IConstants.LEFT;
case IConstants.OUTSIDE:
case IConstants.INSIDE:
  return iOriginalPosition;
}
}
 else if (iBaseOrOrthogonal == IConstants.ORTHOGONAL) {
switch (iOriginalPosition) {
case IConstants.ABOVE:
return IConstants.RIGHT;
case IConstants.BELOW:
return IConstants.LEFT;
case IConstants.LEFT:
return IConstants.BELOW;
case IConstants.RIGHT:
return IConstants.ABOVE;
case IConstants.OUTSIDE:
case IConstants.INSIDE:
return iOriginalPosition;
}
}
throw new IllegalArgumentException(MessageFormat.format(Messages.getResourceBundle(rtc.getULocale()).getString("String_Node_Str"),new Object[]{new Integer(iBaseOrOrthogonal),new Integer(iOriginalPosition)}));
}
Program: 71465
Project: 71465
Buggy source:
/** 
 * Returns a transpose of the original angle
 * @param dOriginalAngle
 * @return
 * @throws UnexpectedInputException
 */
public final double getTransposedAngle(double dOriginalAngle) throws IllegalArgumentException {
  if (dOriginalAngle >= 0 && dOriginalAngle <= 90) {
    return -(90 - dOriginalAngle);
  }
 else   if (dOriginalAngle < 0 && dOriginalAngle >= -90) {
    return (dOriginalAngle + 90);
  }
  throw new IllegalArgumentException(MessageFormat.format(Messages.getResourceBundle(rtc.getULocale()).getString("String_Node_Str"),new Object[]{new Double(dOriginalAngle)}));
}

Fixed version (ground truth):
/** 
 * Returns a transpose of the original angle
 * @param dOriginalAngle
 * @return
 * @throws IllegalArgumentException
 */
public final double getTransposedAngle(double dOriginalAngle) throws IllegalArgumentException {
  if (dOriginalAngle >= 0 && dOriginalAngle <= 90) {
    return -(90 - dOriginalAngle);
  }
 else   if (dOriginalAngle < 0 && dOriginalAngle >= -90) {
    return (dOriginalAngle + 90);
  }
  throw new IllegalArgumentException(MessageFormat.format(Messages.getResourceBundle(rtc.getULocale()).getString("String_Node_Str"),new Object[]{new Double(dOriginalAngle)}));
}
Program: 71466
Project: 71466
Buggy source:
/** 
 * Returns a transposed or the original tick style as requested depending on the plot's orientation
 * @param iBaseOrOrthogonal
 * @param iOriginalStyle
 * @return
 * @throws UnexpectedInputException
 */
protected final int transposeTickStyle(int iBaseOrOrthogonal,int iOriginalStyle) throws IllegalArgumentException {
  if (!cwa.isTransposed() || iOriginalStyle == IConstants.TICK_ACROSS || iOriginalStyle == IConstants.TICK_NONE) {
    return iOriginalStyle;
  }
  if (iBaseOrOrthogonal == IConstants.BASE) {
switch (iOriginalStyle) {
case IConstants.TICK_BELOW:
      return IConstants.TICK_LEFT;
case IConstants.TICK_ABOVE:
    return IConstants.TICK_RIGHT;
}
}
 else if (iBaseOrOrthogonal == IConstants.ORTHOGONAL) {
switch (iOriginalStyle) {
case IConstants.TICK_LEFT:
  return IConstants.TICK_BELOW;
case IConstants.TICK_RIGHT:
return IConstants.TICK_ABOVE;
}
}
throw new IllegalArgumentException(MessageFormat.format(Messages.getResourceBundle(rtc.getULocale()).getString("String_Node_Str"),new Object[]{new Integer(iBaseOrOrthogonal),new Integer(iOriginalStyle)}));
}

Fixed version (ground truth):
/** 
 * Returns a transposed or the original tick style as requested depending on the plot's orientation
 * @param iBaseOrOrthogonal
 * @param iOriginalStyle
 * @return
 * @throws IllegalArgumentException
 */
protected final int transposeTickStyle(int iBaseOrOrthogonal,int iOriginalStyle) throws IllegalArgumentException {
  if (!cwa.isTransposed() || iOriginalStyle == IConstants.TICK_ACROSS || iOriginalStyle == IConstants.TICK_NONE) {
    return iOriginalStyle;
  }
  if (iBaseOrOrthogonal == IConstants.BASE) {
switch (iOriginalStyle) {
case IConstants.TICK_BELOW:
      return IConstants.TICK_LEFT;
case IConstants.TICK_ABOVE:
    return IConstants.TICK_RIGHT;
}
}
 else if (iBaseOrOrthogonal == IConstants.ORTHOGONAL) {
switch (iOriginalStyle) {
case IConstants.TICK_LEFT:
  return IConstants.TICK_BELOW;
case IConstants.TICK_RIGHT:
return IConstants.TICK_ABOVE;
}
}
throw new IllegalArgumentException(MessageFormat.format(Messages.getResourceBundle(rtc.getULocale()).getString("String_Node_Str"),new Object[]{new Integer(iBaseOrOrthogonal),new Integer(iOriginalStyle)}));
}
Program: 71468
Project: 71468
Buggy source:
/** 
 * @param se
 * @return
 * @throws UnexpectedInputException
 */
public final Label getLabelAttributes(Series se) throws IllegalArgumentException {
  return LabelImpl.copyInstance(se.getLabel());
}

Fixed version (ground truth):
/** 
 * @param se
 * @return
 * @throws IllegalArgumentException
 */
public final Label getLabelAttributes(Series se) throws IllegalArgumentException {
  return LabelImpl.copyInstance(se.getLabel());
}
Program: 71469
Project: 71469
Buggy source:
/** 
 * @param se
 * @return
 * @throws UndefinedValueException
 * @throws UnexpectedInputException
 */
public final Position getLabelPosition(Series se) throws ChartException, IllegalArgumentException {
  if (!se.isSetLabelPosition()) {
    throw new ChartException(ChartEnginePlugin.ID,ChartException.UNDEFINED_VALUE,"String_Node_Str",new Object[]{se},Messages.getResourceBundle(pwa.getRunTimeContext().getULocale()));
  }
  final int iTransposed=pwa.transposeLabelPosition(IConstants.ORTHOGONAL,Methods.getLabelPosition(se.getLabelPosition()));
  Position p=null;
switch (iTransposed) {
case IConstants.LEFT:
    p=Position.LEFT_LITERAL;
  break;
case IConstants.RIGHT:
p=Position.RIGHT_LITERAL;
break;
case IConstants.ABOVE:
p=Position.ABOVE_LITERAL;
break;
case IConstants.BELOW:
p=Position.BELOW_LITERAL;
break;
case IConstants.OUTSIDE:
p=Position.OUTSIDE_LITERAL;
break;
case IConstants.INSIDE:
p=Position.INSIDE_LITERAL;
break;
}
return p;
}

Fixed version (ground truth):
/** 
 * @param se
 * @return
 * @throws ChartException
 * @throws IllegalArgumentException
 */
public final Position getLabelPosition(Series se) throws ChartException, IllegalArgumentException {
  if (!se.isSetLabelPosition()) {
    throw new ChartException(ChartEnginePlugin.ID,ChartException.UNDEFINED_VALUE,"String_Node_Str",new Object[]{se},Messages.getResourceBundle(pwa.getRunTimeContext().getULocale()));
  }
  final int iTransposed=pwa.transposeLabelPosition(IConstants.ORTHOGONAL,Methods.getLabelPosition(se.getLabelPosition()));
  Position p=null;
switch (iTransposed) {
case IConstants.LEFT:
    p=Position.LEFT_LITERAL;
  break;
case IConstants.RIGHT:
p=Position.RIGHT_LITERAL;
break;
case IConstants.ABOVE:
p=Position.ABOVE_LITERAL;
break;
case IConstants.BELOW:
p=Position.BELOW_LITERAL;
break;
case IConstants.OUTSIDE:
p=Position.OUTSIDE_LITERAL;
break;
case IConstants.INSIDE:
p=Position.INSIDE_LITERAL;
break;
}
return p;
}
Program: 71470
Project: 71470
Buggy source:
/** 
 * @param se
 * @return
 * @throws UnexpectedInputException
 */
public final Label getLabelAttributes(Series se) throws IllegalArgumentException {
  return LabelImpl.copyInstance(se.getLabel());
}

Fixed version (ground truth):
/** 
 * @param se
 * @return
 * @throws IllegalArgumentException
 */
public final Label getLabelAttributes(Series se) throws IllegalArgumentException {
  return LabelImpl.copyInstance(se.getLabel());
}
Program: 71471
Project: 71471
Buggy source:
/** 
 * @param se
 * @return
 * @throws UndefinedValueException
 * @throws UnexpectedInputException
 */
public final Position getLabelPosition(Series se) throws ChartException, IllegalArgumentException {
  if (!se.isSetLabelPosition()) {
    throw new ChartException(ChartEnginePlugin.ID,ChartException.UNDEFINED_VALUE,"String_Node_Str",new Object[]{se},Messages.getResourceBundle(pwa.getRunTimeContext().getULocale()));
  }
  final int iTransposed=pwa.transposeLabelPosition(IConstants.ORTHOGONAL,Methods.getLabelPosition(se.getLabelPosition()));
  Position p=null;
switch (iTransposed) {
case IConstants.LEFT:
    p=Position.LEFT_LITERAL;
  break;
case IConstants.RIGHT:
p=Position.RIGHT_LITERAL;
break;
case IConstants.ABOVE:
p=Position.ABOVE_LITERAL;
break;
case IConstants.BELOW:
p=Position.BELOW_LITERAL;
break;
case IConstants.OUTSIDE:
p=Position.OUTSIDE_LITERAL;
break;
case IConstants.INSIDE:
p=Position.INSIDE_LITERAL;
break;
}
return p;
}

Fixed version (ground truth):
/** 
 * @param se
 * @return
 * @throws ChartException
 * @throws IllegalArgumentException
 */
public final Position getLabelPosition(Series se) throws ChartException, IllegalArgumentException {
  if (!se.isSetLabelPosition()) {
    throw new ChartException(ChartEnginePlugin.ID,ChartException.UNDEFINED_VALUE,"String_Node_Str",new Object[]{se},Messages.getResourceBundle(pwa.getRunTimeContext().getULocale()));
  }
  final int iTransposed=pwa.transposeLabelPosition(IConstants.ORTHOGONAL,Methods.getLabelPosition(se.getLabelPosition()));
  Position p=null;
switch (iTransposed) {
case IConstants.LEFT:
    p=Position.LEFT_LITERAL;
  break;
case IConstants.RIGHT:
p=Position.RIGHT_LITERAL;
break;
case IConstants.ABOVE:
p=Position.ABOVE_LITERAL;
break;
case IConstants.BELOW:
p=Position.BELOW_LITERAL;
break;
case IConstants.OUTSIDE:
p=Position.OUTSIDE_LITERAL;
break;
case IConstants.INSIDE:
p=Position.INSIDE_LITERAL;
break;
}
return p;
}
Program: 71473
Project: 71473
Buggy source:
/** 
 * A notification sent to the device to initialize itself before rendering begins
 * @throws RenderingException
 */
void before() throws ChartException ;

Fixed version (ground truth):
/** 
 * A notification sent to the device to initialize itself before rendering begins
 * @throws ChartException
 */
void before() throws ChartException ;
Program: 71474
Project: 71474
Buggy source:
/** 
 * A notification sent to the device to cleanup after rendering is done
 * @throws RenderingException
 */
void after() throws ChartException ;

Fixed version (ground truth):
/** 
 * A notification sent to the device to cleanup after rendering is done
 * @throws ChartException
 */
void after() throws ChartException ;
Program: 71475
Project: 71475
Buggy source:
/** 
 * Attempts to use device specific libraries to load an image for use with the device renderer
 * @param url The URL associated with the image location
 * @return An instance of an image associated with the specified URL
 * @throws ImageLoadingException
 */
Object loadImage(URL url) throws ChartException ;

Fixed version (ground truth):
/** 
 * Attempts to use device specific libraries to load an image for use with the device renderer
 * @param url The URL associated with the image location
 * @return An instance of an image associated with the specified URL
 * @throws ChartException
 */
Object loadImage(URL url) throws ChartException ;
Program: 71476
Project: 71476
Buggy source:
protected void dropSourceElementHandle(DesignElementHandle handle) throws SemanticException {
  if (handle.getContainer() != null) {
    if (DesignerConstants.TRACING_COMMANDS) {
      System.out.println("String_Node_Str" + DEUtil.getDisplayLabel(handle));
    }
    if (handle instanceof ExtendedItemHandle && isExtendedCell((ExtendedItemHandle)handle)) {
      ExtendedItemHandle extendedHandle=(ExtendedItemHandle)handle;
      List list=extendedHandle.getContents(DEUtil.getDefaultContentName(handle));
      for (int i=0; i < list.size(); i++) {
        dropSourceElementHandle((DesignElementHandle)list.get(i));
      }
    }
 else     if (handle instanceof CellHandle) {
      dropSourceSlotHandle(((CellHandle)handle).getContent());
    }
 else     if (handle instanceof RowHandle) {
      new DeleteRowCommand(handle).execute();
    }
 else     if (handle instanceof ColumnHandle) {
      new DeleteColumnCommand(handle).execute();
    }
 else {
      handle.dropAndClear();
    }
  }
}

Fixed version (ground truth):
protected void dropSourceElementHandle(DesignElementHandle handle) throws SemanticException {
  if (handle.getContainer() != null) {
    if (DesignerConstants.TRACING_COMMANDS) {
      System.out.println("String_Node_Str" + DEUtil.getDisplayLabel(handle));
    }
    if (handle instanceof ExtendedItemHandle && isExtendedCell((ExtendedItemHandle)handle)) {
      ExtendedItemHandle extendedHandle=(ExtendedItemHandle)handle;
      List list=extendedHandle.getContents(DEUtil.getDefaultContentName(handle));
      for (int i=0; i < list.size(); i++) {
        dropSourceElementHandle((DesignElementHandle)list.get(i));
      }
    }
 else     if (handle instanceof CellHandle) {
      dropSourceSlotHandle(((CellHandle)handle).getContent());
    }
 else     if (handle instanceof RowHandle) {
      new DeleteRowCommand(handle).execute();
    }
 else     if (handle instanceof ColumnHandle) {
      new DeleteColumnCommand(handle).execute();
    }
 else {
      if (isClear()) {
        handle.dropAndClear();
      }
 else {
        handle.drop();
      }
    }
  }
}
Program: 71477
Project: 71477
Buggy source:
public Command getOrphanChildrenCommand(GroupRequest request){
  List parts=request.getEditParts();
  CompoundCommand result=new CompoundCommand("String_Node_Str");
  for (int i=0; i < parts.size(); i++) {
    result.add(new DeleteCommand(((EditPart)parts.get(i)).getModel()));
  }
  return result.unwrap();
}

Fixed version (ground truth):
public Command getOrphanChildrenCommand(GroupRequest request){
  List parts=request.getEditParts();
  CompoundCommand result=new CompoundCommand("String_Node_Str");
  for (int i=0; i < parts.size(); i++) {
    DeleteCommand command=new DeleteCommand(((EditPart)parts.get(i)).getModel());
    command.setClear(false);
    result.add(command);
  }
  return result.unwrap();
}