nus-yam/ex-repair huggingface dataset:
Program: 58466
Project: 58466
Buggy source:
private void calculateClusterXOffset(HeatMapWrapper heatMapWrapper){
  sortedClustersXOffsetUp.clear();
  sortedClustersXOffsetDown.clear();
  for (  ContentVirtualArray va : leftHeatMapWrapper.getContentVAsOfHeatMaps()) {
    int contentID=va.get(0);
    Vec2f leftPos;
    if (heatMapWrapper == leftHeatMapWrapper)     leftPos=heatMapWrapper.getRightOverviewLinkPositionFromContentID(contentID);
 else     leftPos=heatMapWrapper.getLeftOverviewLinkPositionFromContentID(contentID);
    if (leftPos == null)     return;
    Vec2f rightPos;
    if (heatMapWrapper == leftHeatMapWrapper)     rightPos=heatMapWrapper.getLeftDetailLinkPositionFromContentID(contentID);
 else     rightPos=heatMapWrapper.getRightDetailLinkPositionFromContentID(contentID);
    if (rightPos == null)     return;
    Pair<Float,Integer> xDiffToContentID=new Pair<Float,Integer>();
    float yDiff=rightPos.y() - leftPos.y();
    xDiffToContentID.set(yDiff,contentID);
    if (yDiff > 0)     sortedClustersXOffsetUp.add(xDiffToContentID);
 else     sortedClustersXOffsetDown.add(xDiffToContentID);
  }
  Collections.sort(sortedClustersXOffsetUp);
  Collections.sort(sortedClustersXOffsetDown);
  Collections.reverse(sortedClustersXOffsetDown);
}

Fixed version (ground truth):
private void calculateClusterXOffset(HeatMapWrapper heatMapWrapper){
  sortedClustersXOffsetUp.clear();
  sortedClustersXOffsetDown.clear();
  for (  ContentVirtualArray va : heatMapWrapper.getContentVAsOfHeatMaps()) {
    int contentID=va.get(0);
    Vec2f leftPos;
    if (heatMapWrapper == leftHeatMapWrapper)     leftPos=heatMapWrapper.getRightOverviewLinkPositionFromContentID(contentID);
 else     leftPos=heatMapWrapper.getLeftOverviewLinkPositionFromContentID(contentID);
    if (leftPos == null)     return;
    Vec2f rightPos;
    if (heatMapWrapper == leftHeatMapWrapper)     rightPos=heatMapWrapper.getLeftDetailLinkPositionFromContentID(contentID);
 else     rightPos=heatMapWrapper.getRightDetailLinkPositionFromContentID(contentID);
    if (rightPos == null)     return;
    Pair<Float,Integer> xDiffToContentID=new Pair<Float,Integer>();
    float yDiff=rightPos.y() - leftPos.y();
    xDiffToContentID.set(yDiff,contentID);
    if (yDiff > 0)     sortedClustersXOffsetUp.add(xDiffToContentID);
 else     sortedClustersXOffsetDown.add(xDiffToContentID);
  }
  Collections.sort(sortedClustersXOffsetUp);
  Collections.sort(sortedClustersXOffsetDown);
  Collections.reverse(sortedClustersXOffsetDown);
}
Program: 58467
Project: 58467
Buggy source:
@Override public void registerEventListeners(){
  super.registerEventListeners();
  selectionUpdateListener=new SelectionUpdateListener();
  selectionUpdateListener.setHandler(this);
  eventPublisher.addListener(SelectionUpdateEvent.class,selectionUpdateListener);
  contentVAUpdateListener=new ContentVAUpdateListener();
  contentVAUpdateListener.setHandler(this);
  eventPublisher.addListener(VirtualArrayUpdateEvent.class,contentVAUpdateListener);
  storageVAUpdateListener=new StorageVAUpdateListener();
  storageVAUpdateListener.setHandler(this);
  eventPublisher.addListener(VirtualArrayUpdateEvent.class,storageVAUpdateListener);
  selectionCommandListener=new SelectionCommandListener();
  selectionCommandListener.setHandler(this);
  eventPublisher.addListener(SelectionCommandEvent.class,selectionCommandListener);
  redrawViewListener=new RedrawViewListener();
  redrawViewListener.setHandler(this);
  eventPublisher.addListener(RedrawViewEvent.class,redrawViewListener);
  clearSelectionsListener=new ClearSelectionsListener();
  clearSelectionsListener.setHandler(this);
  eventPublisher.addListener(ClearSelectionsEvent.class,clearSelectionsListener);
  replaceContentVAListener=new ReplaceContentVAListener();
  replaceContentVAListener.setHandler(this);
  eventPublisher.addListener(ReplaceContentVAEvent.class,replaceContentVAListener);
  replaceStorageVAListener=new ReplaceStorageVAListener();
  replaceStorageVAListener.setHandler(this);
  eventPublisher.addListener(ReplaceContentVAEvent.class,replaceStorageVAListener);
}

Fixed version (ground truth):
@Override public void registerEventListeners(){
  super.registerEventListeners();
  selectionUpdateListener=new SelectionUpdateListener();
  selectionUpdateListener.setHandler(this);
  eventPublisher.addListener(SelectionUpdateEvent.class,selectionUpdateListener);
  contentVAUpdateListener=new ContentVAUpdateListener();
  contentVAUpdateListener.setHandler(this);
  eventPublisher.addListener(ContentVAUpdateEvent.class,contentVAUpdateListener);
  storageVAUpdateListener=new StorageVAUpdateListener();
  storageVAUpdateListener.setHandler(this);
  eventPublisher.addListener(StorageVAUpdateEvent.class,storageVAUpdateListener);
  selectionCommandListener=new SelectionCommandListener();
  selectionCommandListener.setHandler(this);
  eventPublisher.addListener(SelectionCommandEvent.class,selectionCommandListener);
  redrawViewListener=new RedrawViewListener();
  redrawViewListener.setHandler(this);
  eventPublisher.addListener(RedrawViewEvent.class,redrawViewListener);
  clearSelectionsListener=new ClearSelectionsListener();
  clearSelectionsListener.setHandler(this);
  eventPublisher.addListener(ClearSelectionsEvent.class,clearSelectionsListener);
  replaceContentVAListener=new ReplaceContentVAListener();
  replaceContentVAListener.setHandler(this);
  eventPublisher.addListener(ReplaceContentVAEvent.class,replaceContentVAListener);
  replaceStorageVAListener=new ReplaceStorageVAListener();
  replaceStorageVAListener.setHandler(this);
  eventPublisher.addListener(ReplaceContentVAEvent.class,replaceStorageVAListener);
}
Program: 58468
Project: 58468
Buggy source:
public final IVirtualArray getContentVA(){
  return contentVA;
}

