nus-yam/ex-repair huggingface dataset:
Program: 58314
Project: 58314
Buggy source:
public boolean setEyeTrackerAction(int[] mouseCoord,float[] offset,float[] scalation){
  if (this.displayFullView) {
    return false;
  }
  float[] mousePoint=new float[2];
  mousePoint[0]=(float)mouseCoord[0];
  mousePoint[1]=(float)mouseCoord[1];
  boolean returnValue;
  float factorX=1 / (float)(this.getParentGLCanvas().getWidth() * scalation[0]);
  float factorY=1 / (float)(this.getParentGLCanvas().getHeight());
  if (mousePoint != null && offset != null) {
    mousePoint[0]=(mousePoint[0] * factorX - offset[0]) * 2 - 1;
    mousePoint[1]=((this.getParentGLCanvas().getHeight() - mousePoint[1]) * factorY - offset[1]) * 2 - 1;
  }
  PoincareNode selectedNode=disk.processEyeTrackerAction(mousePoint.clone(),arSlerpActions);
  if (selectedNode == disk.getCenteredNode()) {
    return true;
  }
  if (selectedNode != null) {
    disk.setCenteredNode(selectedNode);
    slerpedNode=selectedNode;
    returnValue=true;
  }
 else {
    returnValue=false;
  }
  correctDiskAngle();
  return returnValue;
}

Fixed version (ground truth):
public boolean setEyeTrackerAction(int[] mouseCoord,float[] offset,float[] scalation,boolean eyeControlled){
  if (this.displayFullView) {
    return false;
  }
  float[] mousePoint=new float[2];
  mousePoint[0]=(float)mouseCoord[0];
  mousePoint[1]=(float)mouseCoord[1];
  boolean returnValue;
  float factorX=1 / (float)(this.getParentGLCanvas().getWidth() * scalation[0]);
  float factorY=1 / (float)(this.getParentGLCanvas().getHeight());
  if (mousePoint != null && offset != null) {
    mousePoint[0]=(mousePoint[0] * factorX - offset[0]) * 2 - 1;
    mousePoint[1]=((this.getParentGLCanvas().getHeight() - mousePoint[1]) * factorY - offset[1]) * 2 - 1;
  }
  PoincareNode selectedNode=disk.processEyeTrackerAction(mousePoint.clone(),arSlerpActions,eyeControlled);
  if (selectedNode == disk.getCenteredNode()) {
    return true;
  }
  if (selectedNode != null) {
    disk.setCenteredNode(selectedNode);
    slerpedNode=selectedNode;
    returnValue=true;
  }
 else {
    returnValue=false;
  }
  correctDiskAngle();
  return returnValue;
}
Program: 58315
Project: 58315
Buggy source:
public PoincareDisk(){
  radius=1f;
  nodeSize=0.1f;
  lineWidth=2;
  absolutePosition=new float[2];
}

Fixed version (ground truth):
public PoincareDisk(){
  radius=1f;
  nodeSize=0.1f;
  lineWidth=2;
  absolutePosition=new float[2];
  eyeTrackableNodes=new ArrayList<PoincareNode>();
}
Program: 58316
Project: 58316
Buggy source:
public void insertNode(PoincareNode node,PoincareNode parentNode){
  float[] actualPosition=new float[2];
  actualPosition[0]=node.getPosition()[0] * -1;
  actualPosition[1]=node.getPosition()[1] * -1;
  this.getTree().addChild(parentNode,node);
  this.moebiusLayoutTree(2);
  this.translateTreeMoebius(actualPosition);
}

Fixed version (ground truth):
public void insertNode(PoincareNode node,PoincareNode parentNode){
  float[] actualPosition=new float[2];
  this.getTree().addChild(parentNode,node);
  this.moebiusLayoutTree(2);
  actualPosition[0]=node.getPosition()[0] * -1;
  actualPosition[1]=node.getPosition()[1] * -1;
  this.translateTreeMoebius(actualPosition);
}
Program: 58319
Project: 58319
Buggy source:
/** 
 * /** Constructor.
 * @param glCanvas
 * @param sLabel
 * @param viewFrustum
 */
