nus-yam/ex-repair huggingface dataset:
Program: 71478
Project: 71478
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.setClip(clip.getCopy());
        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.clipRect(bounds);
        child.paint(graphics);
        graphics.restoreState();
      }
    }
  }
}
Program: 71479
Project: 71479
Buggy source:
public void layout(){
  boolean isInline=parent instanceof IInlineStackingLayout;
  if (isInline) {
    if (parent instanceof LineLayout) {
      ContainerLayout inlineContainer=new InlineContainerLayout(context,parent,content);
      inlineContainer.initialize();
      addTemplateArea(inlineContainer,true);
      inlineContainer.closeLayout();
    }
 else {
      addTemplateArea(parent,true);
    }
  }
 else {
    assert(parent instanceof BlockStackingLayout);
    if (content != null) {
      IStyle contentStyle=content.getComputedStyle();
      String align=contentStyle.getTextAlign();
      parent.content.getComputedStyle().setTextAlign(align);
    }
    LineLayout line=new LineLayout(context,parent);
    line.initialize();
    addTemplateArea(line,false);
    line.closeLayout();
  }
}

Fixed version (ground truth):
public void layout(){
  boolean isInline=parent instanceof IInlineStackingLayout;
  if (isInline) {
    if (parent instanceof LineLayout) {
      ContainerLayout inlineContainer=new InlineContainerLayout(context,parent,content);
      inlineContainer.initialize();
      addTemplateArea(inlineContainer,true);
      inlineContainer.closeLayout();
    }
 else {
      addTemplateArea(parent,true);
    }
  }
 else {
    assert(parent instanceof BlockStackingLayout);
    boolean inlineElement=PropertyUtil.isInlineElement(content);
    if (!inlineElement) {
      BlockTextLayout tLayout=new BlockTextLayout(context,parent,content);
      tLayout.initialize();
      LineLayout line=new LineLayout(context,tLayout);
      line.initialize();
      addTemplateArea(line,false);
      line.closeLayout();
      tLayout.closeLayout();
    }
  }
}
Program: 71480
Project: 71480
Buggy source:
public void testDataItemWithoutBookmark() throws EngineException, IOException {
  String designFile="String_Node_Str";
  String[][] bookmarksWithMetadata={{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"}};
  String[][] bookmarksWithoutMetadata={};
  checkAllTask(designFile,bookmarksWithMetadata,bookmarksWithoutMetadata);
}

Fixed version (ground truth):
public void testDataItemWithoutBookmark() throws EngineException, IOException {
  String designFile="String_Node_Str";
  String[][] bookmarksWithMetadata={{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"}};
  String[][] bookmarksWithoutMetadata={};
  checkAllTask(designFile,bookmarksWithMetadata,bookmarksWithoutMetadata);
}
Program: 71481
Project: 71481
Buggy source:
/** 
 * Tests active ids output by HtmlReportEmitter. <br> <br> Ids of following items should be output: <li> label <li> table <li> list <li> chart <li> all template items
 * @throws EngineException 
 * @throws IOException 
 */
public void testAllItems() throws EngineException, IOException {
  String designFile="String_Node_Str";
  String[][] bookmarksWithMetadata={{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"}};
  String[][] bookmarksWithoutMetadata={{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"}};
  checkAllTask(designFile,bookmarksWithMetadata,bookmarksWithoutMetadata);
}

Fixed version (ground truth):
/** 
 * Tests active ids output by HtmlReportEmitter. <br> <br> Ids of following items should be output: <li> label <li> table <li> list <li> chart <li> all template items
 * @throws EngineException 
 * @throws IOException 
 */
public void testAllItems() throws EngineException, IOException {
  String designFile="String_Node_Str";
  String[][] bookmarksWithMetadata={{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"}};
  String[][] bookmarksWithoutMetadata={{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"}};
  checkAllTask(designFile,bookmarksWithMetadata,bookmarksWithoutMetadata);
}
Program: 71482
Project: 71482
Buggy source:
/** 
 * Tests meatadata of data items in table hader/footer or table group header/footer and using the dataset of the table will be output.
 * @throws EngineException 
 * @throws IOException 
 */
public void testDataItem() throws EngineException, IOException {
  String designFile="String_Node_Str";
  String[][] bookmarksWithMetadata={{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"}};
  String[][] bookmarksWithoutMetadata={{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"}};
  checkAllTask(designFile,bookmarksWithMetadata,bookmarksWithoutMetadata);
}

Fixed version (ground truth):
/** 
 * Tests meatadata of data items in table hader/footer or table group header/footer and using the dataset of the table will be output.
 * @throws EngineException 
 * @throws IOException 
 */
public void testDataItem() throws EngineException, IOException {
  String designFile="String_Node_Str";
  String[][] bookmarksWithMetadata={{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"}};
  String[][] bookmarksWithoutMetadata={{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"}};
  checkAllTask(designFile,bookmarksWithMetadata,bookmarksWithoutMetadata);
}
Program: 71483
Project: 71483
Buggy source:
private StructureSource handleGraphicAction(StructureSource src,StructureSource previousSrc,ActionType actionType,boolean cleanState){
  if (previousSrc == null) {
    previousSrc=src;
    iv.registerAction(src,actionType);
    iun.repaintChart();
  }
 else   if (!iv.getSource(src).equals(iv.getSource(previousSrc))) {
    iv.unregisterAction(previousSrc,actionType);
    previousSrc=src;
    iv.registerAction(src,actionType);
    iun.repaintChart();
  }
 else {
    if (cleanState) {
      iv.unregisterAction(previousSrc,actionType);
      previousSrc=null;
      iun.repaintChart();
    }
  }
  return previousSrc;
}

Fixed version (ground truth):
private StructureSource handleGraphicAction(StructureSource src,StructureSource previousSrc,ActionType actionType,boolean cleanState){
  if (previousSrc == null) {
    previousSrc=src;
    iv.registerAction(src,actionType);
    iun.repaintChart();
  }
 else   if (!iv.getSource(src).equals(iv.getSource(previousSrc))) {
    if (actionType == ActionType.HIGHLIGHT_LITERAL) {
      iv.unregisterAction(previousSrc,actionType);
      previousSrc=src;
      iv.registerAction(src,actionType);
    }
 else {
      previousSrc=src;
      if (iv.isRegisteredAction(src,actionType)) {
        iv.unregisterAction(src,actionType);
      }
 else {
        iv.registerAction(src,actionType);
      }
    }
    iun.repaintChart();
  }
 else {
    if (cleanState) {
      iv.unregisterAction(previousSrc,actionType);
      previousSrc=null;
      iun.repaintChart();
    }
  }
  return previousSrc;
}
Program: 71484
Project: 71484
Buggy source:
private StructureSource handleGraphicAction(StructureSource src,StructureSource previousSrc,ActionType actionType,boolean cleanState){
  if (previousSrc == null) {
    previousSrc=src;
    iv.registerAction(src,actionType);
    iun.repaintChart();
  }
 else   if (!iv.getSource(src).equals(iv.getSource(previousSrc))) {
    iv.unregisterAction(previousSrc,actionType);
    previousSrc=src;
    iv.registerAction(src,actionType);
    iun.repaintChart();
  }
 else {
    if (cleanState) {
      iv.unregisterAction(previousSrc,actionType);
      previousSrc=null;
      iun.repaintChart();
    }
  }
  return previousSrc;
}

Fixed version (ground truth):
private StructureSource handleGraphicAction(StructureSource src,StructureSource previousSrc,ActionType actionType,boolean cleanState){
  if (previousSrc == null) {
    previousSrc=src;
    iv.registerAction(src,actionType);
    iun.repaintChart();
  }
 else   if (!iv.getSource(src).equals(iv.getSource(previousSrc))) {
    if (actionType == ActionType.HIGHLIGHT_LITERAL) {
      iv.unregisterAction(previousSrc,actionType);
      previousSrc=src;
      iv.registerAction(src,actionType);
    }
 else {
      previousSrc=src;
      if (iv.isRegisteredAction(src,actionType)) {
        iv.unregisterAction(src,actionType);
      }
 else {
        iv.registerAction(src,actionType);
      }
    }
    iun.repaintChart();
  }
 else {
    if (cleanState) {
      iv.unregisterAction(previousSrc,actionType);
      previousSrc=null;
      iun.repaintChart();
    }
  }
  return previousSrc;
}
Program: 71485
Project: 71485
Buggy source:
private void saveLine(LineAttributes line){
  if (!savedLines.containsKey(line))   savedLines.put(line,EcoreUtil.copy(line));
}

Fixed version (ground truth):
private void saveLine(LineAttributes line){
  if (!savedLines.containsKey(line))   savedLines.put(line,(LineAttributes)EcoreUtil.copy(line));
}
Program: 71486
Project: 71486
Buggy source:
public void modifyEvent(PrimitiveRenderEvent event){
  if (iun == null)   return;
  restoreEvent();
  String source=getSource((StructureSource)event.getSource());
  if (source == null)   return;
  Set typeSet=(Set)targets.get(source);
  if (typeSet != null) {
    for (Iterator iter=typeSet.iterator(); iter.hasNext(); ) {
      ActionType type=(ActionType)iter.next();
switch (type.getValue()) {
case ActionType.HIGHLIGHT:
        highlight(event);
      break;
case ActionType.TOGGLE_DATA_POINT_VISIBILITY:
    hideLabel(event);
  break;
case ActionType.TOGGLE_VISIBILITY:
hideElement(event);
break;
}
}
}
}

Fixed version (ground truth):
public void modifyEvent(PrimitiveRenderEvent event){
  if (iun == null)   return;
  restoreEvent();
  String source=getSource((StructureSource)event.getSource());
  if (source == null)   return;
  Set<ActionType> typeSet=targets.get(source);
  if (typeSet != null) {
    for (Iterator<ActionType> iter=typeSet.iterator(); iter.hasNext(); ) {
      ActionType type=iter.next();
switch (type.getValue()) {
case ActionType.HIGHLIGHT:
        highlight(event);
      break;
case ActionType.TOGGLE_DATA_POINT_VISIBILITY:
    hideLabel(event);
  break;
case ActionType.TOGGLE_VISIBILITY:
hideElement(event);
break;
}
}
}
}
Program: 71487
Project: 71487
Buggy source:
private void saveColor(ColorDefinition cd){
  if (!savedColors.containsKey(cd))   savedColors.put(cd,EcoreUtil.copy(cd));
}

Fixed version (ground truth):
private void saveColor(ColorDefinition cd){
  if (!savedColors.containsKey(cd))   savedColors.put(cd,(ColorDefinition)EcoreUtil.copy(cd));
}
Program: 71488
Project: 71488
Buggy source:
public void unregisterAction(StructureSource target,ActionType type){
  if (iun == null)   return;
  Object source=getSource(target);
  Set set=(Set)targets.get(source);
  if (set != null && set.size() > 1) {
    set.remove(type);
  }
 else {
    targets.remove(source);
  }
}

Fixed version (ground truth):
public void unregisterAction(StructureSource target,ActionType type){
  if (iun == null)   return;
  Object source=getSource(target);
  Set<ActionType> set=targets.get(source);
  if (set != null && set.size() > 1) {
    set.remove(type);
  }
 else {
    targets.remove(source);
  }
}
Program: 71489
Project: 71489
Buggy source:
protected void restoreEvent(){
  if (iun == null)   return;
  for (Iterator iter=savedColors.keySet().iterator(); iter.hasNext(); ) {
    ColorDefinition original=(ColorDefinition)iter.next();
    ColorDefinition copy=(ColorDefinition)savedColors.get(original);
    original.setBlue(copy.getBlue());
    original.setRed(copy.getRed());
    original.setGreen(copy.getGreen());
    original.setTransparency(copy.getTransparency());
  }
  savedColors.clear();
  for (Iterator iter=savedLines.keySet().iterator(); iter.hasNext(); ) {
    LineAttributes original=(LineAttributes)iter.next();
    LineAttributes copy=(LineAttributes)savedLines.get(original);
    original.setVisible(copy.isVisible());
  }
  savedLines.clear();
  for (Iterator iter=savedLabels.keySet().iterator(); iter.hasNext(); ) {
    Label original=(Label)iter.next();
    Label copy=(Label)savedLabels.get(original);
    original.setVisible(copy.isVisible());
    original.getCaption().setFont(copy.getCaption().getFont());
  }
  savedLabels.clear();
}

Fixed version (ground truth):
protected void restoreEvent(){
  if (iun == null)   return;
  for (Iterator<ColorDefinition> iter=savedColors.keySet().iterator(); iter.hasNext(); ) {
    ColorDefinition original=iter.next();
    ColorDefinition copy=savedColors.get(original);
    original.setBlue(copy.getBlue());
    original.setRed(copy.getRed());
    original.setGreen(copy.getGreen());
    original.setTransparency(copy.getTransparency());
  }
  savedColors.clear();
  for (Iterator<LineAttributes> iter=savedLines.keySet().iterator(); iter.hasNext(); ) {
    LineAttributes original=iter.next();
    LineAttributes copy=savedLines.get(original);
    original.setVisible(copy.isVisible());
  }
  savedLines.clear();
  for (Iterator<Label> iter=savedLabels.keySet().iterator(); iter.hasNext(); ) {
    Label original=iter.next();
    Label copy=savedLabels.get(original);
    original.setVisible(copy.isVisible());
    original.getCaption().setFont(copy.getCaption().getFont());
  }
  savedLabels.clear();
}
Program: 71490
Project: 71490
Buggy source:
private void saveLabel(Label label){
  if (!savedLabels.containsKey(label))   savedLabels.put(label,EcoreUtil.copy(label));
}

Fixed version (ground truth):
private void saveLabel(Label label){
  if (!savedLabels.containsKey(label))   savedLabels.put(label,(Label)EcoreUtil.copy(label));
}
Program: 71491
Project: 71491
Buggy source:
/** 
 * Register a chart element with an interactive action
 * @param target
 * @param type
 */
public boolean registerAction(StructureSource target,ActionType type){
  if (iun == null)   return false;
  String source=getSource(target);
  Set set=(Set)targets.get(source);
  if (set != null) {
    return set.add(type);
  }
 else {
    set=new HashSet();
    set.add(type);
    targets.put(source,set);
    return true;
  }
}

Fixed version (ground truth):
/** 
 * Register a chart element with an interactive action
 * @param target
 * @param type
 */
public boolean registerAction(StructureSource target,ActionType type){
  if (iun == null)   return false;
  String source=getSource(target);
  Set<ActionType> set=targets.get(source);
  if (set != null) {
    return set.add(type);
  }
 else {
    set=new HashSet<ActionType>();
    set.add(type);
    targets.put(source,set);
    return true;
  }
}
Program: 71493
Project: 71493
Buggy source:
protected void updateRtLFlag() throws EngineException {
  if (renderOptions == null)   return;
  IReportRunnable runnable=executionContext.getRunnable();
  if (runnable == null)   return;
  ReportDesignHandle handle=(ReportDesignHandle)runnable.getDesignHandle();
  if (handle != null) {
    Object bidiFlag=renderOptions.getOption(IRenderOption.RTL_FLAG);
    if (Boolean.TRUE.equals(bidiFlag)) {
      try {
        handle.setBidiOrientation(DesignChoiceConstants.BIDI_DIRECTION_RTL);
      }
 catch (      SemanticException e) {
        log.log(Level.WARNING,"String_Node_Str",e);
        throw new EngineException("String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
protected void updateRtLFlag() throws EngineException {
  if (renderOptions == null)   return;
  IReportRunnable runnable=executionContext.getRunnable();
  if (runnable == null)   return;
  ReportDesignHandle handle=(ReportDesignHandle)runnable.getDesignHandle();
  if (handle != null) {
    Object bidiFlag=renderOptions.getOption(IRenderOption.RTL_FLAG);
    if (Boolean.TRUE.equals(bidiFlag)) {
      try {
        handle.setBidiOrientation(DesignChoiceConstants.BIDI_DIRECTION_RTL);
      }
 catch (      SemanticException e) {
        log.log(Level.WARNING,"String_Node_Str",e);
        throw new EngineException("String_Node_Str");
      }
    }
 else     if (handle.isDirectionRTL()) {
      renderOptions.setOption(IRenderOption.RTL_FLAG,new Boolean(true));
      IRenderOption renderOptions2=executionContext.getRenderOption();
      if (renderOptions2 != null) {
        renderOptions2.setOption(IRenderOption.RTL_FLAG,new Boolean(true));
        executionContext.setRenderOption(renderOptions2);
      }
    }
  }
}
Program: 71496
Project: 71496
Buggy source:
protected void drawText(String text,float textX,float textY,float baseline,float width,float height,TextStyle textStyle){
  writer.drawText(text,textX,textY,width + 1f,height,textStyle.getFontInfo(),textStyle.getColor());
}

Fixed version (ground truth):
protected void drawText(String text,float textX,float textY,float baseline,float width,float height,TextStyle textStyle){
  writer.drawText(text,textX,textY,width + 1f,height,textStyle.getFontInfo(),textStyle.getColor(),textStyle.isRtl());
}
Program: 71497
Project: 71497
Buggy source:
public void createDummyTable(){
  setColumns(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"},new int[]{200,200,200});
  layout(true);
}

Fixed version (ground truth):
public void createDummyTable(){
  setColumns(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"},new int[]{200,200,200});
  layout(true);
  WizardBase.removeException();
}
Program: 71498
Project: 71498
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);
      if (isLevelRemoved) {
        CrosstabAdaptUtil.processInvaildBindings(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);
        }
      }
      AggregationCellProviderWrapper providerWrapper=new AggregationCellProviderWrapper(reportHandle);
      providerWrapper.updateAllAggregationCells(AggregationCellViewAdapter.SWITCH_VIEW_TYPE);
    }
  }
 catch (  SemanticException e) {
    rollBack();
    ExceptionHandler.handle(e);
    return;
  }
  transEnd();
}
Program: 71499
Project: 71499
Buggy source:
private boolean processor(List ori,List newList,List nullLevelHandle) throws SemanticException {
  boolean isLevelRemoved=false;
  for (int i=nullLevelHandle.size() - 1; i >= 0; i--) {
    int index=((Integer)nullLevelHandle.get(i)).intValue();
    viewHandle.removeLevel(index);
    isLevelRemoved=true;
  }
  for (int i=0; i < ori.size(); i++) {
    LevelHandle tempHandle=(LevelHandle)ori.get(i);
    if (!newList.contains(tempHandle)) {
      viewHandle.removeLevel(tempHandle.getQualifiedName());
      isLevelRemoved=true;
    }
  }
  Collections.sort(newList,new LevelComparator());
  for (int i=0; i < newList.size(); i++) {
    LevelHandle tempHandle=(LevelHandle)newList.get(i);
    if (viewHandle.getLevel(tempHandle.getQualifiedName()) == null) {
      insertLevelHandle(tempHandle,i);
    }
  }
  return isLevelRemoved;
}

Fixed version (ground truth):
private boolean processor(List ori,List newList,List nullLevelHandle,boolean doChange) throws SemanticException {
  boolean isLevelRemoved=false;
  for (int i=nullLevelHandle.size() - 1; i >= 0; i--) {
    int index=((Integer)nullLevelHandle.get(i)).intValue();
    if (doChange) {
      viewHandle.removeLevel(index);
    }
    isLevelRemoved=true;
  }
  for (int i=0; i < ori.size(); i++) {
    LevelHandle tempHandle=(LevelHandle)ori.get(i);
    if (!newList.contains(tempHandle)) {
      if (doChange) {
        viewHandle.removeLevel(tempHandle.getQualifiedName());
      }
      isLevelRemoved=true;
    }
  }
  Collections.sort(newList,new LevelComparator());
  if (doChange) {
    for (int i=0; i < newList.size(); i++) {
      LevelHandle tempHandle=(LevelHandle)newList.get(i);
      if (viewHandle.getLevel(tempHandle.getQualifiedName()) == null) {
        insertLevelHandle(tempHandle,i);
      }
    }
  }
  return isLevelRemoved;
}
Program: 71502
Project: 71502
Buggy source:
public void run(){
  if (dimensionHandle == null) {
    return;
  }
  transStar(NAME);
  try {
    CrosstabReportItemHandle handle=dimensionHandle.getCrosstab();
    dimensionHandle.getCrosstab().removeDimension(dimensionHandle.getAxisType(),dimensionHandle.getIndex());
    CrosstabAdaptUtil.processInvaildBindings(handle);
    AggregationCellProviderWrapper providerWrapper=new AggregationCellProviderWrapper((ExtendedItemHandle)handle.getModelHandle());
    providerWrapper.updateAllAggregationCells(AggregationCellViewAdapter.SWITCH_VIEW_TYPE);
  }
 catch (  SemanticException e) {
    rollBack();
    ExceptionHandler.handle(e);
    return;
  }
  transEnd();
}

Fixed version (ground truth):
public void run(){
  if (dimensionHandle == null) {
    return;
  }
  transStar(NAME);
  try {
    CrosstabReportItemHandle handle=dimensionHandle.getCrosstab();
    boolean bool=CrosstabAdaptUtil.needRemoveInvaildBindings(handle);
    dimensionHandle.getCrosstab().removeDimension(dimensionHandle.getAxisType(),dimensionHandle.getIndex());
    if (bool) {
      CrosstabAdaptUtil.removeInvalidBindings(handle);
    }
    AggregationCellProviderWrapper providerWrapper=new AggregationCellProviderWrapper((ExtendedItemHandle)handle.getModelHandle());
    providerWrapper.updateAllAggregationCells(AggregationCellViewAdapter.SWITCH_VIEW_TYPE);
  }
 catch (  SemanticException e) {
    rollBack();
    ExceptionHandler.handle(e);
    return;
  }
  transEnd();
}
Program: 71503
Project: 71503
Buggy source:
public void run(){
  CrosstabReportItemHandle reportItem=getCrosstabReportItemHandle(getHandle());
  if (reportItem != null) {
    transStar(NAME);
    try {
      reportItem.removeMeasure(measureViewHandle.getIndex());
      CrosstabAdaptUtil.processInvaildBindings(reportItem);
      AggregationCellProviderWrapper providerWrapper=new AggregationCellProviderWrapper((ExtendedItemHandle)reportItem.getModelHandle());
      providerWrapper.updateAllAggregationCells(AggregationCellViewAdapter.SWITCH_VIEW_TYPE);
    }
 catch (    SemanticException e) {
      rollBack();
      ExceptionHandler.handle(e);
      return;
    }
    transEnd();
  }
}

Fixed version (ground truth):
public void run(){
  CrosstabReportItemHandle reportItem=getCrosstabReportItemHandle(getHandle());
  if (reportItem != null) {
    transStar(NAME);
    try {
      boolean bool=CrosstabAdaptUtil.needRemoveInvaildBindings(reportItem);
      reportItem.removeMeasure(measureViewHandle.getIndex());
      if (bool) {
        CrosstabAdaptUtil.removeInvalidBindings(reportItem);
      }
      AggregationCellProviderWrapper providerWrapper=new AggregationCellProviderWrapper((ExtendedItemHandle)reportItem.getModelHandle());
      providerWrapper.updateAllAggregationCells(AggregationCellViewAdapter.SWITCH_VIEW_TYPE);
    }
 catch (    SemanticException e) {
      rollBack();
      ExceptionHandler.handle(e);
      return;
    }
    transEnd();
  }
}
Program: 71504
Project: 71504
Buggy source:
public void execute(){
  transStart(NAME);
  CrosstabReportItemHandle reportHandle=childViewHandle.getCrosstab();
  try {
    reportHandle.pivotDimension(childViewHandle.getAxisType(),childViewHandle.getIndex(),getType(),findPosition());
    CrosstabAdaptUtil.processInvaildBindings(reportHandle);
  }
 catch (  SemanticException e) {
    rollBack();
    ExceptionHandler.handle(e);
  }
  transEnd();
}

Fixed version (ground truth):
public void execute(){
  transStart(NAME);
  CrosstabReportItemHandle reportHandle=childViewHandle.getCrosstab();
  try {
    boolean bool=CrosstabAdaptUtil.needRemoveInvaildBindings(reportHandle);
    reportHandle.pivotDimension(childViewHandle.getAxisType(),childViewHandle.getIndex(),getType(),findPosition());
    if (bool) {
      CrosstabAdaptUtil.removeInvalidBindings(reportHandle);
    }
  }
 catch (  SemanticException e) {
    rollBack();
    ExceptionHandler.handle(e);
  }
  transEnd();
}
Program: 71505
Project: 71505
Buggy source:
/** 
 * Convert AWT shape to image map coordinates.
 * @param shape
 * @return
 */
private String shape2polyCoords(Shape shape){
  if (shape == null) {
    return null;
  }
  ArrayList al=new ArrayList();
  PathIterator pitr=shape.getPathIterator(null);
  double[] data=new double[6];
  while (!pitr.isDone()) {
    int type=pitr.currentSegment(data);
switch (type) {
case PathIterator.SEG_MOVETO:
      al.add(new Double(data[0]));
    al.add(new Double(data[1]));
  break;
case PathIterator.SEG_LINETO:
al.add(new Double(data[0]));
al.add(new Double(data[1]));
break;
case PathIterator.SEG_QUADTO:
al.add(new Double(data[0]));
al.add(new Double(data[1]));
al.add(new Double(data[2]));
al.add(new Double(data[3]));
break;
case PathIterator.SEG_CUBICTO:
al.add(new Double(data[0]));
al.add(new Double(data[1]));
al.add(new Double(data[2]));
al.add(new Double(data[3]));
al.add(new Double(data[4]));
al.add(new Double(data[5]));
break;
case PathIterator.SEG_CLOSE:
break;
}
pitr.next();
}
if (al.size() == 0) {
return null;
}
StringBuffer sb=new StringBuffer();
for (int i=0; i < al.size(); i++) {
Double db=(Double)al.get(i);
if (i > 0) {
sb.append("String_Node_Str");
}
sb.append((int)db.doubleValue());
}
return sb.toString();
}

Fixed version (ground truth):
/** 
 * Convert AWT shape to image map coordinates.
 * @param shape
 * @return
 */
private String shape2polyCoords(Shape shape){
  if (shape == null) {
    return null;
  }
  ArrayList al=new ArrayList();
  FlatteningPathIterator pitr=new FlatteningPathIterator(shape.getPathIterator(null),1);
  double[] data=new double[6];
  while (!pitr.isDone()) {
    int type=pitr.currentSegment(data);
switch (type) {
case PathIterator.SEG_MOVETO:
      al.add(new Double(data[0]));
    al.add(new Double(data[1]));
  break;
case PathIterator.SEG_LINETO:
al.add(new Double(data[0]));
al.add(new Double(data[1]));
break;
case PathIterator.SEG_QUADTO:
al.add(new Double(data[0]));
al.add(new Double(data[1]));
al.add(new Double(data[2]));
al.add(new Double(data[3]));
break;
case PathIterator.SEG_CUBICTO:
al.add(new Double(data[0]));
al.add(new Double(data[1]));
al.add(new Double(data[2]));
al.add(new Double(data[3]));
al.add(new Double(data[4]));
al.add(new Double(data[5]));
break;
case PathIterator.SEG_CLOSE:
break;
}
pitr.next();
}
if (al.size() == 0) {
return null;
}
StringBuffer sb=new StringBuffer();
for (int i=0; i < al.size(); i++) {
Double db=(Double)al.get(i);
if (i > 0) {
sb.append("String_Node_Str");
}
sb.append((int)db.doubleValue());
}
return sb.toString();
}
Program: 71506
Project: 71506
Buggy source:
protected void repeatHeader(){
  if (bandStatus == IBandContent.BAND_HEADER) {
    return;
  }
  ITableBandContent header=(ITableBandContent)tableContent.getHeader();
  if (!tableContent.isHeaderRepeat() || header == null) {
    return;
  }
  if (header.getChildren().isEmpty()) {
    return;
  }
  TableRegionLayout rLayout=getTableRegionLayout();
  rLayout.initialize(header);
  rLayout.layout();
  TableArea tableRegion=(TableArea)header.getExtension(IContent.LAYOUT_EXTENSION);
  if (tableRegion != null && tableRegion.getAllocatedHeight() < getCurrentMaxContentHeight()) {
    Iterator iter=tableRegion.getChildren();
    TableContext tableContext=(TableContext)contextList.getLast();
    while (iter.hasNext()) {
      ContainerArea area=(ContainerArea)iter.next();
      Iterator rowIter=area.getChildren();
      while (rowIter.hasNext()) {
        AbstractArea row=(AbstractArea)rowIter.next();
        if (row instanceof RowArea) {
          tableContext.layout.addRow((RowArea)row);
        }
      }
    }
    iter=tableRegion.getChildren();
    while (iter.hasNext()) {
      AbstractArea area=(AbstractArea)iter.next();
      addArea(area);
    }
  }
  content.setExtension(IContent.LAYOUT_EXTENSION,null);
}

Fixed version (ground truth):
protected void repeatHeader(){
  if (bandStatus == IBandContent.BAND_HEADER) {
    return;
  }
  ITableBandContent header=context.getWrappedTableHeader(content.getInstanceID());
  if (header == null || !tableContent.isHeaderRepeat()) {
    return;
  }
  if (header.getChildren().isEmpty()) {
    return;
  }
  TableRegionLayout rLayout=getTableRegionLayout();
  rLayout.initialize(header);
  rLayout.layout();
  TableArea tableRegion=(TableArea)header.getExtension(IContent.LAYOUT_EXTENSION);
  if (tableRegion != null && tableRegion.getAllocatedHeight() < getCurrentMaxContentHeight()) {
    Iterator iter=tableRegion.getChildren();
    TableContext tableContext=(TableContext)contextList.getLast();
    while (iter.hasNext()) {
      ContainerArea area=(ContainerArea)iter.next();
      Iterator rowIter=area.getChildren();
      while (rowIter.hasNext()) {
        AbstractArea row=(AbstractArea)rowIter.next();
        if (row instanceof RowArea) {
          tableContext.layout.addRow((RowArea)row);
        }
      }
    }
    iter=tableRegion.getChildren();
    while (iter.hasNext()) {
      AbstractArea area=(AbstractArea)iter.next();
      addArea(area);
    }
  }
  content.setExtension(IContent.LAYOUT_EXTENSION,null);
}
Program: 71507
Project: 71507
Buggy source:
protected void prepareQuery() throws DataException {
  try {
    IBinding[] bindings=null;
    if (this.queryDefn.getSourceQuery() instanceof SubqueryLocator) {
      this.queryResults=engine.getQueryResults(getParentQueryResultsID((SubqueryLocator)(queryDefn.getSourceQuery())));
      IQueryDefinition queryDefinition=queryResults.getPreparedQuery().getReportQueryDefn();
      bindings=getSubQueryBindings(queryDefinition,((SubqueryLocator)this.queryDefn.getSourceQuery()).getName());
    }
 else {
      this.queryResults=PreparedQueryUtil.newInstance(dataEngine,(IQueryDefinition)queryDefn.getSourceQuery(),null).execute(null);
      if (queryResults != null && queryResults.getPreparedQuery() != null) {
        IQueryDefinition queryDefinition=queryResults.getPreparedQuery().getReportQueryDefn();
        bindings=(IBinding[])queryDefinition.getBindings().values().toArray(new IBinding[0]);
      }
 else {
        bindings=new IBinding[0];
      }
    }
    for (int i=0; i < bindings.length; i++) {
      IBinding binding=bindings[i];
      this.queryDefn.addBinding(new Binding(binding.getBindingName(),new ScriptExpression(ExpressionUtil.createJSDataSetRowExpression(binding.getBindingName()),binding.getDataType())));
    }
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}

Fixed version (ground truth):
protected void prepareQuery() throws DataException {
  try {
    IBinding[] bindings=null;
    if (this.queryDefn.getSourceQuery() instanceof SubqueryLocator) {
      this.queryResults=engine.getQueryResults(getParentQueryResultsID((SubqueryLocator)(queryDefn.getSourceQuery())));
      IQueryDefinition queryDefinition=queryResults.getPreparedQuery().getReportQueryDefn();
      if (queryDefn.getSourceQuery() instanceof SubqueryLocator) {
        ArrayList<IBinding> bindingList=new ArrayList<IBinding>();
        getSubQueryBindings(queryDefinition,((SubqueryLocator)queryDefn.getSourceQuery()).getName(),bindingList);
        addQueryBindings(bindingList,queryDefinition.getBindings().values());
        bindings=bindingList.toArray(new IBinding[0]);
      }
 else {
        bindings=(IBinding[])(queryDefinition.getBindings().values().toArray(new IBinding[0]));
      }
    }
 else {
      this.queryResults=PreparedQueryUtil.newInstance(dataEngine,(IQueryDefinition)queryDefn.getSourceQuery(),null).execute(null);
      if (queryResults != null && queryResults.getPreparedQuery() != null) {
        IQueryDefinition queryDefinition=queryResults.getPreparedQuery().getReportQueryDefn();
        bindings=(IBinding[])queryDefinition.getBindings().values().toArray(new IBinding[0]);
      }
 else {
        bindings=new IBinding[0];
      }
    }
    for (int i=0; i < bindings.length; i++) {
      IBinding binding=bindings[i];
      this.queryDefn.addBinding(new Binding(binding.getBindingName(),new ScriptExpression(ExpressionUtil.createJSDataSetRowExpression(binding.getBindingName()),binding.getDataType())));
    }
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}
Program: 71508
Project: 71508
Buggy source:
/** 
 * @param subqueryDefinitions
 * @param subQueryName
 * @return
 */
private static IBinding[] getSubQueryBindings(SubqueryDefinition[] subqueryDefinitions,String subQueryName){
  for (int j=0; j < subqueryDefinitions.length; j++) {
    if (subqueryDefinitions[j].getName() != null && subqueryDefinitions[j].getName().equals(subQueryName)) {
      return (IBinding[])subqueryDefinitions[j].getBindings().values().toArray(new IBinding[0]);
    }
    IBinding[] bindings=getSubQueryBindings(subqueryDefinitions[j],subQueryName);
    if (bindings != null) {
      return bindings;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * @param subqueryDefinitions
 * @param subQueryName
 * @return
 * @throws DataException 
 */
private static void getSubQueryBindings(SubqueryDefinition[] subqueryDefinitions,String subQueryName,List<IBinding> resultBindingList) throws DataException {
  for (int j=0; j < subqueryDefinitions.length; j++) {
    if (subqueryDefinitions[j].getName() != null && subqueryDefinitions[j].getName().equals(subQueryName)) {
      addQueryBindings(resultBindingList,subqueryDefinitions[j].getBindings().values());
      return;
    }
    getSubQueryBindings(subqueryDefinitions[j],subQueryName,resultBindingList);
    if (resultBindingList.size() > 0) {
      addQueryBindings(resultBindingList,subqueryDefinitions[j].getBindings().values());
      return;
    }
  }
  return;
}
Program: 71509
Project: 71509
Buggy source:
protected void closeFirstN(int size){
  for (int i=0; i < size; i++) {
    closeLayout(contextList.removeFirst(),i,size,false);
  }
  setCurrentContext(0);
  if (parent != null) {
    parent.closeFirstN(size);
  }
}

Fixed version (ground truth):
protected void closeFirstN(int size){
  int rowSize=contextList.size();
  for (int i=0; i < size; i++) {
    closeLayout(contextList.removeFirst(),i,rowSize,i,false);
  }
  setCurrentContext(0);
  if (parent != null) {
    parent.closeFirstN(size);
  }
}
Program: 71510
Project: 71510
Buggy source:
protected String getEscapedStr(String s,boolean whitespace){
  s=super.getEscapedStr(s,whitespace);
  StringBuffer result=null;
  char[] s2char=s.toCharArray();
  for (int i=0, max=s2char.length, delta=0; i < max; i++) {
    char c=s2char[i];
    String replacement=null;
    if (c == '\n') {
      replacement="String_Node_Str";
    }
    if (replacement != null) {
      if (result == null) {
        result=new StringBuffer(s);
      }
      result.replace(i + delta,i + delta + 1,replacement);
      delta+=(replacement.length() - 1);
    }
  }
  if (result == null) {
    return s;
  }
  return result.toString();
}

Fixed version (ground truth):
protected String getEscapedStr(String s,boolean whitespace){
  s=super.getEscapedStr(s,whitespace);
  StringBuffer buffer=new StringBuffer();
  for (int i=0, max=s.length(), delta=0; i < max; i++) {
    char c=s.charAt(i);
    if (c == '\n' || c == '\r') {
      buffer.append("String_Node_Str");
      if (c == '\r' && i + 1 < max && s.charAt(i + 1) == '\n') {
        i++;
      }
    }
 else {
      buffer.append(c);
    }
  }
  return buffer.toString();
}
Program: 71511
Project: 71511
Buggy source:
public void testTrimRight(){
  String script1="String_Node_Str" + str + "String_Node_Str";
  String script2="String_Node_Str" + null + "String_Node_Str";
  assertEquals(((String)cx.evaluateString(scope,script1,"String_Node_Str",1,null)),"String_Node_Str");
  assertEquals(((String)cx.evaluateString(scope,script2,"String_Node_Str",1,null)),null);
}

Fixed version (ground truth):
public void testTrimRight(){
  String script1="String_Node_Str" + str + "String_Node_Str";
  String script2="String_Node_Str" + null + "String_Node_Str";
  String script3="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  assertEquals(((String)cx.evaluateString(scope,script1,"String_Node_Str",1,null)),"String_Node_Str");
  assertEquals(((String)cx.evaluateString(scope,script2,"String_Node_Str",1,null)),null);
  assertEquals(((String)cx.evaluateString(scope,script3,"String_Node_Str",1,null)),"String_Node_Str");
}
Program: 71512
Project: 71512
Buggy source:
/** 
 * Removes all trailing blanks. Leading blanks and blanks between words are not removed.
 * @param str
 * @return
 */
private String trimRight(String str){
  if (str == null)   return null;
 else {
    byte[] value=str.getBytes();
    int end=str.length();
    while ((end < str.length()) && (value[str.length() - 1] <= ' ')) {
      end--;
    }
    return (end < str.length()) ? str.substring(0,end) : str;
  }
}

Fixed version (ground truth):
/** 
 * Removes all trailing blanks. Leading blanks and blanks between words are not removed.
 * @param str
 * @return
 */
private String trimRight(String str){
  if (str == null)   return null;
 else {
    byte[] value=str.getBytes();
    int end=str.length();
    while ((end > 0) && (value[end - 1] <= ' ')) {
      end--;
    }
    return (end < str.length()) ? str.substring(0,end) : str;
  }
}
Program: 71513
Project: 71513
Buggy source:
protected void endContainerInPages(IContent content,boolean finished,IContentEmitter emitter,boolean visible){
  if (currentTableIndex == nestCount && currentTableIndex > 0) {
    for (int i=0; i < buffers.length - 1; i++) {
      buffers[i].endContainer(content,finished,emitter,visible);
    }
    buffers[buffers.length - 1].endContainer(content,finished,emitter,visible);
  }
 else {
    currentBuffer.endContainer(content,finished,emitter,visible);
  }
}

Fixed version (ground truth):
protected void endContainerInPages(IContent content,boolean finished,IContentEmitter emitter,boolean visible){
  if (currentTableIndex == nestCount && currentTableIndex > 0) {
    for (int i=0; i < buffers.length - 1; i++) {
      buffers[i].endContainer(content,false,emitter,visible);
    }
    buffers[buffers.length - 1].endContainer(content,finished,emitter,visible);
  }
 else {
    currentBuffer.endContainer(content,finished,emitter,visible);
  }
}
Program: 71514
Project: 71514
Buggy source:
/** 
 * Contructor
 * @param launch
 * @param vm
 * @param name
 * @param process
 * @param listenPort
 * @param eventPort
 * @param tempFolder
 */
public ScriptDebugTarget(ILaunch launch,ReportVMClient vm,String name,IProcess process,int listenPort,String tempFolder){
  super(null);
  this.launch=launch;
  this.reportVM=vm;
  this.name=name;
  this.process=process;
  this.tempFolder=tempFolder;
  this.listenPort=listenPort;
  launch.addDebugTarget(this);
  vm.addVMListener(this);
  setTerminating(false);
  setTerminated(false);
  thread=new ScriptDebugThread(this);
  threads=new IThread[]{thread};
  DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener(this);
  while (!isTerminated()) {
    try {
      vm.connect(listenPort);
      break;
    }
 catch (    VMException e) {
      try {
        Thread.sleep(100);
      }
 catch (      InterruptedException e1) {
      }
      continue;
    }
  }
}

Fixed version (ground truth):
/** 
 * Contructor
 * @param launch
 * @param vm
 * @param name
 * @param process
 * @param listenPort
 * @param eventPort
 * @param tempFolder
 */
public ScriptDebugTarget(ILaunch launch,ReportVMClient vm,String name,IProcess process,int listenPort,String tempFolder){
  super(null);
  this.launch=launch;
  this.reportVM=vm;
  this.name=name;
  this.process=process;
  this.tempFolder=tempFolder;
  this.listenPort=listenPort;
  launch.addDebugTarget(this);
  vm.addVMListener(this);
  setTerminating(false);
  setTerminated(false);
  thread=new ScriptDebugThread(this);
  threads=new IThread[]{thread};
  DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener(this);
  DebugPlugin.getDefault().getBreakpointManager().addBreakpointManagerListener(this);
  while (!isTerminated()) {
    try {
      vm.connect(listenPort);
      break;
    }
 catch (    VMException e) {
      try {
        Thread.sleep(100);
      }
 catch (      InterruptedException e1) {
      }
      continue;
    }
  }
}
Program: 71515
Project: 71515
Buggy source:
private void terminated(){
  DebugPlugin.getDefault().getBreakpointManager().removeBreakpointListener(this);
  setTerminating(false);
  if (!fTerminated) {
    setTerminated(true);
    reportVM.disconnect();
    fireTerminateEvent();
  }
  breakPoints.clear();
}

Fixed version (ground truth):
private void terminated(){
  DebugPlugin.getDefault().getBreakpointManager().removeBreakpointListener(this);
  DebugPlugin.getDefault().getBreakpointManager().removeBreakpointManagerListener(this);
  setTerminating(false);
  if (!fTerminated) {
    setTerminated(true);
    reportVM.disconnect();
    fireTerminateEvent();
  }
  breakPoints.clear();
}
Program: 71516
Project: 71516
Buggy source:
public void breakpointAdded(IBreakpoint breakpoint){
  if (!supportsBreakpoint(breakpoint)) {
    return;
  }
  try {
    if (!breakpoint.isEnabled()) {
      return;
    }
  }
 catch (  CoreException e1) {
    return;
  }
  JsLineBreakPoint point=createJsLineBreakPoint((ScriptLineBreakpoint)breakpoint);
  try {
    if (ScriptLineBreakpoint.RUNTOLINE.equals(((ScriptLineBreakpoint)breakpoint).getType())) {
      reportVM.addBreakPoint(point);
    }
 else     if ((!breakPoints.contains(point))) {
      breakPoints.add(point);
      reportVM.addBreakPoint(point);
    }
  }
 catch (  VMException e) {
    logger.warning(e.getMessage());
  }
}

Fixed version (ground truth):
public void breakpointAdded(IBreakpoint breakpoint){
  if (!supportsBreakpoint(breakpoint)) {
    return;
  }
  try {
    if (!breakpoint.isEnabled()) {
      return;
    }
  }
 catch (  CoreException e1) {
    return;
  }
  ScriptLineBreakpoint scriptPoint=(ScriptLineBreakpoint)breakpoint;
  try {
    if (scriptPoint.shouldSkipBreakpoint()) {
      return;
    }
  }
 catch (  CoreException e1) {
  }
  JsLineBreakPoint point=createJsLineBreakPoint(scriptPoint);
  try {
    if (ScriptLineBreakpoint.RUNTOLINE.equals(((ScriptLineBreakpoint)breakpoint).getType())) {
      reportVM.addBreakPoint(point);
    }
 else     if ((!breakPoints.contains(point))) {
      breakPoints.add(point);
      reportVM.addBreakPoint(point);
    }
  }
 catch (  VMException e) {
    logger.warning(e.getMessage());
  }
}
Program: 71518
Project: 71518
Buggy source:
public void setPageRange(String pageRange) throws EngineException {
  long totalVisiblePageCount=RenderTask.this.getTotalPage();
  List list=PageSequenceParse.parsePageSequence(pageRange,totalVisiblePageCount);
  if (list.size() == 1) {
    long[] range=(long[])list.get(0);
    if (range[0] == 1 && range[1] == totalVisiblePageCount) {
      innerRender=new AllPageRender(new long[]{1,totalVisiblePageCount});
      return;
    }
  }
  innerRender=new PageRangeRender(list);
}

Fixed version (ground truth):
public void setPageRange(String pageRange) throws EngineException {
  long totalVisiblePageCount=RenderTask.this.getTotalPage();
  List list=PageSequenceParse.parsePageSequence(pageRange,totalVisiblePageCount);
  if (list.size() == 1) {
    long[] range=(long[])list.get(0);
    long totalPageCount=reportDocument.getPageCount();
    if (range[0] == 1 && range[1] == totalPageCount) {
      innerRender=new AllPageRender(new long[]{1,totalPageCount});
      return;
    }
  }
  innerRender=new PageRangeRender(list);
}