Fixed version (ground truth):
public ContentVirtualArray getContentVA(){
  return contentVA;
}
Program: 58472
Project: 58472
Buggy source:
private Pair<Integer,Integer> getBoundaryIndicesOfElementsInFocus(){
  float sliderHeight=slider.getSliderHeight();
  float sliderBottomPositionY=slider.getSliderPositionY();
  float sliderTopPositionY=sliderBottomPositionY + sliderHeight;
  float overviewHeight=layout.getOverviewHeight();
  float sampleHeight=overviewHeight / ((float)contentVA.size());
  int numSamplesInFocus=(int)Math.ceil(sliderHeight / sampleHeight);
  int sampleIndexTop=(int)Math.floor((overviewHeight - (sliderTopPositionY - layout.getOverviewPosition().y())) / sampleHeight);
  if (sampleIndexTop < 0)   sampleIndexTop=0;
  int sampleIndexBottom=sampleIndexTop + numSamplesInFocus;
  if (sampleIndexBottom >= contentVA.size()) {
    sampleIndexBottom=contentVA.size() - 1;
    if (sampleIndexTop - sampleIndexBottom < numSamplesInFocus)     sampleIndexTop=sampleIndexBottom - numSamplesInFocus;
  }
  if (sampleIndexTop < 0) {
    sampleIndexTop=0;
    if (sampleIndexTop - sampleIndexBottom < numSamplesInFocus)     sampleIndexBottom=sampleIndexBottom + numSamplesInFocus;
  }
  return new Pair<Integer,Integer>(sampleIndexTop,sampleIndexBottom);
}

Fixed version (ground truth):
private Pair<Integer,Integer> getBoundaryIndicesOfElementsInFocus(){
  float sliderBottomPositionY=slider.getSliderBottomPositionY();
  float sliderHeight=slider.getSliderHeight();
  float sliderTopPositionY=sliderBottomPositionY + sliderHeight;
  float overviewHeight=layout.getOverviewHeight();
  float sampleHeight=overviewHeight / ((float)contentVA.size());
  int numSamplesInFocus=(int)Math.ceil(sliderHeight / sampleHeight);
  int sampleIndexTop=(int)Math.floor((overviewHeight - (sliderTopPositionY - layout.getOverviewPosition().y())) / sampleHeight);
  if (sampleIndexTop < 0)   sampleIndexTop=0;
  int sampleIndexBottom=sampleIndexTop + numSamplesInFocus;
  if (sampleIndexBottom >= contentVA.size()) {
    sampleIndexBottom=contentVA.size() - 1;
    if (sampleIndexTop - sampleIndexBottom < numSamplesInFocus)     sampleIndexTop=sampleIndexBottom - numSamplesInFocus;
  }
  if (sampleIndexTop < 0) {
    sampleIndexTop=0;
    if (sampleIndexTop - sampleIndexBottom < numSamplesInFocus)     sampleIndexBottom=sampleIndexBottom + numSamplesInFocus;
  }
  return new Pair<Integer,Integer>(sampleIndexTop,sampleIndexBottom);
}
Program: 58473
Project: 58473
Buggy source:
private void handleBodyDragging(float pickedYCoordinate){
  float newSliderPositionY=pickedYCoordinate - draggingSpacing;
  setSliderPositionY(newSliderPositionY);
  setRelativeYPosition(getRelativeYCoordinate(sliderPositionY));
}

Fixed version (ground truth):
private void handleBodyDragging(float pickedYCoordinate){
  float newSliderBottomPositionY=pickedYCoordinate - draggingSpacing;
  float sliderHeight=sliderTopPositionY - sliderBottomPositionY;
  float newSliderTopPositionY=newSliderBottomPositionY + sliderHeight;
  if (newSliderBottomPositionY + sliderHeight > layout.getOverviewMaxSliderPositionY()) {
    newSliderBottomPositionY=layout.getOverviewMaxSliderPositionY() - sliderHeight;
    newSliderTopPositionY=layout.getOverviewMaxSliderPositionY();
  }
 else   if (newSliderBottomPositionY < layout.getOverviewMinSliderPositionY()) {
    newSliderBottomPositionY=layout.getOverviewMinSliderPositionY();
    newSliderTopPositionY=layout.getOverviewMinSliderPositionY() + sliderHeight;
  }
  setSliderBottomPositionY(newSliderBottomPositionY);
  relativeBottomPositionY=getRelativeYCoordinate(sliderBottomPositionY);
  setSliderTopPositionY(newSliderTopPositionY);
  relativeTopPositionY=getRelativeYCoordinate(sliderTopPositionY);
}
Program: 58474
Project: 58474
Buggy source:
public VerticalSlider(HeatMapLayout layout){
  relativeSliderHeight=0.25f;
  relativePositionY=0.75f;
  this.layout=layout;
}

Fixed version (ground truth):
public VerticalSlider(HeatMapLayout layout){
  relativeTopPositionY=1.0f;
  relativeBottomPositionY=0.75f;
  this.layout=layout;
}
Program: 58475
Project: 58475
Buggy source:
public boolean handleDragging(GL gl,GLMouseListener glMouseListener){
  if (!isArrowDownDragging && !isArrowUpDragging && !isBodyDragging)   return false;
  Point pickedPoint=glMouseListener.getPickedPoint();
  float[] fArTargetWorldCoordinates=GLCoordinateUtils.convertWindowCoordinatesToWorldCoordinates(gl,pickedPoint.x,pickedPoint.y);
  float pickedYCoordinate=fArTargetWorldCoordinates[1];
  if (isDraggingFirstTime) {
    isDraggingFirstTime=false;
    if (isArrowUpDragging) {
      draggingSpacing=pickedYCoordinate - (sliderPositionY + sliderHeight);
    }
 else {
      draggingSpacing=pickedYCoordinate - sliderPositionY;
    }
  }
  if (isBodyDragging) {
    handleBodyDragging(pickedYCoordinate);
  }
 else   if (isArrowDownDragging) {
    handleArrowDownDragging(pickedYCoordinate);
  }
 else {
    handleArrowUpDragging(pickedYCoordinate);
  }
  if (glMouseListener.wasMouseReleased()) {
    isBodyDragging=false;
    isArrowUpDragging=false;
    isArrowDownDragging=false;
  }
  return true;
}

Fixed version (ground truth):
public boolean handleDragging(GL gl,GLMouseListener glMouseListener){
  if (!isArrowDownDragging && !isArrowUpDragging && !isBodyDragging)   return false;
  Point pickedPoint=glMouseListener.getPickedPoint();
  float[] fArTargetWorldCoordinates=GLCoordinateUtils.convertWindowCoordinatesToWorldCoordinates(gl,pickedPoint.x,pickedPoint.y);
  float pickedYCoordinate=fArTargetWorldCoordinates[1];
  if (isDraggingFirstTime) {
    isDraggingFirstTime=false;
    if (isArrowUpDragging) {
      draggingSpacing=pickedYCoordinate - sliderTopPositionY;
    }
 else {
      draggingSpacing=pickedYCoordinate - sliderBottomPositionY;
    }
  }
  if (isBodyDragging) {
    handleBodyDragging(pickedYCoordinate);
  }
 else   if (isArrowDownDragging) {
    handleArrowDownDragging(pickedYCoordinate);
  }
 else {
    handleArrowUpDragging(pickedYCoordinate);
  }
  if (glMouseListener.wasMouseReleased()) {
    isBodyDragging=false;
    isArrowUpDragging=false;
    isArrowDownDragging=false;
  }
  return true;
}
Program: 58477
Project: 58477
Buggy source:
public float getSliderHeight(){
  return sliderHeight;
}

Fixed version (ground truth):
public float getSliderHeight(){
  return sliderTopPositionY - sliderBottomPositionY;
}
Program: 58478
Project: 58478
Buggy source:
private void handleArrowUpDragging(float pickedYCoordinate){
  float newTopPositionY=pickedYCoordinate - draggingSpacing;
  setSliderHeight(newTopPositionY - sliderPositionY);
  setRelativeSliderHeight(getRelativeSize(sliderHeight));
}