public GLDataWindows(GLCaleydoCanvas glCanvas,final String sLabel,final IViewFrustum viewFrustum){
  super(glCanvas,sLabel,viewFrustum,true);
  canvas=glCanvas;
  viewType=GLDataWindows.VIEW_ID;
  containedGLViews=new ArrayList<AGLView>();
  newViews=new ArrayList<ASerializedView>();
  defaultLayoutHotSpot=new float[2];
  layoutHotSpot=new float[2];
  selectedInput=inputType.EYETRACKER_SIMULATED;
  viewport=new int[4];
  pixelDimensions=new int[2];
  eyeTracker=new eyeTracking(true,"String_Node_Str");
  if (selectedInput == inputType.EYETRACKER_ONLY) {
    eyeTracker.startTracking();
  }
  viewSlerpStartPoint=new float[2];
  viewSlerpTargetPoint=new float[2];
  simpleSlerpActions=new ArrayList<SimpleSlerp>();
  zoomPointHyperbolic=new float[2];
  zoomPointHyperbolic[0]=1.5f;
  zoomPointHyperbolic[1]=1;
  zoomPointHeatmap=new float[2];
  zoomPointHeatmap[0]=0.5f;
  zoomPointHeatmap[1]=0.5f;
  zoomPointParCoord=new float[2];
  zoomPointParCoord[0]=0.5f;
  zoomPointParCoord[1]=1.5f;
  CmdDataCreateDataDomain cmd=new CmdDataCreateDataDomain(ECommandType.CREATE_DATA_DOMAIN);
  cmd.setAttributes("String_Node_Str");
  cmd.doCommand();
  getParentGLCanvas().getParentComposite().getDisplay().asyncExec(new Runnable(){
    @Override public void run(){
      upperLeftScreenPos=getParentGLCanvas().getParentComposite().toDisplay(1,1);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * /** Constructor.
 * @param glCanvas
 * @param sLabel
 * @param viewFrustum
 */
public GLDataWindows(GLCaleydoCanvas glCanvas,final String sLabel,final IViewFrustum viewFrustum){
  super(glCanvas,sLabel,viewFrustum,true);
  canvas=glCanvas;
  viewType=GLDataWindows.VIEW_ID;
  containedGLViews=new ArrayList<AGLView>();
  newViews=new ArrayList<ASerializedView>();
  defaultLayoutHotSpot=new float[2];
  layoutHotSpot=new float[2];
  selectedInput=inputType.MOUSE_ONLY;
  viewport=new int[4];
  pixelDimensions=new int[2];
  eyeTracker=new eyeTracking(true,"String_Node_Str");
  if (selectedInput == inputType.EYETRACKER_ONLY) {
    eyeTracker.startTracking();
  }
  viewSlerpStartPoint=new float[2];
  viewSlerpTargetPoint=new float[2];
  simpleSlerpActions=new ArrayList<SimpleSlerp>();
  zoomPointHyperbolic=new float[2];
  zoomPointHyperbolic[0]=1.5f;
  zoomPointHyperbolic[1]=1;
  zoomPointHeatmap=new float[2];
  zoomPointHeatmap[0]=0.5f;
  zoomPointHeatmap[1]=0.5f;
  zoomPointParCoord=new float[2];
  zoomPointParCoord[0]=0.5f;
  zoomPointParCoord[1]=1.5f;
  CmdDataCreateDataDomain cmd=new CmdDataCreateDataDomain(ECommandType.CREATE_DATA_DOMAIN);
  cmd.setAttributes("String_Node_Str");
  cmd.doCommand();
  getParentGLCanvas().getParentComposite().getDisplay().asyncExec(new Runnable(){
    @Override public void run(){
      upperLeftScreenPos=getParentGLCanvas().getParentComposite().toDisplay(1,1);
    }
  }
);
}
Program: 58320
Project: 58320
Buggy source:
public void drawRemoteView(GL gl,PoincareNode node,float[] position,float size){
  Transform transform=new Transform();
  remoteNodeElement.setGLView(((ViewHyperbolicNode)node).getGlView());
  if (this.displayFullView == true && (this.disk.getCenteredNode() == node)) {
    transform.setScale(new Vec3f(1,1,1));
    transform.setTranslation(new Vec3f(0,0,2));
  }
 else {
    transform.setScale(new Vec3f(size,size * fAspectRatio,1));
    transform.setTranslation(new Vec3f(position[0],position[1],0));
  }
  remoteNodeElement.setTransform(transform);
  renderRemoteLevelElement(gl,remoteNodeElement);
}

Fixed version (ground truth):
public void drawRemoteView(GL gl,PoincareNode node,float[] position,float size){
  Transform transform=new Transform();
  remoteNodeElement.setGLView(((ViewHyperbolicNode)node).getGlView());
  if (this.displayFullView == true && (this.disk.getCenteredNode() == node)) {
    transform.setScale(new Vec3f(1,1,1));
    transform.setTranslation(new Vec3f(0,0,0.1f));
  }
 else {
    transform.setScale(new Vec3f(size,size * fAspectRatio,1));
    transform.setTranslation(new Vec3f(position[0],position[1],0));
  }
  remoteNodeElement.setTransform(transform);
  renderRemoteLevelElement(gl,remoteNodeElement);
}
Program: 58322
Project: 58322
Buggy source:
@Override public void init(GL gl){
  compareViewStateController=new CompareViewStateController(this,iUniqueID,textRenderer,textureManager,pickingManager,glMouseListener,contextMenu,dataDomain);
  compareViewStateController.init(gl);
}

Fixed version (ground truth):
@Override public void init(GL gl){
  compareViewStateController=new CompareViewStateController(this,iUniqueID,textRenderer,textureManager,pickingManager,glMouseListener,contextMenu,dataDomain);
  compareViewStateController.init(gl);
  parentGLCanvas.getParentComposite().getDisplay().asyncExec(new Runnable(){
    public void run(){
      KeyListener listener=new org.eclipse.swt.events.KeyAdapter(){
        @Override public void keyPressed(        KeyEvent e){
          if (e.keyCode == SWT.CTRL) {
            eventPublisher.triggerEvent(new ClearSelectionsEvent());
          }
        }
      }
;
      parentGLCanvas.getParentComposite().addKeyListener(listener);
    }
  }
);
}
Program: 58323
Project: 58323
Buggy source:
@Override public void replaceContentVA(int setID,EIDCategory idCategory,ContentVAType vaType){
  clusteredSets.add(setID);
  boolean allSetsClustered=true;
  for (  ISet set : setsToCompare) {
    if (!clusteredSets.contains(set.getID())) {
      allSetsClustered=false;
      break;
    }
  }
  if (!allSetsClustered)   return;
  compareViewStateController.setSetsToCompare(setsToCompare);
  compareViewStateController.handleReplaceContentVA(setID,idCategory,vaType);
  clusteredSets.clear();
}

Fixed version (ground truth):
@Override public void replaceContentVA(int setID,EIDCategory idCategory,ContentVAType vaType){
  clusteredSets.add(setID);
  boolean allSetsClustered=true;
  for (  ISet set : setsToCompare) {
    if (!clusteredSets.contains(set.getID())) {
      allSetsClustered=false;
      break;
    }
  }
  compareViewStateController.setSetsToCompare(setsToCompare);
  compareViewStateController.handleReplaceContentVA(setID,idCategory,vaType);
  clusteredSets.clear();
}
Program: 58324
Project: 58324
Buggy source:
public void handleContentGroupListUpdate(ContentGroupList contentGroupList){
  selectedGroups.clear();
  contentVA.setGroupList(contentGroupList);
  contentGroupList.updateGroupInfo();
  for (int i=0; i <= 10 && i < contentGroupList.size(); i++) {
    Group group=contentGroupList.get(i);
    group.setSelectionType(SelectionType.SELECTION);
    selectedGroups.put(group,null);
  }
  setHeatMapsInactive();
  clearDeselected();
  overview.updateHeatMapTextures(contentSelectionManager);
  isInitialized=false;
  isNewSelection=true;
}

Fixed version (ground truth):
public void handleContentGroupListUpdate(ContentGroupList contentGroupList){
  selectedGroups.clear();
  contentVA.setGroupList(contentGroupList);
  contentGroupList.updateGroupInfo();
  setHeatMapsInactive();
  clearDeselected();
  overview.updateHeatMapTextures(contentSelectionManager);
  isInitialized=false;
  isNewSelection=true;
}
Program: 58326
Project: 58326
Buggy source:
/** 
 * /** Constructor.
 * @param glCanvas
 * @param sLabel
 * @param viewFrustum
 */
public GLDataWindows(GLCaleydoCanvas glCanvas,final String sLabel,final IViewFrustum viewFrustum){
  super(glCanvas,sLabel,viewFrustum,true);
  canvas=glCanvas;
  viewType=GLDataWindows.VIEW_ID;
  containedGLViews=new ArrayList<AGLView>();
  newViews=new ArrayList<ASerializedView>();
  defaultLayoutHotSpot=new float[2];
  layoutHotSpot=new float[2];
  selectedInput=inputType.EYETRACKER_SIMULATED;
  viewport=new int[4];
  pixelDimensions=new int[2];
  if (selectedInput == inputType.EYETRACKER_ONLY || selectedInput == inputType.EYETRACKER_SIMULATED) {
    eyeTracker=new eyeTracking(true,"String_Node_Str");
    if (selectedInput == inputType.EYETRACKER_ONLY) {
      eyeTracker.startTracking();
    }
  }
  viewSlerpStartPoint=new float[2];
  viewSlerpTargetPoint=new float[2];
  simpleSlerpActions=new ArrayList<SimpleSlerp>();
  zoomPointHyperbolic=new float[2];
  zoomPointHyperbolic[0]=1.5f;
  zoomPointHyperbolic[1]=1;
  zoomPointHeatmap=new float[2];
  zoomPointHeatmap[0]=0.5f;
  zoomPointHeatmap[1]=0.5f;
  zoomPointParCoord=new float[2];
  zoomPointParCoord[0]=0.5f;
  zoomPointParCoord[1]=1.5f;
  CmdDataCreateDataDomain cmd=new CmdDataCreateDataDomain(ECommandType.CREATE_DATA_DOMAIN);
  cmd.setAttributes("String_Node_Str");
  cmd.doCommand();
  getParentGLCanvas().getParentComposite().getDisplay().asyncExec(new Runnable(){
    @Override public void run(){
      upperLeftScreenPos=getParentGLCanvas().getParentComposite().toDisplay(1,1);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * /** Constructor.
 * @param glCanvas
 * @param sLabel
 * @param viewFrustum
 */
public GLDataWindows(GLCaleydoCanvas glCanvas,final String sLabel,final IViewFrustum viewFrustum){
  super(glCanvas,sLabel,viewFrustum,true);
  canvas=glCanvas;
  viewType=GLDataWindows.VIEW_ID;
  containedGLViews=new ArrayList<AGLView>();
  newViews=new ArrayList<ASerializedView>();
  defaultLayoutHotSpot=new float[2];
  layoutHotSpot=new float[2];
  selectedInput=inputType.EYETRACKER_ONLY;
  viewport=new int[4];
  pixelDimensions=new int[2];
  if (selectedInput == inputType.EYETRACKER_ONLY || selectedInput == inputType.EYETRACKER_SIMULATED) {
    eyeTracker=new eyeTracking(true,"String_Node_Str");
    if (selectedInput == inputType.EYETRACKER_ONLY) {
      eyeTracker.startTracking();
    }
  }
  viewSlerpStartPoint=new float[2];
  viewSlerpTargetPoint=new float[2];
  simpleSlerpActions=new ArrayList<SimpleSlerp>();
  zoomPointHyperbolic=new float[2];
  zoomPointHyperbolic[0]=1.5f;
  zoomPointHyperbolic[1]=1;
  zoomPointHeatmap=new float[2];
  zoomPointHeatmap[0]=0.5f;
  zoomPointHeatmap[1]=0.5f;
  zoomPointParCoord=new float[2];
  zoomPointParCoord[0]=0.5f;
  zoomPointParCoord[1]=1.5f;
  CmdDataCreateDataDomain cmd=new CmdDataCreateDataDomain(ECommandType.CREATE_DATA_DOMAIN);
  cmd.setAttributes("String_Node_Str");
  cmd.doCommand();
  getParentGLCanvas().getParentComposite().getDisplay().asyncExec(new Runnable(){
    @Override public void run(){
      upperLeftScreenPos=getParentGLCanvas().getParentComposite().toDisplay(1,1);
    }
  }
);
}
Program: 58328
Project: 58328
Buggy source:
public void receiveData(){
  receivedEyeData=tracker.getEyeTrackData();
  rawEyeTrackerPosition[0]=(int)receivedEyeData[0];
  rawEyeTrackerPosition[1]=(int)receivedEyeData[1];
  if (this.rawEyeTrackerPosition[0] != 0) {
    System.out.println("String_Node_Str" + rawEyeTrackerPosition[0] + "String_Node_Str"+ rawEyeTrackerPosition[0]);
  }
}

Fixed version (ground truth):
public void receiveData(){
  receivedEyeData=tracker.getEyeTrackData();
  rawEyeTrackerPosition[0]=(int)receivedEyeData[0];
  rawEyeTrackerPosition[1]=(int)receivedEyeData[1];
  if (this.rawEyeTrackerPosition[0] != 0) {
  }
}
Program: 58330
Project: 58330
Buggy source:
public boolean setEyeTrackerAction(int[] mouseCoord,float[] offset,float[] scalation){
  float[] mousePoint=new float[2];
  mousePoint[0]=(float)mouseCoord[0];
  mousePoint[1]=(float)mouseCoord[1];
  boolean returnValue;
  float factorX=1 / (float)(this.getParentGLCanvas().getWidth() * scalation[0]);
  float factorY=1 / (float)(this.getParentGLCanvas().getHeight());
  if (mousePoint != null && offset != null) {
    mousePoint[0]=(mousePoint[0] * factorX - offset[0]) * 2 - 1;
    mousePoint[1]=((this.getParentGLCanvas().getHeight() - mousePoint[1]) * factorY - offset[1]) * 2 - 1;
  }
  PoincareNode selectedNode=disk.processEyeTrackerAction(mousePoint.clone(),arSlerpActions);
  if (selectedNode == disk.getCenteredNode()) {
    return true;
  }
  if (selectedNode != null) {
    disk.setCenteredNode(selectedNode);
    slerpedNode=selectedNode;
    returnValue=true;
  }
 else {
    returnValue=false;
  }
  correctDiskAngle();
  return returnValue;
}

Fixed version (ground truth):
public boolean setEyeTrackerAction(int[] mouseCoord,float[] offset,float[] scalation){
  if (this.displayFullView) {
    return false;
  }
  float[] mousePoint=new float[2];
  mousePoint[0]=(float)mouseCoord[0];
  mousePoint[1]=(float)mouseCoord[1];
  boolean returnValue;
  float factorX=1 / (float)(this.getParentGLCanvas().getWidth() * scalation[0]);
  float factorY=1 / (float)(this.getParentGLCanvas().getHeight());
  if (mousePoint != null && offset != null) {
    mousePoint[0]=(mousePoint[0] * factorX - offset[0]) * 2 - 1;
    mousePoint[1]=((this.getParentGLCanvas().getHeight() - mousePoint[1]) * factorY - offset[1]) * 2 - 1;
  }
  PoincareNode selectedNode=disk.processEyeTrackerAction(mousePoint.clone(),arSlerpActions);
  if (selectedNode == disk.getCenteredNode()) {
    return true;
  }
  if (selectedNode != null) {
    disk.setCenteredNode(selectedNode);
    slerpedNode=selectedNode;
    returnValue=true;
  }
 else {
    returnValue=false;
  }
  correctDiskAngle();
  return returnValue;
}
Program: 58332
Project: 58332
Buggy source:
private void renderRemoteLevelElement(final GL gl,RemoteLevelElement element){
  AGLView glView=element.getGLView();
  if (glView == null) {
    return;
  }
  gl.glPushName(pickingManager.getPickingID(iUniqueID,EPickingType.REMOTE_LEVEL_ELEMENT,element.getID()));
  gl.glPushName(pickingManager.getPickingID(iUniqueID,EPickingType.VIEW_SELECTION,glView.getID()));
  gl.glPushMatrix();
  Transform transform=element.getTransform();
  Vec3f translation=transform.getTranslation();
  Rotf rot=transform.getRotation();
  Vec3f scale=transform.getScale();
  Vec3f axis=new Vec3f();
  float fAngle=rot.get(axis);
  gl.glTranslatef(translation.x(),translation.y(),translation.z());
  gl.glRotatef(Vec3f.convertRadiant2Grad(fAngle),axis.x(),axis.y(),axis.z());
  gl.glTranslatef(translation.x(),translation.y(),translation.z());
  gl.glRotatef(Vec3f.convertRadiant2Grad(fAngle),axis.x(),axis.y(),axis.z());
  gl.glScalef(scale.x(),scale.y(),scale.z());
  glView.displayRemote(gl);
  gl.glPopMatrix();
  gl.glPopName();
  gl.glPopName();
}

Fixed version (ground truth):
private void renderRemoteLevelElement(final GL gl,RemoteLevelElement element){
  AGLView glView=element.getGLView();
  if (glView == null) {
    return;
  }
  gl.glPushName(pickingManager.getPickingID(iUniqueID,EPickingType.REMOTE_LEVEL_ELEMENT,element.getID()));
  gl.glPushName(pickingManager.getPickingID(iUniqueID,EPickingType.VIEW_SELECTION,glView.getID()));
  gl.glPushMatrix();
  Transform transform=element.getTransform();
  Vec3f translation=transform.getTranslation();
  Rotf rot=transform.getRotation();
  Vec3f scale=transform.getScale();
  Vec3f axis=new Vec3f();
  float fAngle=rot.get(axis);
  gl.glTranslatef(translation.x(),translation.y(),translation.z());
  gl.glRotatef(Vec3f.convertRadiant2Grad(fAngle),axis.x(),axis.y(),axis.z());
  gl.glScalef(scale.x(),scale.y(),scale.z());
  glView.displayRemote(gl);
  gl.glPopMatrix();
  gl.glPopName();
  gl.glPopName();
}
Program: 58333
Project: 58333
Buggy source:
public NodeSlerp(float speed,float[] startPoint,float[] targetPoint){
  this.startPoint=startPoint;
  this.targetPoint=targetPoint;
  this.speed=speed;
  time=new SystemTime();
  ((SystemTime)time).rebase();
  float[] tempVector=new float[2];
  tempVector[0]=targetPoint[0] - startPoint[0];
  tempVector[1]=targetPoint[1] - startPoint[1];
  length=(float)Math.sqrt(tempVector[0] * tempVector[0] + tempVector[1] * tempVector[1]);
  directionVector=new float[2];
  directionVector[0]=tempVector[0] / length;
  directionVector[1]=tempVector[1] / length;
  actualPoint=new float[2];
  returnPoint=new float[2];
  actualPoint=startPoint.clone();
  time.update();
  dummyDisk=new DataWindowsDisk(null);
  Tree<PoincareNode> dummyTree=new Tree<PoincareNode>();
  new PoincareNode(dummyTree,"String_Node_Str",1);
  tempVector=new float[2];
  calcuatedPosition=new float[2];
}

Fixed version (ground truth):
public NodeSlerp(float speed,float[] startPoint,float[] targetPoint){
  this.startPoint=startPoint;
  this.targetPoint=targetPoint;
  this.speed=speed;
  time=new SystemTime();
  ((SystemTime)time).rebase();
  float[] tempVector=new float[2];
  tempVector[0]=targetPoint[0] - startPoint[0];
  tempVector[1]=targetPoint[1] - startPoint[1];
  length=(float)Math.sqrt(tempVector[0] * tempVector[0] + tempVector[1] * tempVector[1]);
  directionVector=new float[2];
  directionVector[0]=tempVector[0] / length;
  directionVector[1]=tempVector[1] / length;
  actualPoint=new float[2];
  returnPoint=new float[2];
  actualPoint=startPoint.clone();
  time.update();
  dummyDisk=new DataWindowsDisk(null);
  Tree<PoincareNode> dummyTree=new Tree<PoincareNode>();
  new PoincareNode(dummyTree,"String_Node_Str",1);
}
Program: 58335
Project: 58335
Buggy source:
/** 
 * Constructor.
 * @param sName
 * @param sShapeType
 * @param shX
 * @param shY
 * @param shWidth
 * @param shHeight
 */
public PathwayVertexGraphItemRep(final String sName,final String sShapeType,final short shX,final short shY,final short shWidth,final short shHeight){
  super(EGraphItemKind.NODE);
  if (sShapeType == null || sShapeType.isEmpty())   throw new IllegalArgumentException("String_Node_Str");
  try {
    shape=EPathwayVertexShape.valueOf(sShapeType);
  }
 catch (  IllegalArgumentException e) {
    e.printStackTrace();
  }
  this.sName=sName;
  this.shWidth=shWidth;
  this.shHeight=shHeight;
  setRectangularCoords(shX,shY,shWidth,shHeight);
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param sName
 * @param sShapeType
 * @param shX
 * @param shY
 * @param shWidth
 * @param shHeight
 */
public PathwayVertexGraphItemRep(final String sName,final String sShapeType,final short shX,final short shY,final short shWidth,final short shHeight){
  super(EGraphItemKind.NODE);
  if (sShapeType == null || sShapeType.isEmpty())   shape=EPathwayVertexShape.rect;
 else   shape=EPathwayVertexShape.valueOf(sShapeType);
  this.sName=sName;
  this.shWidth=shWidth;
  this.shHeight=shHeight;
  setRectangularCoords(shX,shY,shWidth,shHeight);
}
Program: 58336
Project: 58336
Buggy source:
public void init(){
  initialContainedViews=new ArrayList<ASerializedView>();
  SerializedParallelCoordinatesView parCoords=new SerializedParallelCoordinatesView();
  parCoords.setDataDomain(EDataDomain.GENETIC_DATA);
  initialContainedViews.add(parCoords);
  SerializedTissueViewBrowserView tissueViewBrowser=new SerializedTissueViewBrowserView();
  tissueViewBrowser.setDataDomain(EDataDomain.TISSUE_DATA);
  initialContainedViews.add(tissueViewBrowser);
  SerializedHierarchicalHeatMapView heatMap=new SerializedHierarchicalHeatMapView();
  heatMap.setDataDomain(EDataDomain.GENETIC_DATA);
  initialContainedViews.add(heatMap);
  parCoords=new SerializedParallelCoordinatesView();
  parCoords.setDataDomain(EDataDomain.CLINICAL_DATA);
  initialContainedViews.add(parCoords);
  SerializedPathwayViewBrowserView pathwayViewBrowser=new SerializedPathwayViewBrowserView();
  pathwayViewBrowser.setDataDomain(EDataDomain.PATHWAY_DATA);
  initialContainedViews.add(pathwayViewBrowser);
  SerializedGlyphView glyph=new SerializedGlyphView();
  glyph.setDataDomain(EDataDomain.CLINICAL_DATA);
  initialContainedViews.add(glyph);
}

Fixed version (ground truth):
public void init(){
  initialContainedViews=new ArrayList<ASerializedView>();
  SerializedParallelCoordinatesView parCoords=new SerializedParallelCoordinatesView();
  parCoords.setDataDomain(EDataDomain.GENETIC_DATA);
  initialContainedViews.add(parCoords);
  SerializedTissueViewBrowserView tissueViewBrowser=new SerializedTissueViewBrowserView();
  tissueViewBrowser.setDataDomain(EDataDomain.TISSUE_DATA);
  initialContainedViews.add(tissueViewBrowser);
  SerializedHierarchicalHeatMapView heatMap=new SerializedHierarchicalHeatMapView();
  heatMap.setDataDomain(EDataDomain.GENETIC_DATA);
  initialContainedViews.add(heatMap);
  GeneralManager.get().getUseCase(EDataDomain.CLINICAL_DATA).updateSetInViews();
  parCoords=new SerializedParallelCoordinatesView();
  parCoords.setDataDomain(EDataDomain.CLINICAL_DATA);
  initialContainedViews.add(parCoords);
  SerializedPathwayViewBrowserView pathwayViewBrowser=new SerializedPathwayViewBrowserView();
  pathwayViewBrowser.setDataDomain(EDataDomain.PATHWAY_DATA);
  initialContainedViews.add(pathwayViewBrowser);
  SerializedGlyphView glyph=new SerializedGlyphView();
  glyph.setDataDomain(EDataDomain.CLINICAL_DATA);
  initialContainedViews.add(glyph);
}
Program: 58338
Project: 58338
Buggy source:
public int getElementNumberOfFoldChangeReduction(ISet compareSet){
  int numberOfElements=0;
  ContentVirtualArray origVA=compareSet.getContentVA(ContentVAType.CONTENT);
  double[] resultVector=setToFoldChangeResult.get(compareSet).getFirst();
  FoldChangeSettings settings=setToFoldChangeResult.get(compareSet).getSecond();
  double foldChangeRatio=settings.getRatio();
  FoldChangeEvaluator foldChangeEvaluator=settings.getEvaluator();
  for (Integer contentIndex=0; contentIndex < origVA.size(); contentIndex++) {
switch (foldChangeEvaluator) {
case LESS:
      if (resultVector[contentIndex] > foldChangeRatio)       continue;
    break;
case GREATER:
  if (resultVector[contentIndex] < foldChangeRatio)   continue;
break;
case SAME:
if (Math.abs(resultVector[contentIndex]) > foldChangeRatio) continue;
break;
}
numberOfElements++;
}
return numberOfElements;
}

Fixed version (ground truth):
public int getElementNumberOfFoldChangeReduction(ISet compareSet){
  int numberOfElements=0;
  ContentVirtualArray origVA=compareSet.getContentVA(ContentVAType.CONTENT);
  double[] resultVector=setToFoldChangeResult.get(compareSet).getFirst();
  FoldChangeSettings settings=setToFoldChangeResult.get(compareSet).getSecond();
  double foldChangeRatio=settings.getRatio();
  FoldChangeEvaluator foldChangeEvaluator=settings.getEvaluator();
  for (Integer contentIndex=0; contentIndex < origVA.size(); contentIndex++) {
switch (foldChangeEvaluator) {
case LESS:
      if (resultVector[contentIndex] * -1 < foldChangeRatio)       continue;
    break;
case GREATER:
  if (resultVector[contentIndex] < foldChangeRatio)   continue;
break;
case SAME:
if (Math.abs(resultVector[contentIndex]) > foldChangeRatio) continue;
break;
}
System.out.println("String_Node_Str" + compareSet + "String_Node_Str"+ contentIndex);
numberOfElements++;
}
return numberOfElements;
}
Program: 58339
Project: 58339
Buggy source:
public void registerEventListeners(){
  addSelectionTypeListener=new SelectionTypeListener();
  addSelectionTypeListener.setHandler(this);
  GeneralManager.get().getEventPublisher().addListener(SelectionTypeEvent.class,addSelectionTypeListener);
}

Fixed version (ground truth):
public void registerEventListeners(){
  addSelectionTypeListener=new SelectionTypeListener();
  addSelectionTypeListener.setHandler(this);
  GeneralManager.get().getEventPublisher().addListener(SelectionTypeEvent.class,addSelectionTypeListener);
  removeManagedSelectionTypesListener=new RemoveManagedSelectionTypesListener();
  removeManagedSelectionTypesListener.setHandler(this);
  GeneralManager.get().getEventPublisher().addListener(RemoveManagedSelectionTypesEvent.class,removeManagedSelectionTypesListener);
}
Program: 58340
Project: 58340
Buggy source:
public void unregisterEventListeners(){
  if (addSelectionTypeListener != null) {
    GeneralManager.get().getEventPublisher().removeListener(addSelectionTypeListener);
    addSelectionTypeListener=null;
  }
}

Fixed version (ground truth):
public void unregisterEventListeners(){
  if (addSelectionTypeListener != null) {
    GeneralManager.get().getEventPublisher().removeListener(addSelectionTypeListener);
    addSelectionTypeListener=null;
  }
  if (removeManagedSelectionTypesListener != null) {
    GeneralManager.get().getEventPublisher().removeListener(removeManagedSelectionTypesListener);
    removeManagedSelectionTypesListener=null;
  }
}
Program: 58341
Project: 58341
Buggy source:
@Override public void run(){
  super.run();
  ClearSelectionsEvent event=new ClearSelectionsEvent();
  event.setSender(this);
  GeneralManager.get().getEventPublisher().triggerEvent(event);
}

Fixed version (ground truth):
@Override public void run(){
  super.run();
  ClearSelectionsEvent event=new ClearSelectionsEvent();
  event.setSender(this);
  GeneralManager.get().getEventPublisher().triggerEvent(event);
  RemoveManagedSelectionTypesEvent resetSelectionTypesEvent=new RemoveManagedSelectionTypesEvent();
  resetSelectionTypesEvent.setSender(this);
  GeneralManager.get().getEventPublisher().triggerEvent(resetSelectionTypesEvent);
}
Program: 58345
Project: 58345
Buggy source:
public void processEvents(){
  for (  Group group : selectedGroups.keySet()) {
    GLHeatMap heatMap=hashHeatMaps.get(group.getGroupIndex());
    if (heatMap != null) {
      heatMap.processEvents();
    }
  }
}

Fixed version (ground truth):
public void processEvents(){
  for (  GLHeatMap heatMap : hashHeatMaps.values()) {
    heatMap.processEvents();
  }
}
Program: 58347
Project: 58347
Buggy source:
public void setHeatMapsInactive(){
  if (activeHeatMapID == -1)   return;
  GLHeatMap heatMap=hashHeatMaps.get(activeHeatMapID);
  ContentSelectionManager hmContentSelectionManager=heatMap.getContentSelectionManager();
  for (  Integer elementID : heatMap.getContentVA()) {
    hmContentSelectionManager.removeFromType(ACompareViewState.ACTIVE_HEATMAP_SELECTION_TYPE,elementID);
  }
  SelectionUpdateEvent selectionUpdateEvent=new SelectionUpdateEvent();
  selectionUpdateEvent.setSelectionDelta(hmContentSelectionManager.getDelta());
  eventPublisher.triggerEvent(selectionUpdateEvent);
  activeHeatMapID=-1;
}

Fixed version (ground truth):
public void setHeatMapsInactive(){
  for (  Integer elementID : contentVA) {
    contentSelectionManager.removeFromType(ACompareViewState.ACTIVE_HEATMAP_SELECTION_TYPE,elementID);
  }
  SelectionUpdateEvent selectionUpdateEvent=new SelectionUpdateEvent();
  selectionUpdateEvent.setSelectionDelta(contentSelectionManager.getDelta());
  eventPublisher.triggerEvent(selectionUpdateEvent);
  activeHeatMapID=-1;
}
Program: 58349
Project: 58349
Buggy source:
@Override public void displayLocal(GL gl){
  processEvents();
  gl.glGetDoublev(GL.GL_PROJECTION_MATRIX,viewport,0);
  if (canvasWidth != (2 / (float)viewport[0])) {
    canvasWidth=2 / (float)viewport[0];
    layoutHotSpotInitSwitch=false;
  }
  if (canvasHeight != (2 / (float)viewport[5])) {
    canvasHeight=2 / (float)viewport[5];
    layoutHotSpotInitSwitch=false;
  }
  remoteElementHeatMap.getGLView().processEvents();
  remoteElementParCoords.getGLView().processEvents();
  remoteElementHyperbolic.getGLView().processEvents();
  if (bIsDisplayListDirtyLocal) {
    buildDisplayList(gl,iGLDisplayListIndexLocal);
    bIsDisplayListDirtyLocal=false;
  }
  iGLDisplayListToCall=iGLDisplayListIndexLocal;
  display(gl);
  checkForHits(gl);
  if (eBusyModeState != EBusyModeState.OFF)   renderBusyMode(gl);
}

Fixed version (ground truth):
@Override public void displayLocal(GL gl){
  processEvents();
  gl.glGetDoublev(GL.GL_PROJECTION_MATRIX,viewport,0);
  if (canvasWidth != (2 / (float)viewport[0])) {
    canvasWidth=2 / (float)viewport[0];
    layoutHotSpotInitSwitch=false;
  }
  if (canvasHeight != (2 / (float)viewport[5])) {
    canvasHeight=2 / (float)viewport[5];
    layoutHotSpotInitSwitch=false;
  }
  remoteElementHeatMap.getGLView().processEvents();
  remoteElementParCoords.getGLView().processEvents();
  remoteElementHyperbolic.getGLView().processEvents();
  if (bIsDisplayListDirtyLocal) {
    buildDisplayList(gl,iGLDisplayListIndexLocal);
    bIsDisplayListDirtyLocal=false;
  }
  iGLDisplayListToCall=iGLDisplayListIndexLocal;
  display(gl);
  pickingManager.handlePicking(this,gl);
  checkForHits(gl);
  if (eBusyModeState != EBusyModeState.OFF)   renderBusyMode(gl);
}
Program: 58350
Project: 58350
Buggy source:
@Override protected void handlePickingEvents(EPickingType ePickingType,EPickingMode pickingMode,int iExternalID,Pick pick){
  if (detailLevel == EDetailLevel.VERY_LOW) {
    return;
  }
  SelectionType selectionType;
switch (ePickingType) {
case DATAW_NODE:
switch (pickingMode) {
case CLICKED:
      arSlerpActions.add(new NodeSlerp(4,disk.getNodeByCompareableValue(iExternalID).getPosition(),new Point2D.Double(0,0)));
    slerpedNode=disk.getNodeByCompareableValue(iExternalID);
}
}
}

Fixed version (ground truth):
@Override protected void handlePickingEvents(EPickingType ePickingType,EPickingMode pickingMode,int iExternalID,Pick pick){
  if (detailLevel == EDetailLevel.VERY_LOW) {
    return;
  }
  SelectionType selectionType;
switch (ePickingType) {
case DATAW_NODE:
switch (pickingMode) {
case CLICKED:
    }
}
}
Program: 58351
Project: 58351
Buggy source:
@Override public void handleEvent(final AEvent event){
  try {
    if (event instanceof LoadPathwayEvent || event instanceof LoadPathwaysByGeneEvent) {
      PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("String_Node_Str");
    }
 else     if (event instanceof OpenMatchmakerViewEvent) {
      GeneralManager.get().getGUIBridge().getDisplay().asyncExec(new Runnable(){
        @Override public void run(){
          StartClusteringAction startClusteringAction=new StartClusteringAction();
          startClusteringAction.setSets(((OpenMatchmakerViewEvent)event).getSetsToCompare());
          startClusteringAction.run();
        }
      }
);
      try {
        PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("String_Node_Str");
      }
 catch (      PartInitException e) {
        e.printStackTrace();
      }
    }
 else     if (event instanceof OpenViewEvent)     PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(((OpenViewEvent)event).getViewType());
  }
 catch (  PartInitException e) {
    e.printStackTrace();
    GeneralManager.get().getLogger().log(new Status(Status.INFO,GeneralManager.PLUGIN_ID,"String_Node_Str",e));
  }
}

Fixed version (ground truth):
@Override public void handleEvent(final AEvent event){
  try {
    if (event instanceof LoadPathwayEvent || event instanceof LoadPathwaysByGeneEvent) {
      PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("String_Node_Str");
    }
 else     if (event instanceof OpenMatchmakerViewEvent) {
      try {
        PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("String_Node_Str");
      }
 catch (      PartInitException e) {
        e.printStackTrace();
      }
      CompareGroupsEvent compareGroupsEvent=new CompareGroupsEvent(((OpenMatchmakerViewEvent)event).getSetsToCompare());
      compareGroupsEvent.setSender(this);
      GeneralManager.get().getEventPublisher().triggerEvent(compareGroupsEvent);
      GeneralManager.get().getGUIBridge().getDisplay().asyncExec(new Runnable(){
        @Override public void run(){
          StartClusteringAction startClusteringAction=new StartClusteringAction();
          startClusteringAction.setSets(((OpenMatchmakerViewEvent)event).getSetsToCompare());
          startClusteringAction.run();
        }
      }
);
    }
 else     if (event instanceof OpenViewEvent)     PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(((OpenViewEvent)event).getViewType());
  }
 catch (  PartInitException e) {
    e.printStackTrace();
    GeneralManager.get().getLogger().log(new Status(Status.INFO,GeneralManager.PLUGIN_ID,"String_Node_Str",e));
  }
}
Program: 58354
Project: 58354
Buggy source:
@Override public void handleDragging(GL gl,float mouseCoordinateX,float mouseCoordinateY){
switch (draggingSelection) {
case COMPARE_SELECTION_WINDOW_SELECTION:
    handleWindowDragging(gl,mouseCoordinateX,mouseCoordinateY);
  break;
case COMPARE_SELECTION_WINDOW_ARROW_LEFT_SELECTION:
handleArrowLeftDragging(gl,mouseCoordinateX,mouseCoordinateY);
break;
case COMPARE_SELECTION_WINDOW_ARROW_RIGHT_SELECTION:
handleArrowRightDragging(gl,mouseCoordinateX,mouseCoordinateY);
break;
}
if (dragged) {
renderWindow(gl,numSelectedItemsDragging,lowestItemIndexDragging,0.5f,false,-0.05f);
}
}

Fixed version (ground truth):
@Override public void handleDragging(GL gl,float mouseCoordinateX,float mouseCoordinateY){
switch (draggingSelection) {
case COMPARE_SELECTION_WINDOW_SELECTION:
    handleWindowDragging(gl,mouseCoordinateX,mouseCoordinateY);
  break;
case COMPARE_SELECTION_WINDOW_ARROW_LEFT_SELECTION:
handleArrowLeftDragging(gl,mouseCoordinateX,mouseCoordinateY);
break;
case COMPARE_SELECTION_WINDOW_ARROW_RIGHT_SELECTION:
handleArrowRightDragging(gl,mouseCoordinateX,mouseCoordinateY);
break;
}
if (dragged) {
renderWindow(gl,numSelectedItemsDragging,lowestItemIndexDragging,0.5f,false,-0.001f);
}
}
Program: 58355
Project: 58355
Buggy source:
public void render(GL gl){
  renderWindow(gl,numSelectedItems,lowestItemIndex,1,true,-0.1f);
}

Fixed version (ground truth):
public void render(GL gl){
  renderWindow(gl,numSelectedItems,lowestItemIndex,1,true,-0.002f);
}
Program: 58356
Project: 58356
Buggy source:
public void executeDrawingPreprocessing(GL gl,boolean isDisplayListDirty){
  handleDragging(gl);
  IViewFrustum viewFrustum=view.getViewFrustum();
  if (isDisplayListDirty)   setBar.setHeight(gl,SET_BAR_HEIGHT_PORTION * viewFrustum.getHeight());
  setupLayouts();
  for (  HeatMapWrapper heatMapWrapper : heatMapWrappers) {
    if (!heatMapWrapper.isInitialized()) {
      heatMapWrapper.init(gl,glMouseListener,null,dataDomain);
    }
    heatMapWrapper.processEvents();
    heatMapWrapper.calculateDrawingParameters();
    if (isDisplayListDirty) {
      heatMapWrapper.setDisplayListDirty();
    }
  }
  setsChanged=false;
}

Fixed version (ground truth):
public void executeDrawingPreprocessing(GL gl,boolean isDisplayListDirty){
  IViewFrustum viewFrustum=view.getViewFrustum();
  if (isDisplayListDirty)   setBar.setHeight(gl,SET_BAR_HEIGHT_PORTION * viewFrustum.getHeight());
  setupLayouts();
  for (  HeatMapWrapper heatMapWrapper : heatMapWrappers) {
    if (!heatMapWrapper.isInitialized()) {
      heatMapWrapper.init(gl,glMouseListener,null,dataDomain);
    }
    heatMapWrapper.processEvents();
    heatMapWrapper.calculateDrawingParameters();
    if (isDisplayListDirty) {
      heatMapWrapper.setDisplayListDirty();
    }
  }
  setsChanged=false;
}
Program: 58359
Project: 58359
Buggy source:
@Override public void drawActiveElements(GL gl){
  for (  HeatMapWrapper heatMapWrapper : heatMapWrappers) {
    if (heatMapWrapper.handleDragging(gl,glMouseListener)) {
      view.setDisplayListDirty();
    }
  }
  for (  HeatMapWrapper heatMapWrapper : heatMapWrappers) {
    if (heatMapWrapper.isNewSelection()) {
      for (      HeatMapWrapper wrapper : heatMapWrappers) {
        if (wrapper != heatMapWrapper) {
          wrapper.choosePassiveHeatMaps(heatMapWrapper.getContentVAsOfHeatMaps(true),true,true);
        }
      }
      view.setDisplayListDirty();
      break;
    }
  }
  for (  HeatMapWrapper heatMapWrapper : heatMapWrappers) {
    heatMapWrapper.drawRemoteItems(gl,glMouseListener,pickingManager);
  }
}

Fixed version (ground truth):
@Override public void drawActiveElements(GL gl){
  for (  HeatMapWrapper heatMapWrapper : heatMapWrappers) {
    if (heatMapWrapper.handleDragging(gl,glMouseListener)) {
      view.setDisplayListDirty();
    }
  }
  for (  HeatMapWrapper heatMapWrapper : heatMapWrappers) {
    if (heatMapWrapper.isNewSelection()) {
      for (      HeatMapWrapper wrapper : heatMapWrappers) {
        if (wrapper != heatMapWrapper) {
          wrapper.choosePassiveHeatMaps(heatMapWrapper.getContentVAsOfHeatMaps(true),true,true,true);
        }
      }
      view.setDisplayListDirty();
      break;
    }
  }
  for (  HeatMapWrapper heatMapWrapper : heatMapWrappers) {
    heatMapWrapper.drawRemoteItems(gl,glMouseListener,pickingManager);
  }
}
Program: 58360
Project: 58360
Buggy source:
public DetailViewState(GLCompare view,int viewID,TextRenderer textRenderer,TextureManager textureManager,PickingManager pickingManager,GLMouseListener glMouseListener,SetBar setBar,RenderCommandFactory renderCommandFactory,EDataDomain dataDomain,IUseCase useCase,DragAndDropController dragAndDropController,CompareViewStateController compareViewStateController){
  super(view,viewID,textRenderer,textureManager,pickingManager,glMouseListener,setBar,renderCommandFactory,dataDomain,useCase,dragAndDropController,compareViewStateController);
  this.setBar.setPosition(new Vec3f(0.0f,0.0f,0.0f));
  numSetsInFocus=2;
  indexOfHeatMapWrapperWithDendrogram=-1;
}

Fixed version (ground truth):
public DetailViewState(GLCompare view,int viewID,TextRenderer textRenderer,TextureManager textureManager,PickingManager pickingManager,GLMouseListener glMouseListener,SetBar setBar,RenderCommandFactory renderCommandFactory,EDataDomain dataDomain,IUseCase useCase,DragAndDropController dragAndDropController,CompareViewStateController compareViewStateController){
  super(view,viewID,textRenderer,textureManager,pickingManager,glMouseListener,setBar,renderCommandFactory,dataDomain,useCase,dragAndDropController,compareViewStateController);
  numSetsInFocus=2;
  indexOfHeatMapWrapperWithDendrogram=-1;
}
Program: 58361
Project: 58361
Buggy source:
public OverviewState(GLCompare view,int viewID,TextRenderer textRenderer,TextureManager textureManager,PickingManager pickingManager,GLMouseListener glMouseListener,SetBar setBar,RenderCommandFactory renderCommandFactory,EDataDomain dataDomain,IUseCase useCase,DragAndDropController dragAndDropController,CompareViewStateController compareViewStateController){
  super(view,viewID,textRenderer,textureManager,pickingManager,glMouseListener,setBar,renderCommandFactory,dataDomain,useCase,dragAndDropController,compareViewStateController);
  this.setBar.setPosition(new Vec3f(0.0f,0.0f,0.0f));
  numSetsInFocus=4;
}

Fixed version (ground truth):
public OverviewState(GLCompare view,int viewID,TextRenderer textRenderer,TextureManager textureManager,PickingManager pickingManager,GLMouseListener glMouseListener,SetBar setBar,RenderCommandFactory renderCommandFactory,EDataDomain dataDomain,IUseCase useCase,DragAndDropController dragAndDropController,CompareViewStateController compareViewStateController){
  super(view,viewID,textRenderer,textureManager,pickingManager,glMouseListener,setBar,renderCommandFactory,dataDomain,useCase,dragAndDropController,compareViewStateController);
  numSetsInFocus=4;
}
Program: 58362
Project: 58362
Buggy source:
/** 
 * Check whether the provided type is a default type.
 * @param selectionType a type to be checked whether it is default
 * @return true if selectionType is a default type, else false
 */
public static boolean isDefaultType(SelectionType selectionType){
  if (NORMAL.equals(selectionType) || MOUSE_OVER.equals(selectionType) || SELECTION.equals(selectionType)|| DESELECTED.equals(defaultTypes))   return true;
  return false;
}

Fixed version (ground truth):
/** 
 * Check whether the provided type is a default type.
 * @param selectionType a type to be checked whether it is default
 * @return true if selectionType is a default type, else false
 */
public static boolean isDefaultType(SelectionType selectionType){
  if (NORMAL.equals(selectionType) || MOUSE_OVER.equals(selectionType) || SELECTION.equals(selectionType)|| DESELECTED.equals(selectionType))   return true;
  return false;
}
Program: 58363
Project: 58363
Buggy source:
private void runContentClustering(AClusterer clusterer,ClusterState clusterState,ClusterResult result,int progressBarOffset,int progressBarMulti){
  clusterer.setClusterState(clusterState);
  TempResult tempResult=clusterer.getSortedVA(set,clusterState,progressBarOffset,progressBarMulti);
  result.contentResult=new ContentData();
  result.contentResult.contentVA=new ContentVirtualArray(clusterState.getContentVAType(),tempResult.indices);
  result.contentResult.contentClusterSizes=tempResult.clusterSizes;
  result.contentResult.contentSampleElements=tempResult.sampleElements;
  result.contentResult.contentTree=tempResult.tree;
  result.contentResult.contentTree.setUseDefaultComparator(false);
}

Fixed version (ground truth):
private void runContentClustering(AClusterer clusterer,ClusterState clusterState,ClusterResult result,int progressBarOffset,int progressBarMulti){
  clusterer.setClusterState(clusterState);
  TempResult tempResult=clusterer.getSortedVA(set,clusterState,progressBarOffset,progressBarMulti);
  result.contentResult=new ContentData();
  result.contentResult.contentVA=new ContentVirtualArray(clusterState.getContentVAType(),tempResult.indices);
  result.contentResult.contentClusterSizes=tempResult.clusterSizes;
  result.contentResult.contentSampleElements=tempResult.sampleElements;
  result.contentResult.contentTree=tempResult.tree;
}
Program: 58364
Project: 58364
Buggy source:
void finish(){
  if (contentVA != null && contentClusterSizes != null && contentSampleElements != null) {
    ContentGroupList contentGroupList=new ContentGroupList();
    int cnt=0;
    contentTree=new Tree<ClusterNode>();
    contentTree.setUseDefaultComparator(false);
    int clusterNr=0;
    ClusterNode root=new ClusterNode(contentTree,"String_Node_Str",clusterNr++,true,-1);
    contentTree.setRootNode(root);
    ClusterNode node;
    int from=0;
    int to=0;
    for (    Integer clusterSize : contentClusterSizes) {
      node=new ClusterNode(contentTree,"String_Node_Str" + clusterNr,clusterNr++,true,-1);
      Group temp=new Group(clusterSize,false,contentSampleElements.get(cnt),SelectionType.NORMAL,node);
      contentTree.addChild(root,node);
      contentGroupList.append(temp);
      cnt++;
      to+=clusterSize;
      ClusterNode leaf;
      for (int vaIndex=from; vaIndex < to; vaIndex++) {
        Integer contentID=contentVA.get(vaIndex);
        leaf=new ClusterNode(contentTree,"String_Node_Str" + contentID,clusterNr++,true,contentID);
        contentTree.addChild(node,leaf);
      }
      from=to;
    }
    contentVA.setGroupList(contentGroupList);
  }
 else   if (contentVA != null && contentTree != null) {
    contentVA.buildNewGroupList(contentTree.getRoot().getChildren());
  }
}

Fixed version (ground truth):
void finish(){
  if (contentVA != null && contentClusterSizes != null && contentSampleElements != null) {
    ContentGroupList contentGroupList=new ContentGroupList();
    int cnt=0;
    contentTree=new Tree<ClusterNode>();
    contentTree.setUseDefaultComparator(false);
    int clusterNr=0;
    ClusterNode root=new ClusterNode(contentTree,"String_Node_Str",clusterNr++,true,-1);
    contentTree.setRootNode(root);
    ClusterNode node;
    int from=0;
    int to=0;
    for (    Integer clusterSize : contentClusterSizes) {
      node=new ClusterNode(contentTree,"String_Node_Str" + clusterNr,clusterNr++,true,-1);
      Group temp=new Group(clusterSize,false,contentSampleElements.get(cnt),SelectionType.NORMAL,node);
      contentTree.addChild(root,node);
      contentGroupList.append(temp);
      cnt++;
      to+=clusterSize;
      ClusterNode leaf;
      for (int vaIndex=from; vaIndex < to; vaIndex++) {
        Integer contentID=contentVA.get(vaIndex);
        leaf=new ClusterNode(contentTree,"String_Node_Str" + contentID,clusterNr++,true,contentID);
        contentTree.addChild(node,leaf);
      }
      from=to;
    }
    contentVA.setGroupList(contentGroupList);
  }
 else   if (contentVA != null && contentTree != null) {
    contentVA.buildNewGroupList(contentTree.getRoot().getChildren());
  }
  contentTree.setUseDefaultComparator(false);
}
Program: 58365
Project: 58365
Buggy source:
public static float[] getColor(int iColorNr){
  float fBrighness=0.9f;
  int iWhiteness=20;
  int color=(iColorNr + 7) % 10;
  float[] fArMappingColor=new float[]{0F,0F,0F,0F};
switch (color) {
case 1:
    fArMappingColor=new float[]{31,120,180,1};
  break;
case 2:
fArMappingColor=new float[]{178,223,138,1};
break;
case 3:
fArMappingColor=new float[]{51,160,44,1};
break;
case 4:
fArMappingColor=new float[]{251,154,153,1};
break;
case 5:
fArMappingColor=new float[]{227,26,28,1};
break;
case 6:
fArMappingColor=new float[]{166,206,227,1};
break;
case 7:
fArMappingColor=new float[]{253,191,111,1};
break;
case 8:
fArMappingColor=new float[]{255,127,0,1};
break;
case 9:
fArMappingColor=new float[]{202,178,214,1};
break;
case 0:
fArMappingColor=new float[]{106,61,154,1};
break;
default :
fArMappingColor=new float[]{0,0,0,1};
}
for (int i=0; i < 3; i++) {
fArMappingColor[i]=fBrighness * ((fArMappingColor[i] - iWhiteness) / 255f);
if (fArMappingColor[i] > 1) fArMappingColor[i]=1;
if (fArMappingColor[i] < 0) fArMappingColor[i]=0;
}
return fArMappingColor;
}

Fixed version (ground truth):
public static float[] getColor(int iColorNr){
  float fBrighness=0.9f;
  int iWhiteness=20;
  int color=(iColorNr) % 6;
  float[] fArMappingColor=new float[]{0F,0F,0F,0F};
switch (color) {
case 0:
    fArMappingColor=new float[]{228,26,28,1};
  break;
case 1:
fArMappingColor=new float[]{77,175,74,1};
break;
case 2:
fArMappingColor=new float[]{152,78,163,1};
break;
case 3:
fArMappingColor=new float[]{255,127,0,1};
break;
case 4:
fArMappingColor=new float[]{255,255,51,1};
break;
case 5:
fArMappingColor=new float[]{166,86,40,1};
break;
case 6:
fArMappingColor=new float[]{247,129,191,1};
break;
default :
fArMappingColor=new float[]{0,0,0,1};
}
for (int i=0; i < 3; i++) {
fArMappingColor[i]=fBrighness * ((fArMappingColor[i] - iWhiteness) / 255f);
if (fArMappingColor[i] > 1) fArMappingColor[i]=1;
if (fArMappingColor[i] < 0) fArMappingColor[i]=0;
}
return fArMappingColor;
}