Fixed version (ground truth):
private void handleArrowUpDragging(float pickedYCoordinate){
  float newSliderTopPositionY=pickedYCoordinate - draggingSpacing;
  setSliderTopPositionY(newSliderTopPositionY);
  relativeTopPositionY=getRelativeYCoordinate(sliderTopPositionY);
}
Program: 58479
Project: 58479
Buggy source:
private void handleArrowDownDragging(float pickedYCoordinate){
  float newSliderPositionY=pickedYCoordinate - draggingSpacing;
  float sliderTopPositionY=sliderPositionY + sliderHeight;
  if (newSliderPositionY > sliderTopPositionY - 2.0f * arrowHeight)   newSliderPositionY=sliderTopPositionY - 2.0f * arrowHeight;
  setSliderPositionY(newSliderPositionY);
  setSliderHeight(sliderTopPositionY - sliderPositionY);
  relativeSliderHeight=getRelativeSize(sliderHeight);
  setRelativeYPosition(getRelativeYCoordinate(sliderPositionY));
}

Fixed version (ground truth):
private void handleArrowDownDragging(float pickedYCoordinate){
  float newSliderBottomPositionY=pickedYCoordinate - draggingSpacing;
  setSliderBottomPositionY(newSliderBottomPositionY);
  relativeBottomPositionY=getRelativeYCoordinate(sliderBottomPositionY);
}
Program: 58480
Project: 58480
Buggy source:
private void UpdateSelection(){
  float XScale=renderStyle.getRenderWidth() - XYAXISDISTANCE * 2.0f;
  float YScale=renderStyle.getRenderHeight() - XYAXISDISTANCE * 2.0f;
  float x=0.0f;
  float y=0.0f;
  for (  Integer iContentIndex : contentVA) {
    if (iContentIndex == -1) {
      continue;
    }
    float xnormalized=set.get(SELECTED_X_AXIS).getFloat(EDataRepresentation.NORMALIZED,iContentIndex);
    float ynormalized=set.get(SELECTED_Y_AXIS).getFloat(EDataRepresentation.NORMALIZED,iContentIndex);
    x=transformOnZoom(xnormalized) * XScale;
    y=ynormalized * YScale;
    if (IsInSelectionRectangle(x,y)) {
      elementSelectionManager.addToType(currentSelection,iContentIndex);
    }
  }
}

Fixed version (ground truth):
private void UpdateSelection(){
  float XScale=renderStyle.getRenderWidth() - XYAXISDISTANCE * 2.0f;
  float YScale=renderStyle.getRenderHeight() - XYAXISDISTANCE * 2.0f;
  float x=0.0f;
  float y=0.0f;
  for (  Integer iContentIndex : contentVA) {
    if (iContentIndex == -1) {
      continue;
    }
    float xnormalized=set.get(storageVA.get(SELECTED_X_AXIS)).getFloat(EDataRepresentation.NORMALIZED,iContentIndex);
    float ynormalized=set.get(storageVA.get(SELECTED_Y_AXIS)).getFloat(EDataRepresentation.NORMALIZED,iContentIndex);
    x=transformOnZoom(xnormalized) * XScale;
    y=ynormalized * YScale;
    if (IsInSelectionRectangle(x,y)) {
      elementSelectionManager.addToType(currentSelection,iContentIndex);
    }
  }
}
Program: 58482
Project: 58482
Buggy source:
@Override public void init(GL gl){
  renderStyle=new ScatterPlotRenderStyle(this,viewFrustum);
  super.renderStyle=renderStyle;
  opengl=gl;
  InitAxisComboEvent initAxisComboEvent=new InitAxisComboEvent();
  initAxisComboEvent.setSender(this);
  initAxisComboEvent.setAxisNames(this.getAxisString());
  GeneralManager.get().getEventPublisher().triggerEvent(initAxisComboEvent);
  detailLevel=EDetailLevel.HIGH;
  if (MAX_AXES > storageVA.size())   MAX_AXES=storageVA.size();
  renderStyle.setTextureNr(100,100);
  resetFullTextures();
  resetSelectionTextures();
  initTextures();
  initSelectionTextures();
}

Fixed version (ground truth):
@Override public void init(GL gl){
  renderStyle=new ScatterPlotRenderStyle(this,viewFrustum);
  super.renderStyle=renderStyle;
  InitAxisComboEvent initAxisComboEvent=new InitAxisComboEvent();
  initAxisComboEvent.setSender(this);
  initAxisComboEvent.setAxisNames(this.getAxisString());
  GeneralManager.get().getEventPublisher().triggerEvent(initAxisComboEvent);
  detailLevel=EDetailLevel.HIGH;
  if (MAX_AXES > storageVA.size())   MAX_AXES=storageVA.size();
  renderStyle.setTextureNr(100,100);
  resetFullTextures();
  resetSelectionTextures();
  initTextures();
  initSelectionTextures();
  opengl=gl;
}
Program: 58485
Project: 58485
Buggy source:
private void RenderSelection(GL gl){
  for (  SelectionType tmpSelectionType : AlSelectionTypes) {
    if (elementSelectionManager.getNumberOfElements(tmpSelectionType) == 0)     continue;
    float XScale=renderStyle.getRenderWidth() - XYAXISDISTANCE * 2.0f;
    float YScale=renderStyle.getRenderHeight() - XYAXISDISTANCE * 2.0f;
    Set<Integer> selectionSet=elementSelectionManager.getElements(tmpSelectionType);
    float x=0.0f;
    float y=0.0f;
    float z=1.0f;
    float[] fArMappingColor=tmpSelectionType.getColor();
    for (    int iContentIndex : selectionSet) {
      float xnormalized=set.get(SELECTED_X_AXIS).getFloat(EDataRepresentation.NORMALIZED,iContentIndex);
      float ynormalized=set.get(SELECTED_Y_AXIS).getFloat(EDataRepresentation.NORMALIZED,iContentIndex);
      x=transformOnZoom(xnormalized) * XScale;
      y=ynormalized * YScale;
      DrawPointPrimitive(gl,x,y,z,fArMappingColor,1.0f,iContentIndex,1.0f);
    }
  }
}

Fixed version (ground truth):
private void RenderSelection(GL gl){
  for (  SelectionType tmpSelectionType : AlSelectionTypes) {
    if (elementSelectionManager.getNumberOfElements(tmpSelectionType) == 0)     continue;
    float XScale=renderStyle.getRenderWidth() - XYAXISDISTANCE * 2.0f;
    float YScale=renderStyle.getRenderHeight() - XYAXISDISTANCE * 2.0f;
    Set<Integer> selectionSet=elementSelectionManager.getElements(tmpSelectionType);
    float x=0.0f;
    float y=0.0f;
    float z=1.0f;
    float[] fArMappingColor=tmpSelectionType.getColor();
    for (    int iContentIndex : selectionSet) {
      float xnormalized=set.get(storageVA.get(SELECTED_X_AXIS)).getFloat(EDataRepresentation.NORMALIZED,iContentIndex);
      float ynormalized=set.get(storageVA.get(SELECTED_Y_AXIS)).getFloat(EDataRepresentation.NORMALIZED,iContentIndex);
      x=transformOnZoom(xnormalized) * XScale;
      y=ynormalized * YScale;
      DrawPointPrimitive(gl,x,y,z,fArMappingColor,1.0f,iContentIndex,1.0f);
    }
  }
}
Program: 58488
Project: 58488
Buggy source:
private void renderHistogram(GL gl,float x,float y,float width,float height,int selected_Axis){
  float[] fArMappingColor=new float[]{0.0f,0.0f,0.0f};
  DrawRectangularSelection(gl,x,y,0.f,width,height,fArMappingColor);
  String sLabel=set.get(selected_Axis).getLabel();
  float fScaling=renderStyle.getSmallFontScalingFactor() * 0.7f;
  if (isRenderedRemote())   fScaling*=1.5f;
  Rectangle2D bounds=textRenderer.getScaledBounds(gl,sLabel,fScaling,ScatterPlotRenderStyle.MIN_NUMBER_TEXT_SIZE);
  float fRotation=25;
  gl.glPushAttrib(GL.GL_CURRENT_BIT | GL.GL_LINE_BIT);
  x=x + width * 1.2f;
  gl.glTranslatef(x,y,0);
  gl.glRotatef(fRotation,0,0,1);
  textRenderer.begin3DRendering();
  textRenderer.draw3D(gl,sLabel,0,0,ScatterPlotRenderStyle.TEXT_ON_LABEL_Z,fScaling,ScatterPlotRenderStyle.MIN_AXIS_LABEL_TEXT_SIZE);
  textRenderer.end3DRendering();
  gl.glRotatef(-fRotation,0,0,1);
  gl.glTranslatef(-x,-y,0);
  gl.glPopAttrib();
}

Fixed version (ground truth):
private void renderHistogram(GL gl,float x,float y,float width,float height,int selected_Axis){
  float[] fArMappingColor=new float[]{0.0f,0.0f,0.0f};
  DrawRectangularSelection(gl,x,y,0.f,width,height,fArMappingColor);
  String sLabel=set.get(storageVA.get(selected_Axis)).getLabel();
  float fScaling=renderStyle.getSmallFontScalingFactor() * 0.7f;
  if (isRenderedRemote())   fScaling*=1.5f;
  Rectangle2D bounds=textRenderer.getScaledBounds(gl,sLabel,fScaling,ScatterPlotRenderStyle.MIN_NUMBER_TEXT_SIZE);
  float fRotation=25;
  gl.glPushAttrib(GL.GL_CURRENT_BIT | GL.GL_LINE_BIT);
  x=x + width * 1.2f;
  gl.glTranslatef(x,y,0);
  gl.glRotatef(fRotation,0,0,1);
  textRenderer.begin3DRendering();
  textRenderer.draw3D(gl,sLabel,0,0,ScatterPlotRenderStyle.TEXT_ON_LABEL_Z,fScaling,ScatterPlotRenderStyle.MIN_AXIS_LABEL_TEXT_SIZE);
  textRenderer.end3DRendering();
  gl.glRotatef(-fRotation,0,0,1);
  gl.glTranslatef(-x,-y,0);
  gl.glPopAttrib();
}
Program: 58490
Project: 58490
Buggy source:
ArrayList<Integer> calculateLeaveIDs(){
  leaveIDs=new ArrayList<Integer>();
  ArrayList<Node> children=tree.getChildren(node);
  if (children == null) {
    leaveIDs.add(leafID);
    return leaveIDs;
  }
 else {
    for (    Node child : children) {
      leaveIDs.addAll(child.getLeaveIds());
    }
    return leaveIDs;
  }
}

Fixed version (ground truth):
ArrayList<Integer> calculateLeaveIDs(){
  leaveIDs=new ArrayList<Integer>();
  ArrayList<Node> children=tree.getChildren(node);
  if (children == null) {
    leaveIDs.add(leafID);
    return leaveIDs;
  }
 else {
    for (    Node child : children) {
      leaveIDs.addAll(child.calculateLeaveIDs());
    }
    return leaveIDs;
  }
}
Program: 58491
Project: 58491
Buggy source:
public InputSource getInputSource(String sFileName) throws FileNotFoundException {
  InputSource inputSource;
  if (this.getClass().getClassLoader().getResourceAsStream(sFileName) != null) {
    inputSource=new InputSource(loadResourceAsInputStream(sFileName));
  }
 else {
    inputSource=new InputSource(new FileReader(new File(sFileName)));
  }
  return inputSource;
}

Fixed version (ground truth):
public InputSource getInputSource(String sFileName) throws FileNotFoundException {
  InputSource inputSource;
  if (this.getClass().getClassLoader().getResourceAsStream(sFileName) != null) {
    inputSource=new InputSource(loadResourceAsInputStream(sFileName));
  }
 else {
    inputSource=new InputSource(new BufferedInputStream(new FileInputStream(sFileName)));
  }
  return inputSource;
}
Program: 58492
Project: 58492
Buggy source:
@Override public void registerEventListeners(){
  super.registerEventListeners();
  togglePointTypeListener=new TogglePointTypeListener();
  togglePointTypeListener.setHandler(this);
  eventPublisher.addListener(TogglePointTypeEvent.class,togglePointTypeListener);
  resetSelectionListener=new ToggleMatrixViewListener();
  resetSelectionListener.setHandler(this);
  eventPublisher.addListener(SwitchMatrixViewEvent.class,resetSelectionListener);
  setPointSizeListener=new SetPointSizeListener();
  setPointSizeListener.setHandler(this);
  eventPublisher.addListener(SetPointSizeEvent.class,setPointSizeListener);
  xAxisSelectorListener=new XAxisSelectorListener();
  xAxisSelectorListener.setHandler(this);
  eventPublisher.addListener(XAxisSelectorEvent.class,xAxisSelectorListener);
  yAxisSelectorListener=new YAxisSelectorListener();
  yAxisSelectorListener.setHandler(this);
  eventPublisher.addListener(YAxisSelectorEvent.class,yAxisSelectorListener);
}

Fixed version (ground truth):
@Override public void registerEventListeners(){
  super.registerEventListeners();
  togglePointTypeListener=new TogglePointTypeListener();
  togglePointTypeListener.setHandler(this);
  eventPublisher.addListener(TogglePointTypeEvent.class,togglePointTypeListener);
  toggleMatrixViewListener=new ToggleMatrixViewListener();
  toggleMatrixViewListener.setHandler(this);
  eventPublisher.addListener(SwitchMatrixViewEvent.class,toggleMatrixViewListener);
  toggle2AxisModeListener=new Toggle2AxisModeListener();
  toggle2AxisModeListener.setHandler(this);
  eventPublisher.addListener(Toggle2AxisEvent.class,toggle2AxisModeListener);
  toggleColorModeListener=new ToggleColorModeListener();
  toggleColorModeListener.setHandler(this);
  eventPublisher.addListener(ToggleColorModeEvent.class,toggleColorModeListener);
  toggleMatrixZoomListener=new ToggleMatrixZoomListener();
  toggleMatrixZoomListener.setHandler(this);
  eventPublisher.addListener(ToggleMatrixZoomEvent.class,toggleMatrixZoomListener);
  setPointSizeListener=new SetPointSizeListener();
  setPointSizeListener.setHandler(this);
  eventPublisher.addListener(SetPointSizeEvent.class,setPointSizeListener);
  xAxisSelectorListener=new XAxisSelectorListener();
  xAxisSelectorListener.setHandler(this);
  eventPublisher.addListener(XAxisSelectorEvent.class,xAxisSelectorListener);
  yAxisSelectorListener=new YAxisSelectorListener();
  yAxisSelectorListener.setHandler(this);
  eventPublisher.addListener(YAxisSelectorEvent.class,yAxisSelectorListener);
}
Program: 58493
Project: 58493
Buggy source:
@Override public void unregisterEventListeners(){
  super.unregisterEventListeners();
  if (togglePointTypeListener != null) {
    eventPublisher.removeListener(togglePointTypeListener);
    togglePointTypeListener=null;
  }
  if (resetSelectionListener != null) {
    eventPublisher.removeListener(resetSelectionListener);
    resetSelectionListener=null;
  }
  if (setPointSizeListener != null) {
    eventPublisher.removeListener(setPointSizeListener);
    setPointSizeListener=null;
  }
  if (xAxisSelectorListener != null) {
    eventPublisher.removeListener(xAxisSelectorListener);
    xAxisSelectorListener=null;
  }
  if (yAxisSelectorListener != null) {
    eventPublisher.removeListener(yAxisSelectorListener);
    yAxisSelectorListener=null;
  }
}

Fixed version (ground truth):
@Override public void unregisterEventListeners(){
  super.unregisterEventListeners();
  if (togglePointTypeListener != null) {
    eventPublisher.removeListener(togglePointTypeListener);
    togglePointTypeListener=null;
  }
  if (toggleMatrixViewListener != null) {
    eventPublisher.removeListener(toggleMatrixViewListener);
    toggleMatrixViewListener=null;
  }
  if (toggleMatrixZoomListener != null) {
    eventPublisher.removeListener(toggleMatrixZoomListener);
    toggleMatrixZoomListener=null;
  }
  if (toggle2AxisModeListener != null) {
    eventPublisher.removeListener(toggle2AxisModeListener);
    toggle2AxisModeListener=null;
  }
  if (toggleColorModeListener != null) {
    eventPublisher.removeListener(toggleColorModeListener);
    toggleColorModeListener=null;
  }
  if (setPointSizeListener != null) {
    eventPublisher.removeListener(setPointSizeListener);
    setPointSizeListener=null;
  }
  if (xAxisSelectorListener != null) {
    eventPublisher.removeListener(xAxisSelectorListener);
    xAxisSelectorListener=null;
  }
  if (yAxisSelectorListener != null) {
    eventPublisher.removeListener(yAxisSelectorListener);
    yAxisSelectorListener=null;
  }
}
Program: 58494
Project: 58494
Buggy source:
@Override public void handleEvent(AEvent event){
  if (event instanceof ToggleColorModeEvent) {
    handler.toggleSpecialAxisMode();
  }
}

Fixed version (ground truth):
@Override public void handleEvent(AEvent event){
  if (event instanceof Toggle2AxisEvent) {
    handler.toggleSpecialAxisMode();
  }
}
Program: 58495
Project: 58495
Buggy source:
@Override public void handleEvent(AEvent event){
  if (event instanceof ToggleColorModeEvent) {
    handler.toggleMatrixZoom();
  }
}

Fixed version (ground truth):
@Override public void handleEvent(AEvent event){
  if (event instanceof ToggleMatrixZoomEvent) {
    handler.toggleMatrixZoom();
  }
}
Program: 58496
Project: 58496
Buggy source:
/** 
 * Recursive function which determines the number of elements in each node of the tree.
 * @param tree
 * @param node current node
 * @return number of elements in the current node
 */
private static int determineNrElementsRec(Tree<ClusterNode> tree,ClusterNode node){
  if (tree.hasChildren(node)) {
    int temp=0;
    for (    ClusterNode current : tree.getChildren(node)) {
      temp+=determineNrElementsRec(tree,current);
    }
    node.setNrElements(temp);
  }
  return node.getNrElements();
}

Fixed version (ground truth):
/** 
 * Recursive function which determines the number of elements in each node of the tree.
 * @param tree
 * @param node current node
 * @return number of elements in the current node
 */
private static int determineNrElementsRec(Tree<ClusterNode> tree,ClusterNode node){
  if (tree.hasChildren(node)) {
    int temp=0;
    for (    ClusterNode current : tree.getChildren(node)) {
      temp+=determineNrElementsRec(tree,current);
    }
    node.setNrElements(temp);
  }
 else {
    node.setNrElements(1);
  }
  return node.getNrElements();
}
Program: 58500
Project: 58500
Buggy source:
@Override public void registerEventListeners(){
  super.registerEventListeners();
  togglePointTypeListener=new TogglePointTypeListener();
  togglePointTypeListener.setHandler(this);
  eventPublisher.addListener(TogglePointTypeEvent.class,togglePointTypeListener);
  resetSelectionListener=new ResetSelectionListener();
  resetSelectionListener.setHandler(this);
  eventPublisher.addListener(ResetScatterSelectionEvent.class,resetSelectionListener);
  setPointSizeListener=new SetPointSizeListener();
  setPointSizeListener.setHandler(this);
  eventPublisher.addListener(SetPointSizeEvent.class,setPointSizeListener);
  xAxisSelectorListener=new XAxisSelectorListener();
  xAxisSelectorListener.setHandler(this);
  eventPublisher.addListener(XAxisSelectorEvent.class,xAxisSelectorListener);
  yAxisSelectorListener=new YAxisSelectorListener();
  yAxisSelectorListener.setHandler(this);
  eventPublisher.addListener(YAxisSelectorEvent.class,yAxisSelectorListener);
}

Fixed version (ground truth):
@Override public void registerEventListeners(){
  super.registerEventListeners();
  togglePointTypeListener=new TogglePointTypeListener();
  togglePointTypeListener.setHandler(this);
  eventPublisher.addListener(TogglePointTypeEvent.class,togglePointTypeListener);
  resetSelectionListener=new ToggleMatrixViewListener();
  resetSelectionListener.setHandler(this);
  eventPublisher.addListener(SwitchMatrixViewEvent.class,resetSelectionListener);
  setPointSizeListener=new SetPointSizeListener();
  setPointSizeListener.setHandler(this);
  eventPublisher.addListener(SetPointSizeEvent.class,setPointSizeListener);
  xAxisSelectorListener=new XAxisSelectorListener();
  xAxisSelectorListener.setHandler(this);
  eventPublisher.addListener(XAxisSelectorEvent.class,xAxisSelectorListener);
  yAxisSelectorListener=new YAxisSelectorListener();
  yAxisSelectorListener.setHandler(this);
  eventPublisher.addListener(YAxisSelectorEvent.class,yAxisSelectorListener);
}
Program: 58502
Project: 58502
Buggy source:
@Override public void reshape(GLAutoDrawable drawable,int x,int y,int width,int height){
  if (glRemoteRenderingView != null || this.getViewType().equals("String_Node_Str") || this.getViewType().equals("String_Node_Str") || this.getViewType().equals("String_Node_Str")) {
    viewFrustum.considerAspectRatio(true);
  }
 else {
    Rectangle frame=parentGLCanvas.getBounds();
    viewFrustum.setLeft(0);
    viewFrustum.setBottom(0);
    float value=(float)frame.height / (float)frame.width * 8.0f;
    if (this.getViewType().equals("String_Node_Str"))     viewFrustum.setTop(5.51f);
 else     viewFrustum.setTop(value);
    viewFrustum.setRight(8);
    bIsDisplayListDirtyLocal=true;
    bIsDisplayListDirtyRemote=true;
    bHasFrustumChanged=true;
  }
  GL gl=drawable.getGL();
  fAspectRatio=(float)height / (float)width;
  gl.glViewport(x,y,width,height);
  gl.glMatrixMode(GL.GL_PROJECTION);
  gl.glLoadIdentity();
  viewFrustum.setProjectionMatrix(gl,fAspectRatio);
}

Fixed version (ground truth):
@Override public void reshape(GLAutoDrawable drawable,int x,int y,int width,int height){
  if (glRemoteRenderingView != null || this.getViewType().equals("String_Node_Str") || this.getViewType().equals("String_Node_Str") || this.getViewType().equals("String_Node_Str")) {
    viewFrustum.considerAspectRatio(true);
  }
 else {
    Rectangle frame=parentGLCanvas.getBounds();
    viewFrustum.setLeft(0);
    viewFrustum.setBottom(0);
    float value=(float)frame.height / (float)frame.width * 8.0f;
    viewFrustum.setTop(value);
    viewFrustum.setRight(8);
    bIsDisplayListDirtyLocal=true;
    bIsDisplayListDirtyRemote=true;
    bHasFrustumChanged=true;
  }
  GL gl=drawable.getGL();
  fAspectRatio=(float)height / (float)width;
  gl.glViewport(x,y,width,height);
  gl.glMatrixMode(GL.GL_PROJECTION);
  gl.glLoadIdentity();
  viewFrustum.setProjectionMatrix(gl,fAspectRatio);
}
Program: 58505
Project: 58505
Buggy source:
private void renderHistogram(GL gl,float x,float y,float lenght,float height,int selected_Axis){
  float[] fArMappingColor=new float[]{0.0f,0.0f,0.0f};
  DrawRectangularSelection(gl,x,y,0.f,lenght,height,fArMappingColor);
  String sLabel=set.get(selected_Axis).getLabel();
  float fScaling=renderStyle.getSmallFontScalingFactor() * 0.7f;
  if (isRenderedRemote())   fScaling*=1.5f;
  Rectangle2D bounds=textRenderer.getScaledBounds(gl,sLabel,fScaling,ScatterPlotRenderStyle.MIN_NUMBER_TEXT_SIZE);
  gl.glPushAttrib(GL.GL_CURRENT_BIT | GL.GL_LINE_BIT);
  textRenderer.begin3DRendering();
  textRenderer.draw3D(gl,sLabel,x,y + (1 * height / 3),ScatterPlotRenderStyle.TEXT_ON_LABEL_Z,fScaling,ScatterPlotRenderStyle.MIN_AXIS_LABEL_TEXT_SIZE);
  textRenderer.draw3D(gl,"String_Node_Str",x,y + (2 * height / 3),ScatterPlotRenderStyle.TEXT_ON_LABEL_Z,fScaling,ScatterPlotRenderStyle.MIN_AXIS_LABEL_TEXT_SIZE);
  textRenderer.end3DRendering();
  gl.glPopAttrib();
}

Fixed version (ground truth):
private void renderHistogram(GL gl,float x,float y,float width,float height,int selected_Axis){
  float[] fArMappingColor=new float[]{0.0f,0.0f,0.0f};
  DrawRectangularSelection(gl,x,y,0.f,width,height,fArMappingColor);
  String sLabel=set.get(selected_Axis).getLabel();
  float fScaling=renderStyle.getSmallFontScalingFactor() * 0.7f;
  if (isRenderedRemote())   fScaling*=1.5f;
  Rectangle2D bounds=textRenderer.getScaledBounds(gl,sLabel,fScaling,ScatterPlotRenderStyle.MIN_NUMBER_TEXT_SIZE);
  float fRotation=45;
  gl.glPushAttrib(GL.GL_CURRENT_BIT | GL.GL_LINE_BIT);
  gl.glTranslatef(x,y,0);
  gl.glRotatef(fRotation,0,0,1);
  textRenderer.begin3DRendering();
  textRenderer.draw3D(gl,sLabel,0 + width,0 + (1 * height / 3),ScatterPlotRenderStyle.TEXT_ON_LABEL_Z,fScaling,ScatterPlotRenderStyle.MIN_AXIS_LABEL_TEXT_SIZE);
  textRenderer.end3DRendering();
  gl.glRotatef(-fRotation,0,0,1);
  gl.glTranslatef(-x,-y,0);
  gl.glPopAttrib();
}
Program: 58507
Project: 58507
Buggy source:
private void renderHistogram(GL gl,float x,float y,float width,float height,int selected_Axis){
  float[] fArMappingColor=new float[]{0.0f,0.0f,0.0f};
  DrawRectangularSelection(gl,x,y,0.f,width,height,fArMappingColor);
  String sLabel=set.get(selected_Axis).getLabel();
  float fScaling=renderStyle.getSmallFontScalingFactor() * 0.7f;
  if (isRenderedRemote())   fScaling*=1.5f;
  Rectangle2D bounds=textRenderer.getScaledBounds(gl,sLabel,fScaling,ScatterPlotRenderStyle.MIN_NUMBER_TEXT_SIZE);
  float fRotation=45;
  gl.glPushAttrib(GL.GL_CURRENT_BIT | GL.GL_LINE_BIT);
  gl.glTranslatef(x,y,0);
  gl.glRotatef(fRotation,0,0,1);
  textRenderer.begin3DRendering();
  textRenderer.draw3D(gl,sLabel,0 + width,0 + (1 * height / 3),ScatterPlotRenderStyle.TEXT_ON_LABEL_Z,fScaling,ScatterPlotRenderStyle.MIN_AXIS_LABEL_TEXT_SIZE);
  textRenderer.end3DRendering();
  gl.glRotatef(-fRotation,0,0,1);
  gl.glTranslatef(-x,-y,0);
  gl.glPopAttrib();
}

Fixed version (ground truth):
private void renderHistogram(GL gl,float x,float y,float width,float height,int selected_Axis){
  float[] fArMappingColor=new float[]{0.0f,0.0f,0.0f};
  DrawRectangularSelection(gl,x,y,0.f,width,height,fArMappingColor);
  String sLabel=set.get(selected_Axis).getLabel();
  float fScaling=renderStyle.getSmallFontScalingFactor() * 0.7f;
  if (isRenderedRemote())   fScaling*=1.5f;
  Rectangle2D bounds=textRenderer.getScaledBounds(gl,sLabel,fScaling,ScatterPlotRenderStyle.MIN_NUMBER_TEXT_SIZE);
  float fRotation=25;
  gl.glPushAttrib(GL.GL_CURRENT_BIT | GL.GL_LINE_BIT);
  x=x + width * 1.2f;
  gl.glTranslatef(x,y,0);
  gl.glRotatef(fRotation,0,0,1);
  textRenderer.begin3DRendering();
  textRenderer.draw3D(gl,sLabel,0,0,ScatterPlotRenderStyle.TEXT_ON_LABEL_Z,fScaling,ScatterPlotRenderStyle.MIN_AXIS_LABEL_TEXT_SIZE);
  textRenderer.end3DRendering();
  gl.glRotatef(-fRotation,0,0,1);
  gl.glTranslatef(-x,-y,0);
  gl.glPopAttrib();
}
Program: 58508
Project: 58508
Buggy source:
@Override public int getNumberOfSelections(ESelectionType eSelectionType){
  return 0;
}

Fixed version (ground truth):
@Override public int getNumberOfSelections(SelectionType SelectionType){
  return 0;
}
Program: 58517
Project: 58517
Buggy source:
private void buildDisplayList(final GL gl,int iGLDisplayListIndex){
  if (bHasFrustumChanged) {
    bHasFrustumChanged=false;
    bUpdateMainView=true;
  }
  if ((bUpdateMainView || bUpdateSelection)) {
    if (bRenderMainView)     buildDisplayListSelection(gl,iGLDisplayListIndexSelection);
    if (bUpdateSelection)     initTextures(true);
    bUpdateSelection=false;
  }
  if (bUpdateMainView && bRenderMainView) {
    if (detailLevel == EDetailLevel.HIGH) {
      gl.glNewList(iGLDisplayListIndexCoord,GL.GL_COMPILE);
      renderCoordinateSystem(gl);
      gl.glEndList();
    }
    gl.glNewList(iGLDisplayListIndex,GL.GL_COMPILE);
    gl.glTranslatef(XYAXISDISTANCE,XYAXISDISTANCE,0);
    RenderScatterPoints(gl);
    gl.glTranslatef(-XYAXISDISTANCE,-XYAXISDISTANCE,0);
    gl.glEndList();
    bUpdateMainView=false;
  }
  gl.glNewList(iGLDisplayListIndexMouseOver,GL.GL_COMPILE);
  gl.glTranslatef(XYAXISDISTANCE,XYAXISDISTANCE,0);
  RenderMouseOver(gl);
  gl.glTranslatef(-XYAXISDISTANCE,-XYAXISDISTANCE,0);
  gl.glEndList();
}

Fixed version (ground truth):
private void buildDisplayList(final GL gl,int iGLDisplayListIndex){
  if (bHasFrustumChanged) {
    bHasFrustumChanged=false;
    bUpdateMainView=true;
  }
  if ((bUpdateMainView || bUpdateSelection)) {
    if (bRenderMainView)     buildDisplayListSelection(gl,iGLDisplayListIndexSelection);
    if (bUpdateSelection)     initTextures(true);
    bUpdateSelection=false;
  }
  if (bUpdateFullTexures) {
    bUpdateFullTexures=false;
    initTextures(false);
  }
  if (bUpdateMainView && bRenderMainView) {
    if (detailLevel == EDetailLevel.HIGH) {
      gl.glNewList(iGLDisplayListIndexCoord,GL.GL_COMPILE);
      renderCoordinateSystem(gl);
      gl.glEndList();
    }
    gl.glNewList(iGLDisplayListIndex,GL.GL_COMPILE);
    gl.glTranslatef(XYAXISDISTANCE,XYAXISDISTANCE,0);
    RenderScatterPoints(gl);
    gl.glTranslatef(-XYAXISDISTANCE,-XYAXISDISTANCE,0);
    gl.glEndList();
    bUpdateMainView=false;
  }
  gl.glNewList(iGLDisplayListIndexMouseOver,GL.GL_COMPILE);
  gl.glTranslatef(XYAXISDISTANCE,XYAXISDISTANCE,0);
  RenderMouseOver(gl);
  gl.glTranslatef(-XYAXISDISTANCE,-XYAXISDISTANCE,0);
  gl.glEndList();
}
Program: 58518
Project: 58518
Buggy source:
@Override protected void handleKeyPressedEvent(KeyEvent event){
  if (event.character == 'b') {
    glScatterplot.toggleSpecialAxisMode();
    return;
  }
  if (event.character == 'p') {
    glScatterplot.togglePointType();
    return;
  }
  if (event.character == 'd') {
    glScatterplot.toggleDetailLevel();
    return;
  }
  if (event.character == 'm') {
    glScatterplot.toggleMatrixMode();
    return;
  }
switch (event.keyCode) {
case SWT.ARROW_UP:
    glScatterplot.upDownSelect(false);
  break;
case SWT.ARROW_DOWN:
glScatterplot.upDownSelect(true);
break;
case SWT.ARROW_LEFT:
glScatterplot.leftRightSelect(false);
break;
case SWT.ARROW_RIGHT:
glScatterplot.leftRightSelect(true);
break;
case SWT.HOME:
glScatterplot.ResetSelection();
break;
}
}

Fixed version (ground truth):
@Override protected void handleKeyPressedEvent(KeyEvent event){
  if (event.character == 'b') {
    glScatterplot.toggleSpecialAxisMode();
    return;
  }
  if (event.character == 'p') {
    glScatterplot.togglePointType();
    return;
  }
  if (event.character == 'd') {
    glScatterplot.toggleDetailLevel();
    return;
  }
  if (event.character == 'm') {
    glScatterplot.toggleMatrixMode();
    return;
  }
  if (event.character == 'c') {
    glScatterplot.toggleColorMode();
    return;
  }
switch (event.keyCode) {
case SWT.ARROW_UP:
    glScatterplot.upDownSelect(false);
  break;
case SWT.ARROW_DOWN:
glScatterplot.upDownSelect(true);
break;
case SWT.ARROW_LEFT:
glScatterplot.leftRightSelect(false);
break;
case SWT.ARROW_RIGHT:
glScatterplot.leftRightSelect(true);
break;
case SWT.HOME:
glScatterplot.ResetSelection();
break;
}
}
Program: 58519
Project: 58519
Buggy source:
public float getAxisHeight(){
  return viewFrustum.getHeight() - 2 * XYAXISDISTANCE;
}

Fixed version (ground truth):
public float getAxisHeight(){
  return getRenderHeight() - 2 * XYAXISDISTANCE;
}
Program: 58520
Project: 58520
Buggy source:
public ScatterPlotRenderStyle(GLScatterplot scatterPlot,IViewFrustum viewFrustum){
  super(viewFrustum);
  float fDelta=(fSelectedFieldWidth - fNormalFieldWidth) / (iLevels + 1);
  hashLevelToWidth=new HashMap<Integer,Float>();
  hashLevelToWidth.put(iNotSelectedLevel,fNormalFieldWidth);
  float fCurrentWidth=fNormalFieldWidth;
  for (int iCount=-iLevels; iCount <= iLevels; iCount++) {
    if (iCount < 0) {
      fCurrentWidth+=fDelta;
    }
 else     if (iCount == 0) {
      fCurrentWidth=fSelectedFieldWidth;
    }
 else {
      fCurrentWidth-=fDelta;
    }
    hashLevelToWidth.put(iCount,fCurrentWidth);
  }
}

Fixed version (ground truth):
public ScatterPlotRenderStyle(GLScatterplot scatterPlot,IViewFrustum viewFrustum){
  super(viewFrustum);
  fRenderHeight=viewFrustum.getHeight();
  fRenderWith=viewFrustum.getWidth();
}
Program: 58521
Project: 58521
Buggy source:
public float getAxisWidth(){
  return viewFrustum.getWidth() - 2 * XYAXISDISTANCE;
}

Fixed version (ground truth):
public float getAxisWidth(){
  return getRenderWidth() - 2 * XYAXISDISTANCE;
}
Program: 58522
Project: 58522
Buggy source:
public float getLAbelWidth(){
  return viewFrustum.getWidth() / 2;
}

Fixed version (ground truth):
public float getLAbelWidth(){
  return getRenderWidth() / 2;
}
Program: 58523
Project: 58523
Buggy source:
public float getLabelHeight(){
  return viewFrustum.getHeight() / 2;
}

Fixed version (ground truth):
public float getLabelHeight(){
  return getRenderHeight() / 2;
}
Program: 58525
Project: 58525
Buggy source:
public static void writeInputStreamToFile(String fileName,InputStream inputStream){
  try {
    File f=new File(fileName);
    OutputStream out=new FileOutputStream(f);
    byte buf[]=new byte[1024];
    int len;
    while ((len=inputStream.read(buf)) > 0)     out.write(buf,0,len);
    out.close();
    inputStream.close();
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
public static void writeInputStreamToFile(String fileName,BufferedReader bufferedReader){
  try {
    FileWriter fstream=new FileWriter(fileName);
    BufferedWriter out=new BufferedWriter(fstream);
    char buf[]=new char[1024];
    int len;
    while ((len=bufferedReader.read(buf)) > 0)     out.write(buf,0,len);
    out.close();
    bufferedReader.close();
  }
 catch (  IOException e) {
  }
}
Program: 58526
Project: 58526
Buggy source:
private static void triggerPathwayLoading(){
  if (GeneralManager.get().getUseCase(EDataDomain.GENETIC_DATA) != null) {
    new PathwayLoadingProgressIndicatorAction().run(null);
  }
}

Fixed version (ground truth):
private static void triggerPathwayLoading(){
  new PathwayLoadingProgressIndicatorAction().run(null);
}
Program: 58527
Project: 58527
Buggy source:
private boolean IsInSelectionRectangle(float x,float y){
  float XMin=Math.min(fDragStartPoint[0],fDragEndPoint[0]);
  float XMax=Math.max(fDragStartPoint[0],fDragEndPoint[0]);
  float YMin=Math.min(fDragStartPoint[1],fDragEndPoint[1]);
  float YMax=Math.max(fDragStartPoint[1],fDragEndPoint[1]);
  x=x + XYAXISDISTANCE;
  y=y + XYAXISDISTANCE;
  if (x >= XMin && x <= XMax)   if (y >= YMin && y <= YMax)   return true;
  return false;
}

Fixed version (ground truth):
private boolean IsInSelectionRectangle(float x,float y){
  float XMin=Math.min(fRectangleDragStartPoint[0],fRectangleDragEndPoint[0]);
  float XMax=Math.max(fRectangleDragStartPoint[0],fRectangleDragEndPoint[0]);
  float YMin=Math.min(fRectangleDragStartPoint[1],fRectangleDragEndPoint[1]);
  float YMax=Math.max(fRectangleDragStartPoint[1],fRectangleDragEndPoint[1]);
  x=x + XYAXISDISTANCE;
  y=y + XYAXISDISTANCE;
  if (x >= XMin && x <= XMax)   if (y >= YMin && y <= YMax)   return true;
  return false;
}
Program: 58528
Project: 58528
Buggy source:
public void ResetSelection(){
  elementSelectionManager.clearSelections();
  fDragStartPoint=new float[3];
  fDragEndPoint=new float[3];
  bUpdateAll=true;
  setDisplayListDirty();
}

Fixed version (ground truth):
public void ResetSelection(){
  elementSelectionManager.clearSelections();
  fRectangleDragStartPoint=new float[3];
  fRectangleDragEndPoint=new float[3];
  bUpdateAll=true;
  setDisplayListDirty();
}
Program: 58529
Project: 58529
Buggy source:
@Override public String getDetailedInfo(){
  StringBuffer sInfoText=new StringBuffer();
  sInfoText.append("String_Node_Str");
  if (bRenderStorageHorizontally) {
    sInfoText.append(contentVA.size() + "String_Node_Str" + useCase.getContentLabel(false,true)+ "String_Node_Str"+ storageVA.size()+ "String_Node_Str");
  }
 else {
    sInfoText.append(contentVA.size() + "String_Node_Str" + useCase.getContentLabel(true,true)+ "String_Node_Str"+ storageVA.size()+ "String_Node_Str");
  }
  if (bRenderOnlyContext) {
    sInfoText.append("String_Node_Str" + "String_Node_Str" + useCase.getContentLabel(false,true) + "String_Node_Str");
  }
 else {
    if (bUseRandomSampling) {
      sInfoText.append("String_Node_Str" + iNumberOfRandomElements + "String_Node_Str");
    }
 else {
      sInfoText.append("String_Node_Str");
    }
    if (dataFilterLevel == EDataFilterLevel.COMPLETE) {
      sInfoText.append("String_Node_Str");
    }
 else     if (dataFilterLevel == EDataFilterLevel.ONLY_MAPPING) {
      sInfoText.append("String_Node_Str");
    }
 else     if (dataFilterLevel == EDataFilterLevel.ONLY_CONTEXT) {
      sInfoText.append("String_Node_Str");
    }
  }
  return sInfoText.toString();
}

Fixed version (ground truth):
@Override public String getDetailedInfo(){
  StringBuffer sInfoText=new StringBuffer();
  sInfoText.append("String_Node_Str");
  if (bRenderStorageHorizontally) {
    sInfoText.append(contentVA.size() + "String_Node_Str" + useCase.getContentLabel(false,true)+ "String_Node_Str"+ storageVA.size()+ "String_Node_Str");
  }
 else {
    sInfoText.append(contentVA.size() + "String_Node_Str" + useCase.getContentLabel(true,true)+ "String_Node_Str"+ storageVA.size()+ "String_Node_Str");
  }
  if (bRenderOnlyContext) {
    sInfoText.append("String_Node_Str" + "String_Node_Str" + useCase.getContentLabel(false,true) + "String_Node_Str");
  }
 else {
    if (bUseRandomSampling) {
      sInfoText.append("String_Node_Str" + iNumberOfRandomElements + "String_Node_Str");
    }
 else {
      sInfoText.append("String_Node_Str");
    }
    if (dataFilterLevel == EDataFilterLevel.COMPLETE) {
      sInfoText.append("String_Node_Str");
    }
 else     if (dataFilterLevel == EDataFilterLevel.ONLY_MAPPING) {
      sInfoText.append("String_Node_Str");
    }
 else     if (dataFilterLevel == EDataFilterLevel.ONLY_CONTEXT) {
      sInfoText.append("String_Node_Str");
    }
  }
  return "String_Node_Str";
}
Program: 58532
Project: 58532
Buggy source:
private void DrawRectangularSelection(GL gl){
  float length=fDragEndPoint[0] - fDragStartPoint[0];
  float hight=fDragEndPoint[1] - fDragStartPoint[1];
  float x=fDragStartPoint[0];
  float y=fDragStartPoint[1];
  float z=3.5f;
  gl.glColor3f(0.0f,1.0f,0.0f);
  gl.glLineWidth(2.0f);
  gl.glBegin(GL.GL_LINE_LOOP);
  gl.glVertex3f(x,y,z);
  gl.glVertex3f(x,y + hight,z);
  gl.glVertex3f(x + length,y + hight,z);
  gl.glVertex3f(x + length,y,z);
  gl.glEnd();
}

Fixed version (ground truth):
private void DrawRectangularSelection(GL gl){
  float length=fRectangleDragEndPoint[0] - fRectangleDragStartPoint[0];
  float hight=fRectangleDragEndPoint[1] - fRectangleDragStartPoint[1];
  float x=fRectangleDragStartPoint[0];
  float y=fRectangleDragStartPoint[1];
  float z=3.5f;
  gl.glColor3f(0.0f,1.0f,0.0f);
  gl.glLineWidth(2.0f);
  gl.glBegin(GL.GL_LINE_LOOP);
  gl.glVertex3f(x,y,z);
  gl.glVertex3f(x,y + hight,z);
  gl.glVertex3f(x + length,y + hight,z);
  gl.glVertex3f(x + length,y,z);
  gl.glEnd();
}