nus-yam/ex-repair huggingface dataset:
Program: 57149
Project: 57149
Buggy source:
@Override protected void renderContent(GL2 gl){
  if (layoutDisplayListIndex == -1)   layoutDisplayListIndex=gl.glGenLists(1);
  gl.glEnable(GL.GL_BLEND);
  gl.glBlendFunc(GL.GL_ONE,GL.GL_ONE_MINUS_SRC_ALPHA);
  gl.glEnable(GL.GL_LINE_SMOOTH);
  GLU glu=null;
  if (!isBubbleSetInitialized) {
    System.out.println("String_Node_Str" + isBubbleSetInitialized);
    bubbleSetRenderer.init(gl);
    isBubbleSetInitialized=true;
  }
  if (isLayoutDirty()) {
    gl.glNewList(layoutDisplayListIndex,GL2.GL_COMPILE);
    glu=new GLU();
    renderPathwayBorders(gl);
    for (    ALinearizableNode node : pathNodes) {
      node.render(gl,glu);
      renderBranchNodes(gl,glu,node);
    }
    if (expandedBranchSummaryNode != null) {
      renderBranchSummaryNode(gl,glu,expandedBranchSummaryNode);
    }
    renderEdges(gl,pathNodes);
    gl.glEndList();
    setLayoutDirty(false);
  }
  updateBubbleSets(gl);
  this.bubbleSetRenderer.update(gl,null,0);
  this.bubbleSetRenderer.renderPxl(gl,this.x,this.y);
  if (glu == null)   glu=new GLU();
  for (  ALinearizableNode node : pathNodes) {
    node.renderHighlight(gl,glu);
  }
  if (expandedBranchSummaryNode != null) {
    for (    ALinearizableNode node : expandedBranchSummaryNode.getBranchNodes()) {
      node.renderHighlight(gl,glu);
    }
  }
  gl.glCallList(layoutDisplayListIndex);
}

Fixed version (ground truth):
@Override protected void renderContent(GL2 gl){
  if (layoutDisplayListIndex == -1)   layoutDisplayListIndex=gl.glGenLists(1);
  gl.glEnable(GL.GL_BLEND);
  gl.glBlendFunc(GL.GL_ONE,GL.GL_ONE_MINUS_SRC_ALPHA);
  gl.glEnable(GL.GL_LINE_SMOOTH);
  GLU glu=null;
  if (!isBubbleSetInitialized) {
    bubbleSetRenderer.init(gl);
    isBubbleSetInitialized=true;
  }
  if (isLayoutDirty()) {
    gl.glNewList(layoutDisplayListIndex,GL2.GL_COMPILE);
    glu=new GLU();
    renderPathwayBorders(gl);
    for (    ALinearizableNode node : pathNodes) {
      node.render(gl,glu);
      renderBranchNodes(gl,glu,node);
    }
    if (expandedBranchSummaryNode != null) {
      renderBranchSummaryNode(gl,glu,expandedBranchSummaryNode);
    }
    renderEdges(gl,pathNodes);
    gl.glEndList();
    setLayoutDirty(false);
  }
  updateBubbleSets(gl);
  this.bubbleSetRenderer.update(gl,null,0);
  this.bubbleSetRenderer.renderPxl(gl,this.x,this.y);
  if (glu == null)   glu=new GLU();
  for (  ALinearizableNode node : pathNodes) {
    node.renderHighlight(gl,glu);
  }
  if (expandedBranchSummaryNode != null) {
    for (    ALinearizableNode node : expandedBranchSummaryNode.getBranchNodes()) {
      node.renderHighlight(gl,glu);
    }
  }
  gl.glCallList(layoutDisplayListIndex);
}
Program: 57150
Project: 57150
Buggy source:
public void updateBubbleSets(GL2 gl){
  int sizeX=Math.round(this.x);
  int sizeY=Math.round(this.y);
  if (updateStrategy != null && this.updateStrategy instanceof FixedPathUpdateStrategy && sizeX > 0 && sizeY > 0) {
    int i=0;
    this.bubbleSetRenderer.setSize(sizeX,sizeY);
    this.bubbleSetRenderer.clearBubbleSet();
    bubbleSetItems.clear();
    bubbleSetEdges.clear();
    for (    List<PathwayVertexRep> segment : ((FixedPathUpdateStrategy)this.updateStrategy).getSelectedPathSegments()) {
      Rectangle2D prevRect=new Rectangle2D.Double(0f,0f,0f,0f);
      for (      PathwayVertexRep node : segment) {
        Rectangle2D nodeRect=getVertexRepBounds(node);
        if (nodeRect != null) {
          float posx=(float)nodeRect.getCenterX();
          float posy=-(float)nodeRect.getCenterY() + this.y;
          bubbleSetItems.add(new Rectangle2D.Double(posx,posy,nodeRect.getWidth(),nodeRect.getHeight()));
          if (i > 0) {
            bubbleSetEdges.add(new Line2D.Double(posx,posy,prevRect.getCenterX(),prevRect.getCenterY()));
          }
          prevRect.setRect(posx,posy,nodeRect.getWidth(),nodeRect.getHeight());
          i++;
        }
      }
    }
    this.bubbleSetRenderer.addGroup(bubbleSetItems,bubbleSetEdges,bubbleSetColor);
    ((BubbleSet)this.bubbleSetRenderer.setOutline).useVirtualEdges(false);
  }
}

Fixed version (ground truth):
public void updateBubbleSets(GL2 gl){
  int sizeX=Math.round(this.x);
  int sizeY=Math.round(this.y);
  if (updateStrategy != null && this.updateStrategy instanceof FixedPathUpdateStrategy && sizeX > 0 && sizeY > 0) {
    int i=0;
    this.bubbleSetRenderer.setSize(sizeX,sizeY);
    this.bubbleSetRenderer.clearBubbleSet();
    for (    List<PathwayVertexRep> segment : ((FixedPathUpdateStrategy)this.updateStrategy).getSelectedPathSegments()) {
      Rectangle2D prevRect=new Rectangle2D.Double(0f,0f,0f,0f);
      bubbleSetItems.clear();
      bubbleSetEdges.clear();
      i=0;
      for (      PathwayVertexRep node : segment) {
        Rectangle2D nodeRect=getVertexRepBounds(node);
        if (nodeRect != null) {
          float posx=(float)nodeRect.getCenterX();
          float posy=-(float)nodeRect.getCenterY() + this.y;
          bubbleSetItems.add(new Rectangle2D.Double(posx,posy,nodeRect.getWidth(),nodeRect.getHeight()));
          if (i > 0) {
            bubbleSetEdges.add(new Line2D.Double(posx,posy,prevRect.getCenterX(),prevRect.getCenterY()));
          }
          prevRect.setRect(posx,posy,nodeRect.getWidth(),nodeRect.getHeight());
          i++;
        }
      }
      this.bubbleSetRenderer.addGroup(bubbleSetItems,bubbleSetEdges,bubbleSetColor);
    }
    ((BubbleSet)this.bubbleSetRenderer.setOutline).useVirtualEdges(false);
  }
}
Program: 57151
Project: 57151
Buggy source:
/** 
 * @param selectedPath setter, see  {@link #selectedPath}
 */
public void setSelectedPathSegments(List<PathwayPath> pathSegmentsBroadcasted){
  if (pathSegmentsBroadcasted == null)   return;
  pathSegments=pathSegmentsBroadcasted;
  boolean wasPathSelected=this.selectedPath != null;
  this.selectedPath=null;
  for (  PathwayPath path : pathSegments) {
    if (path.getPathway() == pathway) {
      this.selectedPath=path.getPath();
      break;
    }
  }
  allPaths=new ArrayList<GraphPath<PathwayVertexRep,DefaultEdge>>();
  if (selectedPath != null)   allPaths.add(selectedPath);
  if ((wasPathSelected && this.selectedPath == null) || this.selectedPath != null) {
    isBubbleTextureDirty=true;
    setDisplayListDirty();
  }
}

Fixed version (ground truth):
/** 
 * @param selectedPath setter, see  {@link #selectedPath}
 */
public void setSelectedPathSegments(List<PathwayPath> pathSegmentsBroadcasted){
  if (pathSegmentsBroadcasted == null)   return;
  pathSegments=pathSegmentsBroadcasted;
  boolean wasPathSelected=this.selectedPath != null;
  this.selectedPath=null;
  for (  PathwayPath path : pathSegments) {
    if (path.getPathway() == pathway) {
      this.selectedPath=path.getPath();
      break;
    }
  }
  allPaths=new ArrayList<GraphPath<PathwayVertexRep,DefaultEdge>>();
  if (selectedPath != null)   allPaths.add(selectedPath);
  if ((wasPathSelected && this.selectedPath == null) || this.selectedPath != null) {
    isBubbleTextureDirty=true;
    setDisplayListDirty();
  }
  isBubbleTextureDirty=true;
}
Program: 57152
Project: 57152
Buggy source:
private void overlayBubbleSets(GL2 gl){
  if (allPathsList.size() < 1)   return;
  if (isBubbleTextureDirty) {
    this.bubbleSet.clear();
    this.bubbleSet.setPathwayGraph(pathway);
    if (selectedPathID >= 0)     allPathsList.get(allPathsList.size() - 1).setSecond(this.selectedPathID);
 else     allPathsList.get(allPathsList.size() - 1).setSecond(0);
    for (    Pair<List<GraphPath<PathwayVertexRep,DefaultEdge>>,Integer> pathsPair : allPathsList) {
      List<GraphPath<PathwayVertexRep,DefaultEdge>> paths=pathsPair.getFirst();
      this.bubbleSet.addAllPaths(paths,pathsPair.getSecond());
    }
    this.bubbleSet.getBubbleSetGLRenderer().setSize(pathway.getWidth(),pathway.getHeight());
    this.bubbleSet.getBubbleSetGLRenderer().update(gl,null,0);
    isBubbleTextureDirty=false;
  }
  gl.glPushName(generalManager.getViewManager().getPickingManager().getPickingID(uniqueID,EPickingType.PATHWAY_TEXTURE_SELECTION.name(),0));
  this.bubbleSet.getBubbleSetGLRenderer().render(gl,pixelGLConverter.getGLWidthForPixelWidth(pathway.getWidth()),pixelGLConverter.getGLHeightForPixelHeight(pathway.getHeight()));
  gl.glPopName();
}

Fixed version (ground truth):
private void overlayBubbleSets(GL2 gl){
  if (allPathsList.size() < 1)   return;
  if (isBubbleTextureDirty) {
    this.bubbleSet.clear();
    this.bubbleSet.setPathwayGraph(pathway);
    if (selectedPathID >= 0)     allPathsList.get(allPathsList.size() - 1).setSecond(this.selectedPathID);
 else     allPathsList.get(allPathsList.size() - 1).setSecond(0);
    for (    Pair<List<GraphPath<PathwayVertexRep,DefaultEdge>>,Integer> pathsPair : allPathsList) {
      List<GraphPath<PathwayVertexRep,DefaultEdge>> paths=pathsPair.getFirst();
      this.bubbleSet.addAllPaths(paths,pathsPair.getSecond());
    }
    this.bubbleSet.addPathSegements(pathSegments);
    this.bubbleSet.getBubbleSetGLRenderer().setSize(pathway.getWidth(),pathway.getHeight());
    this.bubbleSet.getBubbleSetGLRenderer().update(gl,null,0);
    isBubbleTextureDirty=false;
  }
  gl.glPushName(generalManager.getViewManager().getPickingManager().getPickingID(uniqueID,EPickingType.PATHWAY_TEXTURE_SELECTION.name(),0));
  this.bubbleSet.getBubbleSetGLRenderer().render(gl,pixelGLConverter.getGLWidthForPixelWidth(pathway.getWidth()),pixelGLConverter.getGLHeightForPixelHeight(pathway.getHeight()));
  gl.glPopName();
}
Program: 57153
Project: 57153
Buggy source:
@Override public void keyPressed(IKeyEvent e){
  if (e.isControlDown() && (e.isKey('o'))) {
    enablePathSelection(!isPathSelectionMode);
    getParentComposite().getDisplay().asyncExec(new Runnable(){
      @Override public void run(){
        if (selectPathAction != null) {
          selectPathAction.setChecked(isPathSelectionMode);
        }
      }
    }
);
  }
  isControlKeyDown=e.isControlDown();
  isShiftKeyDown=e.isShiftDown();
  if (e.isDownDown()) {
    System.out.println("String_Node_Str");
    selectNextPath(false);
  }
  if (e.isUpDown()) {
    System.out.println("String_Node_Str");
    selectNextPath(true);
  }
}

Fixed version (ground truth):
@Override public void keyPressed(IKeyEvent e){
  if (e.isControlDown() && (e.isKey('o'))) {
    enablePathSelection(!isPathSelectionMode);
    getParentComposite().getDisplay().asyncExec(new Runnable(){
      @Override public void run(){
        if (selectPathAction != null) {
          selectPathAction.setChecked(isPathSelectionMode);
        }
      }
    }
);
  }
  isControlKeyDown=e.isControlDown();
  isShiftKeyDown=e.isShiftDown();
  if (e.isDownDown()) {
    selectNextPath(false);
  }
  if (e.isUpDown()) {
    selectNextPath(true);
  }
}
Program: 57154
Project: 57154
Buggy source:
protected void registeKeyListeners(){
  parentGLCanvas.addKeyListener(new IGLKeyListener(){
    @Override public void keyPressed(    IKeyEvent e){
      if (e.isControlDown() && (e.isKey('o'))) {
        enablePathSelection(!isPathSelectionMode);
        getParentComposite().getDisplay().asyncExec(new Runnable(){
          @Override public void run(){
            if (selectPathAction != null) {
              selectPathAction.setChecked(isPathSelectionMode);
            }
          }
        }
);
      }
      isControlKeyDown=e.isControlDown();
      isShiftKeyDown=e.isShiftDown();
      if (e.isDownDown()) {
        System.out.println("String_Node_Str");
        selectNextPath(false);
      }
      if (e.isUpDown()) {
        System.out.println("String_Node_Str");
        selectNextPath(true);
      }
    }
    @Override public void keyReleased(    IKeyEvent e){
      isControlKeyDown=e.isControlDown();
      isShiftKeyDown=e.isShiftDown();
    }
  }
);
}

Fixed version (ground truth):
protected void registeKeyListeners(){
  parentGLCanvas.addKeyListener(new IGLKeyListener(){
    @Override public void keyPressed(    IKeyEvent e){
      if (e.isControlDown() && (e.isKey('o'))) {
        enablePathSelection(!isPathSelectionMode);
        getParentComposite().getDisplay().asyncExec(new Runnable(){
          @Override public void run(){
            if (selectPathAction != null) {
              selectPathAction.setChecked(isPathSelectionMode);
            }
          }
        }
);
      }
      isControlKeyDown=e.isControlDown();
      isShiftKeyDown=e.isShiftDown();
      if (e.isDownDown()) {
        selectNextPath(false);
      }
      if (e.isUpDown()) {
        selectNextPath(true);
      }
    }
    @Override public void keyReleased(    IKeyEvent e){
      isControlKeyDown=e.isControlDown();
      isShiftKeyDown=e.isShiftDown();
    }
  }
);
}
Program: 57155
Project: 57155
Buggy source:
private void overlayContextBubbleSets(GL2 gl){
  if (contextPaths.size() < 1)   return;
  if (areContextPathsDirty) {
    this.contextPathBubbleSet.clear();
    this.contextPathBubbleSet.getBubbleSetGLRenderer().setSize(pathway.getWidth(),pathway.getHeight());
    this.contextPathBubbleSet.setPathwayGraph(pathway);
    this.contextPathBubbleSet.addContextPathSegements(contextPaths);
    ((BubbleSet)(contextPathBubbleSet.getBubbleSetGLRenderer().setOutline)).setParameter(10,10,3,10.0,20.0,20.5,5.5,5.0,5);
    this.contextPathBubbleSet.getBubbleSetGLRenderer().update(gl,null,selectedPathID);
    areContextPathsDirty=false;
  }
  this.contextPathBubbleSet.getBubbleSetGLRenderer().render(gl,pixelGLConverter.getGLWidthForPixelWidth(pathway.getWidth()),pixelGLConverter.getGLHeightForPixelHeight(pathway.getHeight()),1.0f);
}

Fixed version (ground truth):
private void overlayContextBubbleSets(GL2 gl){
  if (contextPaths.size() < 1)   return;
  if (areContextPathsDirty) {
    this.contextPathBubbleSet.clear();
    this.contextPathBubbleSet.getBubbleSetGLRenderer().setSize(pathway.getWidth(),pathway.getHeight());
    this.contextPathBubbleSet.setPathwayGraph(pathway);
    this.contextPathBubbleSet.addContextPathSegements(contextPaths);
    ((BubbleSet)(contextPathBubbleSet.getBubbleSetGLRenderer().setOutline)).setParameter(10,10,3,10.0,20.0,20.5,5.5,5.0,5);
    ((BubbleSet)(contextPathBubbleSet.getBubbleSetGLRenderer().setOutline)).useVirtualEdges(false);
    this.contextPathBubbleSet.getBubbleSetGLRenderer().update(gl,null,selectedPathID);
    areContextPathsDirty=false;
  }
  this.contextPathBubbleSet.getBubbleSetGLRenderer().render(gl,pixelGLConverter.getGLWidthForPixelWidth(pathway.getWidth()),pixelGLConverter.getGLHeightForPixelHeight(pathway.getHeight()),1.0f);
}
Program: 57156
Project: 57156
Buggy source:
private void selectNextPath(boolean inc){
  System.out.println("String_Node_Str");
  if (this.allPathsList.size() < 1)   return;
  List<GraphPath<PathwayVertexRep,DefaultEdge>> paths=this.allPathsList.get(this.allPathsList.size() - 1).getFirst();
  if (paths.size() > 1) {
    System.out.println("String_Node_Str");
    if (inc)     selectedPathID++;
 else     selectedPathID--;
    if (selectedPathID < 0)     selectedPathID=0;
    if (selectedPathID > paths.size() - 1)     selectedPathID=paths.size() - 1;
    if (allPaths.size() > 0) {
      selectedPath=paths.get(selectedPathID);
      if (selectedPath.getEdgeList().size() > 0 && !isShiftKeyDown) {
        PathwayVertexRep startPrevVertex=selectedPath.getStartVertex();
        PathwayVertexRep endPrevVertex=selectedPath.getEndVertex();
        List<DefaultEdge> edgePrevList=selectedPath.getEdgeList();
        previousSelectedPath=new GraphPathImpl<PathwayVertexRep,DefaultEdge>(pathway,startPrevVertex,endPrevVertex,edgePrevList,0);
      }
    }
  }
 else {
    selectedPathID=0;
  }
  System.out.println("String_Node_Str" + selectedPathID);
  isBubbleTextureDirty=true;
  setDisplayListDirty();
  triggerPathUpdate();
}

Fixed version (ground truth):
private void selectNextPath(boolean inc){
  if (this.allPathsList.size() < 1)   return;
  List<GraphPath<PathwayVertexRep,DefaultEdge>> paths=this.allPathsList.get(this.allPathsList.size() - 1).getFirst();
  if (paths.size() > 1) {
    if (inc)     selectedPathID++;
 else     selectedPathID--;
    if (selectedPathID < 0)     selectedPathID=0;
    if (selectedPathID > paths.size() - 1)     selectedPathID=paths.size() - 1;
    if (allPaths.size() > 0) {
      selectedPath=paths.get(selectedPathID);
      if (selectedPath.getEdgeList().size() > 0 && !isShiftKeyDown) {
        PathwayVertexRep startPrevVertex=selectedPath.getStartVertex();
        PathwayVertexRep endPrevVertex=selectedPath.getEndVertex();
        List<DefaultEdge> edgePrevList=selectedPath.getEdgeList();
        previousSelectedPath=new GraphPathImpl<PathwayVertexRep,DefaultEdge>(pathway,startPrevVertex,endPrevVertex,edgePrevList,0);
      }
    }
  }
 else {
    selectedPathID=0;
  }
  isBubbleTextureDirty=true;
  setDisplayListDirty();
  triggerPathUpdate();
}
Program: 57157
Project: 57157
Buggy source:
public void addContextPathSegements(List<List<PathwayVertexRep>> contextPaths){
  Color contextPathColor=new Color(0.0f,0.0f,1.0f);
  for (  List<PathwayVertexRep> pathSegment : contextPaths) {
    int i=0;
    Rectangle2D prevRect=new Rectangle2D.Double(0f,0f,0f,0f);
    ArrayList<Rectangle2D> items=new ArrayList<>();
    ArrayList<Line2D> edges=new ArrayList<>();
    for (    PathwayVertexRep node : pathSegment) {
      double bbItemW=node.getWidth();
      double bbItemH=node.getHeight();
      double posX=node.getLowerLeftCornerX();
      double posY=node.getLowerLeftCornerY();
      items.add(new Rectangle2D.Double(posX,posY,bbItemW,bbItemH));
      if (i > 0) {
        edges.add(new Line2D.Double(posX,posY,prevRect.getCenterX(),prevRect.getCenterY()));
      }
      prevRect.setRect(posX,posY,bbItemW,bbItemH);
      i++;
    }
    renderer.addGroup(items,edges,contextPathColor);
  }
}

Fixed version (ground truth):
public void addContextPathSegements(List<List<PathwayVertexRep>> contextPaths){
  Color contextPathColor=new Color(0.0f,0.0f,1.0f);
  ArrayList<Rectangle2D> items=new ArrayList<>();
  ArrayList<Line2D> edges=new ArrayList<>();
  int i=0;
  for (  List<PathwayVertexRep> pathSegment : contextPaths) {
    i=0;
    Rectangle2D prevRect=new Rectangle2D.Double(0f,0f,0f,0f);
    edges.clear();
    items.clear();
    for (    PathwayVertexRep node : pathSegment) {
      double bbItemW=node.getWidth();
      double bbItemH=node.getHeight();
      double posX=node.getLowerLeftCornerX();
      double posY=node.getLowerLeftCornerY();
      items.add(new Rectangle2D.Double(posX,posY,bbItemW,bbItemH));
      if (i > 0) {
        edges.add(new Line2D.Double(posX,posY,prevRect.getCenterX(),prevRect.getCenterY()));
      }
      prevRect.setRect(posX,posY,bbItemW,bbItemH);
      i++;
    }
    renderer.addGroup(items,edges,contextPathColor);
  }
}
Program: 57158
Project: 57158
Buggy source:
public void addAllPaths(List<GraphPath<PathwayVertexRep,DefaultEdge>> allPaths,int selectionID){
  List<org.caleydo.core.util.color.Color> colorTable=(ColorManager.get()).getColorList("String_Node_Str");
  int id=0;
  int colorID=0;
  GraphPath<PathwayVertexRep,DefaultEdge> selPath=null;
  float[] selColor=SelectionType.SELECTION.getColor();
  for (  GraphPath<PathwayVertexRep,DefaultEdge> path : allPaths) {
    if (path == null)     break;
    if (selectionID == id) {
      addColoredPath(path,new Color(selColor[0],selColor[1],selColor[2]));
      addColoredPath(path,new Color(selColor[0],selColor[1],selColor[2]));
      break;
    }
    id++;
  }
  id=0;
  for (  GraphPath<PathwayVertexRep,DefaultEdge> path : allPaths) {
    if (id < colorTable.size() - 2) {
      colorID=id;
    }
 else     colorID=colorTable.size() - 1;
    if (path == null)     break;
    if (selectionID != id) {
      org.caleydo.core.util.color.Color c=colorTable.get(colorID);
      addColoredPath(path,new Color(c.r,c.g,c.b));
    }
    id++;
  }
}

Fixed version (ground truth):
public void addAllPaths(List<GraphPath<PathwayVertexRep,DefaultEdge>> allPaths,int selectionID){
  List<org.caleydo.core.util.color.Color> colorTable=(ColorManager.get()).getColorList("String_Node_Str");
  int id=0;
  int colorID=0;
  GraphPath<PathwayVertexRep,DefaultEdge> selPath=null;
  float[] selColor=SelectionType.SELECTION.getColor();
  for (  GraphPath<PathwayVertexRep,DefaultEdge> path : allPaths) {
    if (path == null)     break;
    if (selectionID == id) {
      break;
    }
    id++;
  }
  id=0;
  for (  GraphPath<PathwayVertexRep,DefaultEdge> path : allPaths) {
    if (id < colorTable.size() - 2) {
      colorID=id;
    }
 else     colorID=colorTable.size() - 1;
    if (path == null)     break;
    if (selectionID != id) {
      org.caleydo.core.util.color.Color c=colorTable.get(colorID);
      addColoredPath(path,new Color(c.r,c.g,c.b));
    }
    id++;
  }
}
Program: 57160
Project: 57160
Buggy source:
/** 
 * are the current changes, e.g. moving triggers changes in the filtering or ordering?
 * @param invalid
 * @param col
 */
public void checkOrderChanges(ARankColumnModel from,ARankColumnModel to){
  if (from != null && from == orderBy) {
    dirtyOrder=true;
    orderByFixed=false;
    fireInvalid();
    return;
  }
  if (findFirstRankable() != orderBy) {
    dirtyOrder=true;
    fireInvalid();
    return;
  }
}

Fixed version (ground truth):
/** 
 * are the current changes, e.g. moving triggers changes in the filtering or ordering?
 * @param invalid
 * @param col
 */
public void checkOrderChanges(ARankColumnModel from,ARankColumnModel to){
  if (from != null && from == orderBy) {
    dirtyOrder=true;
    orderByFixed=false;
    orderBy=null;
    fireInvalid();
    return;
  }
  if (findFirstRankable() != orderBy) {
    dirtyOrder=true;
    fireInvalid();
    return;
  }
}
Program: 57161
Project: 57161
Buggy source:
/** 
 * explodes the given composite model into its components, i.e children
 */
@Override public void explode(ACompositeRankColumnModel model){
  int index=this.columns.indexOf(model);
  List<ARankColumnModel> children=model.getChildren();
  for (  ARankColumnModel child : children)   child.init(this);
  this.columns.set(index,children.get(0));
  propertySupport.fireIndexedPropertyChange(PROP_COLUMNS,index,model,children.get(0));
  if (children.size() > 1) {
    this.columns.addAll(index + 1,children.subList(1,children.size()));
    propertySupport.fireIndexedPropertyChange(PROP_COLUMNS,index + 1,null,children.subList(1,children.size()));
  }
  if (!defaultFilter.checkFilterChanges(model,children.get(0)))   findCorrespondingRanker(index).checkOrderChanges(model,children.get(0));
}

Fixed version (ground truth):
/** 
 * explodes the given composite model into its components, i.e children
 */
@Override public void explode(ACompositeRankColumnModel model){
  int index=this.columns.indexOf(model);
  List<ARankColumnModel> children=model.getChildren();
  for (  ARankColumnModel child : children) {
    child.init(this);
    child.setWidth(100);
  }
  this.columns.set(index,children.get(0));
  propertySupport.fireIndexedPropertyChange(PROP_COLUMNS,index,model,children.get(0));
  if (children.size() > 1) {
    this.columns.addAll(index + 1,children.subList(1,children.size()));
    propertySupport.fireIndexedPropertyChange(PROP_COLUMNS,index + 1,null,children.subList(1,children.size()));
  }
  if (!defaultFilter.checkFilterChanges(model,children.get(0)))   findCorrespondingRanker(index).checkOrderChanges(model,children.get(0));
}
Program: 57162
Project: 57162
Buggy source:
/** 
 * @param pickedPoint
 */
private EDragMode toDragMode(Point pickedPoint){
  Vec2f r=toRelative(pickedPoint);
  float v=isHorizontal ? r.y() : r.x();
  float max=isHorizontal ? getSize().y() : getSize().x();
  if (v < max * 0.25f)   return isHorizontal ? EDragMode.TO : EDragMode.FROM;
  if (v > max * 0.75f)   return !isHorizontal ? EDragMode.TO : EDragMode.FROM;
  return EDragMode.BOTH;
}

Fixed version (ground truth):
/** 
 * @param pickedPoint
 */
private EDragMode toDragMode(Point pickedPoint){
  Vec2f r=toRelative(pickedPoint);
  float v=isHorizontal ? r.y() : r.x();
  float max=isHorizontal ? getSize().y() : getSize().x();
  if (v < max * 0.15f)   return isHorizontal ? EDragMode.TO : EDragMode.FROM;
  if (v > max * 0.85f)   return !isHorizontal ? EDragMode.TO : EDragMode.FROM;
  return EDragMode.BOTH;
}
Program: 57163
Project: 57163
Buggy source:
private APathwayPathRenderer addPath(List<List<PathwayVertexRep>> pathSegments){
  VerticalPathRenderer renderer=new VerticalPathRenderer(view,tablePerspectives);
  renderer.setUpdateStrategy(new FixedPathUpdateStrategy(renderer,eventSpace,isPathSelectionMode,this,selectedPathSegments));
  renderer.pathwayPathEventSpace=eventSpace;
  renderer.setPathway(pathway);
  renderer.setBranchPathExtractionEventSpace(BRANCH_PATH_EVENTSPACE);
  renderer.setAllowBranchPathExtraction(true);
  renderer.setSampleMappingMode(sampleMappingMode);
  renderer.setMappedPerspective(mappedPerspective);
  renderer.setSizeConfig(PathSizeConfiguration.COMPACT);
  for (  VertexRepBasedContextMenuItem item : nodeContextMenuItems) {
    renderer.addVertexRepBasedContextMenuItem(item);
  }
  for (  Pair<IVertexRepBasedEventFactory,PickingMode> eventPair : nodeEvents) {
    renderer.addVertexRepBasedSelectionEvent(eventPair.getFirst(),eventPair.getSecond());
  }
  ElementLayout layout=new ElementLayout();
  layout.setDynamicSizeUnitsX(1);
  layout.setRenderer(renderer);
  pathRow.add(layout);
  renderer.init();
  renderer.setPath(pathSegments);
  renderers.put(renderer,layout);
  return renderer;
}

Fixed version (ground truth):
private APathwayPathRenderer addPath(List<List<PathwayVertexRep>> pathSegments){
  VerticalPathRenderer renderer=new VerticalPathRenderer(view,tablePerspectives);
  renderer.setUpdateStrategy(new FixedPathUpdateStrategy(renderer,eventSpace,isPathSelectionMode,this,selectedPathSegments));
  renderer.pathwayPathEventSpace=eventSpace;
  renderer.setPathway(pathway);
  renderer.setBranchPathExtractionEventSpace(BRANCH_PATH_EVENTSPACE);
  renderer.setAllowBranchPathExtraction(true);
  renderer.setSampleMappingMode(sampleMappingMode);
  renderer.setMappedPerspective(mappedPerspective);
  renderer.setSizeConfig(PathSizeConfiguration.COMPACT);
  for (  VertexRepBasedContextMenuItem item : nodeContextMenuItems) {
    renderer.addVertexRepBasedContextMenuItem(item);
  }
  for (  Pair<IVertexRepBasedEventFactory,PickingMode> eventPair : nodeEvents) {
    renderer.addVertexRepBasedSelectionEvent(eventPair.getFirst(),eventPair.getSecond());
  }
  ElementLayout layout=new ElementLayout();
  layout.setRenderer(renderer);
  pathRow.add(layout);
  renderer.init();
  renderer.setPath(pathSegments);
  layout.setDynamicSizeUnitsX(renderer.getMinWidthPixels());
  renderers.put(renderer,layout);
  return renderer;
}
Program: 57166
Project: 57166
Buggy source:
/** 
 * @param currentActiveBackground setter, see  {@link currentActiveBackground}
 */
public void setActiveWindow(GLWindow activeWindow){
  if (activeWindow != null && this.activeWindow != null && activeWindow != this.activeWindow) {
    this.activeWindow.setActive(false);
  }
  this.activeWindow=activeWindow;
  isLayoutDirty=true;
}

Fixed version (ground truth):
/** 
 * @param currentActiveBackground setter, see  {@link currentActiveBackground}
 */
public void setActiveWindow(GLWindow activeWindow){
  if (activeWindow != null && this.activeWindow != null && activeWindow != this.activeWindow) {
    this.activeWindow.setActive(false);
  }
  if (activeWindow instanceof GLPathwayWindow) {
    portalFocusWindow=(GLPathwayWindow)activeWindow;
  }
  this.activeWindow=activeWindow;
  isLayoutDirty=true;
}
Program: 57168
Project: 57168
Buggy source:
public LayoutSnapshot(){
  for (  PathwayColumn column : columns) {
    PathwayColumn newColumn=new PathwayColumn();
    for (    GLPathwayWindow window : column.windows) {
      newColumn.windows.add(window);
      windowToRendererID.put(window,window.info.multiFormRenderer.getActiveRendererID());
    }
    cols.add(newColumn);
    minTotalWidth+=column.getMinWidth();
    if (newColumn.getMinHeight() > maxColumnHeight) {
      maxColumnHeight=newColumn.getMinHeight();
    }
  }
}

Fixed version (ground truth):
public LayoutSnapshot(){
  for (  PathwayColumn column : columns) {
    PathwayColumn newColumn=new PathwayColumn();
    for (    GLPathwayWindow window : column.windows) {
      newColumn.windows.add(window);
      windowToRendererID.put(window,window.info.multiFormRenderer.getActiveRendererID());
    }
    cols.add(newColumn);
    minTotalWidth+=column.getMinWidth();
    if (newColumn.getMinHeight() > maxL2ColumnHeight && !newColumn.hasLevel(EEmbeddingID.PATHWAY_LEVEL1)) {
      maxL2ColumnHeight=newColumn.getMinHeight();
    }
  }
}
Program: 57169
Project: 57169
Buggy source:
@Override public void display(GL2 gl){
  if (windowToSetActive != null) {
    windowToSetActive.setActive(true);
    windowToSetActive=null;
  }
  boolean updateAugmentation=false;
  if (isLayoutDirty)   updateAugmentation=true;
  super.display(gl);
  if (wasPathwayAdded) {
    EnablePathSelectionEvent event=new EnablePathSelectionEvent(isPathSelectionMode);
    event.setEventSpace(pathEventSpace);
    eventPublisher.triggerEvent(event);
    wasPathwayAdded=false;
  }
  if (updateAugmentation) {
    updateAugmentation();
  }
  dndController.handleDragging(gl,glMouseListener);
  contextMenuItemsToShow.clear();
  wasContextChanged=false;
}

Fixed version (ground truth):
@Override public void display(GL2 gl){
  if (windowToSetActive != null) {
    windowToSetActive.setActive(true);
    windowToSetActive=null;
  }
  boolean updateAugmentation=false;
  if (isLayoutDirty)   updateAugmentation=true;
  super.display(gl);
  if (wasPathwayAdded) {
    EnablePathSelectionEvent event=new EnablePathSelectionEvent(isPathSelectionMode);
    event.setEventSpace(pathEventSpace);
    eventPublisher.triggerEvent(event);
    wasPathwayAdded=false;
  }
  if (updateAugmentation) {
    updateAugmentation();
  }
  dndController.handleDragging(gl,glMouseListener);
  contextMenuItemsToShow.clear();
}
Program: 57170
Project: 57170
Buggy source:
/** 
 * returns all colors of the given brightness
 * @param brightness
 * @return
 */
public static IColor[] get(EBrightness brightness){
switch (brightness) {
case DARK_AND_BRIGHT:
    return dark_and_bright;
case LIGHT:
  return light;
case MEDIUM:
return medium;
}
throw new IllegalStateException();
}

Fixed version (ground truth):
/** 
 * returns all colors of the given brightness
 * @param brightness
 * @return
 */
public static IColor[] get(EBrightness brightness){
switch (brightness) {
case DARK_AND_BRIGHT:
    return dark_and_bright_c;
case LIGHT:
  return light_c;
case MEDIUM:
return medium_c;
}
throw new IllegalStateException();
}
Program: 57171
Project: 57171
Buggy source:
public static StackedRankColumnModel addYear(RankTableModel table,String title,Function<IRow,WorldUniversityYear> year,boolean addStars){
  final StackedRankColumnModel stacked=new StackedRankColumnModel();
  stacked.setTitle(title);
  table.add(stacked);
  Color[] light=StephenFewColorPalette.get(EBrightness.LIGHT);
  Color[] dark=StephenFewColorPalette.get(EBrightness.MEDIUM);
  stacked.add(col(year,COL_academic,"String_Node_Str",dark[1],light[1]));
  stacked.add(col(year,COL_employer,"String_Node_Str",dark[2],light[2]));
  stacked.add(col(year,COL_faculty,"String_Node_Str",dark[3],light[3]));
  stacked.add(col(year,COL_citations,"String_Node_Str",dark[4],light[4]));
  stacked.add(col(year,COL_international,"String_Node_Str",dark[5],light[5]));
  stacked.add(col(year,COL_internationalstudents,"String_Node_Str",dark[6],light[6]));
  stacked.setDistributions(new float[]{40,10,20,20,5,5});
  stacked.setWidth(300);
  if (addStars) {
    StarsRankColumnModel s=new StarsRankColumnModel(new ValueGetter(year,COL_QSSTARS),GLRenderers.drawText("String_Node_Str",VAlign.CENTER),Color.decode("String_Node_Str"),Color.decode("String_Node_Str"),6);
    table.add(s);
  }
  return stacked;
}

Fixed version (ground truth):
public static StackedRankColumnModel addYear(RankTableModel table,String title,Function<IRow,WorldUniversityYear> year,boolean addStars){
  final StackedRankColumnModel stacked=new StackedRankColumnModel();
  stacked.setTitle(title);
  table.add(stacked);
  Color[] light=StephenFewColorPalette.getAsAWT(EBrightness.LIGHT);
  Color[] dark=StephenFewColorPalette.getAsAWT(EBrightness.MEDIUM);
  stacked.add(col(year,COL_academic,"String_Node_Str",dark[1],light[1]));
  stacked.add(col(year,COL_employer,"String_Node_Str",dark[2],light[2]));
  stacked.add(col(year,COL_faculty,"String_Node_Str",dark[3],light[3]));
  stacked.add(col(year,COL_citations,"String_Node_Str",dark[4],light[4]));
  stacked.add(col(year,COL_international,"String_Node_Str",dark[5],light[5]));
  stacked.add(col(year,COL_internationalstudents,"String_Node_Str",dark[6],light[6]));
  stacked.setDistributions(new float[]{40,10,20,20,5,5});
  stacked.setWidth(300);
  if (addStars) {
    StarsRankColumnModel s=new StarsRankColumnModel(new ValueGetter(year,COL_QSSTARS),GLRenderers.drawText("String_Node_Str",VAlign.CENTER),Color.decode("String_Node_Str"),Color.decode("String_Node_Str"),6);
    table.add(s);
  }
  return stacked;
}
Program: 57172
Project: 57172
Buggy source:
@Override public int getMinPixelHeight(){
  if (minHeightPixels != -1)   return minHeightPixels;
  if (pathway == null)   return 120;
  return (int)(pathway.getHeight() * 0.65f);
}

Fixed version (ground truth):
@Override public int getMinPixelHeight(){
  if (minHeightPixels != -1)   return minHeightPixels;
  if (pathway == null)   return 120;
  return (int)(pathway.getHeight() * 0.8f);
}
Program: 57173
Project: 57173
Buggy source:
@Override protected boolean hasPickAbles(){
  return !children.isEmpty();
}

Fixed version (ground truth):
@Override protected boolean hasPickAbles(){
  return super.hasPickAbles() || !children.isEmpty();
}
Program: 57174
Project: 57174
Buggy source:
@Override protected void init(IRankColumnParent table){
  super.init(table);
  RankTableModel t=getTable();
  t.addPropertyChangeListener(RankTableModel.PROP_DATA,listener);
  maskInvalid.set(0,t.getDataSize());
}

Fixed version (ground truth):
@Override protected void init(IRankColumnParent table){
  super.init(table);
  RankTableModel t=getTable();
  t.addPropertyChangeListener(RankTableModel.PROP_DATA,listener);
  maskInvalid.set(0,t.getDataSize());
  cacheHist=null;
}
Program: 57175
Project: 57175
Buggy source:
@Override protected void renderImpl(GLGraphics g,float w,float h){
  if (isOpen) {
    g.incZ(zDeltaList);
    listRenderer.render(g,w,h * model.size(),this);
    g.color(Color.DARK_GRAY).drawLine(0,h,w,h).drawRect(0,0,w,h * model.size() + h);
    for (int i=0; i < model.size(); ++i) {
      actRenderIndex=i;
      g.move(0,h);
      valueRenderer.render(g,w,h,this);
    }
    g.move(0,-h * model.size());
    actRenderIndex=-1;
    g.incZ(-zDeltaList);
  }
 else {
    float hi=h * 0.5f;
    g.color(Color.LIGHT_GRAY).fillPolygon(new Vec2f(w - hi - 1,(h - hi) * 0.5f),new Vec2f(w - 1,(h - hi) * 0.5f),new Vec2f(w - hi * 0.5f - 1,hi + (h - hi) * 0.5f));
  }
  if (selected >= 0 && !isOpen) {
    valueRenderer.render(g,w,h,this);
  }
 else {
    super.renderImpl(g,w,h);
  }
  if (hoveredIndex >= 0) {
    g.incZ(zDeltaList);
    g.move(0,h * (hoveredIndex + 1));
  }
  if (hovered)   hoverEffect.render(g,w,h,this);
  if (armed)   armedEffect.render(g,w,h,this);
  if (hoveredIndex >= 0) {
    g.move(0,-h * (hoveredIndex + 1));
    g.incZ(-zDeltaList);
  }
}

Fixed version (ground truth):
@Override protected void renderImpl(GLGraphics g,float w,float h){
  if (isOpen) {
    g.incZ(zDeltaList);
    g.move(0,h);
    listRenderer.render(g,w,h * model.size(),this);
    g.move(0,-h);
    g.color(Color.DARK_GRAY).drawLine(0,h,w,h).drawRect(0,0,w,h * model.size() + h);
    for (int i=0; i < model.size(); ++i) {
      actRenderIndex=i;
      g.move(0,h);
      valueRenderer.render(g,w,h,this);
    }
    g.move(0,-h * model.size());
    actRenderIndex=-1;
    g.incZ(-zDeltaList);
  }
 else {
    float hi=h * 0.5f;
    g.color(Color.LIGHT_GRAY).fillPolygon(new Vec2f(w - hi - 1,(h - hi) * 0.5f),new Vec2f(w - 1,(h - hi) * 0.5f),new Vec2f(w - hi * 0.5f - 1,hi + (h - hi) * 0.5f));
  }
  if (selected >= 0 && !isOpen) {
    valueRenderer.render(g,w,h,this);
  }
 else {
    super.renderImpl(g,w,h);
  }
  if (hoveredIndex >= 0) {
    g.incZ(zDeltaList);
    g.move(0,h * (hoveredIndex + 1));
  }
  if (hovered)   hoverEffect.render(g,w,h,this);
  if (armed)   armedEffect.render(g,w,h,this);
  if (hoveredIndex >= 0) {
    g.move(0,-h * (hoveredIndex + 1));
    g.incZ(-zDeltaList);
  }
}
Program: 57176
Project: 57176
Buggy source:
@Override public void doLayout(IGLLayoutElement raw,IGLLayoutElement norm,IGLLayoutElement canvas,float x,float y,float w,float h){
  final float histHeight=HIST_HEIGHT + RenderStyle.LABEL_HEIGHT;
  Vec2f rawL;
  Vec2f normL;
  Vec2f canvasL;
  if (isNormalLeft) {
    rawL=new Vec2f(x + histHeight + GAP,y + h - histHeight);
    normL=new Vec2f(x,y + GAP + x);
    canvasL=new Vec2f(histHeight + GAP + x,y + GAP + x);
  }
 else {
    rawL=new Vec2f(x,y + h - histHeight);
    normL=new Vec2f(w - x - histHeight,y + GAP);
    canvasL=new Vec2f(x,y + GAP);
  }
  raw.setBounds(rawL.x(),rawL.y(),w - histHeight - GAP * 2,histHeight);
  raw.asElement().setLayoutData(Boolean.TRUE);
  norm.setBounds(normL.x(),normL.y(),histHeight,h - histHeight - GAP * 2);
  norm.asElement().setLayoutData(!isNormalLeft);
  float x_canvas=canvasL.x();
  float y_canvas=canvasL.y();
  float w_canvas=w - histHeight - GAP * 2;
  float h_canvas=h - histHeight - GAP * 2;
  canvas.setBounds(x_canvas,y_canvas,w_canvas,h_canvas);
}

Fixed version (ground truth):
@Override public void doLayout(IGLLayoutElement raw,IGLLayoutElement norm,IGLLayoutElement canvas,float x,float y,float w,float h){
  final float histHeight=HIST_HEIGHT + RenderStyle.LABEL_HEIGHT;
  Vec2f rawL;
  Vec2f normL;
  Vec2f canvasL;
  if (isNormalLeft) {
    rawL=new Vec2f(x + histHeight + GAP,y + h - histHeight);
    normL=new Vec2f(x,y + GAP + x);
    canvasL=new Vec2f(histHeight + GAP + x,y + GAP);
  }
 else {
    rawL=new Vec2f(x,y + h - histHeight);
    normL=new Vec2f(w - x - histHeight,y + GAP);
    canvasL=new Vec2f(x,y + GAP);
  }
  raw.setBounds(rawL.x(),rawL.y(),w - histHeight - GAP * 2,histHeight);
  raw.asElement().setLayoutData(Boolean.TRUE);
  norm.setBounds(normL.x(),normL.y(),histHeight,h - histHeight - GAP * 2);
  norm.asElement().setLayoutData(!isNormalLeft);
  float x_canvas=canvasL.x();
  float y_canvas=canvasL.y();
  float w_canvas=w - histHeight - GAP * 2;
  float h_canvas=h - histHeight - GAP * 2;
  canvas.setBounds(x_canvas,y_canvas,w_canvas,h_canvas);
}
Program: 57177
Project: 57177
Buggy source:
public GLPathwayBackground(){
}

Fixed version (ground truth):
public GLPathwayBackground(GLWindow parentWindow){
  this.parentWindow=parentWindow;
}
Program: 57178
Project: 57178
Buggy source:
private boolean setWindowActive(Point mousePosition,GLWindow window){
  Vec2f location=window.getAbsoluteLocation();
  Vec2f size=window.getSize();
  if ((mousePosition.x >= location.x() && mousePosition.x <= location.x() + size.x()) && (mousePosition.y >= location.y() && mousePosition.y <= location.y() + size.y())) {
    window.setActive(true);
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean setWindowActive(Point mousePosition,GLWindow window){
  Vec2f location=window.getAbsoluteLocation();
  Vec2f size=window.getSize();
  if ((mousePosition.x >= location.x() && mousePosition.x <= location.x() + size.x()) && (mousePosition.y >= location.y() && mousePosition.y <= location.y() + size.y())) {
    windowToSetActive=window;
    return true;
  }
  return false;
}
Program: 57180
Project: 57180
Buggy source:
@Override public void display(GL2 gl){
  boolean updateAugmentation=false;
  if (isLayoutDirty)   updateAugmentation=true;
  super.display(gl);
  for (  AContextMenuItem item : contextMenuItemsToShow) {
    getContextMenuCreator().add(item);
  }
  if (wasPathwayAdded) {
    EnablePathSelectionEvent event=new EnablePathSelectionEvent(isPathSelectionMode);
    event.setEventSpace(pathEventSpace);
    eventPublisher.triggerEvent(event);
    wasPathwayAdded=false;
  }
  if (updateAugmentation) {
    updateAugmentation();
  }
  dndController.handleDragging(gl,glMouseListener);
  contextMenuItemsToShow.clear();
}

Fixed version (ground truth):
@Override public void display(GL2 gl){
  if (windowToSetActive != null) {
    windowToSetActive.setActive(true);
    windowToSetActive=null;
  }
  boolean updateAugmentation=false;
  if (isLayoutDirty)   updateAugmentation=true;
  super.display(gl);
  if (wasPathwayAdded) {
    EnablePathSelectionEvent event=new EnablePathSelectionEvent(isPathSelectionMode);
    event.setEventSpace(pathEventSpace);
    eventPublisher.triggerEvent(event);
    wasPathwayAdded=false;
  }
  if (updateAugmentation) {
    updateAugmentation();
  }
  dndController.handleDragging(gl,glMouseListener);
  contextMenuItemsToShow.clear();
}
Program: 57181
Project: 57181
Buggy source:
protected final void invalidAllFilter(){
  maskInvalid.set(0,getTable().getDataSize());
}

Fixed version (ground truth):
protected final void invalidAllFilter(){
  if (parent != null)   maskInvalid.set(0,getTable().getDataSize());
}
Program: 57182
Project: 57182
Buggy source:
public void setCollapsed(boolean collapsed){
  if (this.collapsed == collapsed)   return;
  if (collapsed && !parent.isCollapseAble(this))   return;
  propertySupport.firePropertyChange(ICollapseableColumnMixin.PROP_COLLAPSED,this.collapsed,this.collapsed=collapsed);
}

Fixed version (ground truth):
public void setCollapsed(boolean collapsed){
  if (this.collapsed == collapsed)   return;
  if (collapsed && parent != null && !parent.isCollapseAble(this))   return;
  propertySupport.firePropertyChange(ICollapseableColumnMixin.PROP_COLLAPSED,this.collapsed,this.collapsed=collapsed);
}
Program: 57183
Project: 57183
Buggy source:
/** 
 * @param piecewiseMappingCrossUI
 */
public void addMode(AMappingFunctionMode<?> mode){
  modes.add(mode);
  GLButton b=new GLButton(EButtonMode.BUTTON);
  final String icon=mode.getIcon();
  b.setRenderer(GLRenderers.fillImage(icon));
  b.setSelectedRenderer(new IGLRenderer(){
    @Override public void render(    GLGraphics g,    float w,    float h,    GLElement parent){
      g.color(Color.RED).fillRect(0,0,w,h);
      g.fillImage(icon,0,0,w,h);
    }
  }
);
  b.setPickingObjectId(modes.size() - 1);
  b.setSize(RenderStyle.BUTTON_WIDTH,Float.NaN);
  ((GLElementContainer)this.get(BUTTONS)).add(modes.size() - 1,b);
  if (modes.size() == 1) {
    this.add(modes.get(0));
    b.setSelected(true);
  }
  radio.add(b);
}

Fixed version (ground truth):
/** 
 * @param piecewiseMappingCrossUI
 */
public void addMode(AMappingFunctionMode<?> mode){
  modes.add(mode);
  GLButton b=new GLButton(EButtonMode.BUTTON);
  final String icon=mode.getIcon();
  b.setRenderer(GLRenderers.fillImage(icon));
  b.setSelectedRenderer(new IGLRenderer(){
    @Override public void render(    GLGraphics g,    float w,    float h,    GLElement parent){
      g.color(Color.RED).fillRect(0,0,w,h);
      g.fillImage(icon,0,0,w,h);
    }
  }
);
  b.setTooltip("String_Node_Str" + mode.getName() + "String_Node_Str");
  b.setPickingObjectId(modes.size() - 1);
  b.setSize(RenderStyle.BUTTON_WIDTH,Float.NaN);
  ((GLElementContainer)this.get(BUTTONS)).add(modes.size() - 1,b);
  if (modes.size() == 1) {
    this.add(modes.get(0));
    b.setSelected(true);
  }
  radio.add(b);
}
Program: 57184
Project: 57184
Buggy source:
public MappingFunctionUI(IMappingFunction model,IFloatList data,Color color,Color bgColor,ICallback<? super IMappingFunction> callback){
  this.callback=callback;
  this.model=model;
  this.raw=data;
  this.color=color;
  this.backgroundColor=bgColor;
  this.add(new RawHistogramElement(raw.map(FloatFunctions.normalize(model.getActMin(),model.getActMax()))));
  this.add(new NormalizedHistogramElement());
  this.add(new CodeElement());
  ButtonBar buttons=new ButtonBar();
  buttons.addSpacer();
  GLComboBox<EStandardMappings> mappings=new GLComboBox<>(Arrays.asList(EStandardMappings.values()),GLComboBox.DEFAULT,GLRenderers.fillRect(Color.WHITE));
  mappings.setRenderer(new IGLRenderer(){
    @Override public void render(    GLGraphics g,    float w,    float h,    GLElement parent){
      g.color(Color.BLACK).drawRect(0,0,w,h);
      g.drawText("String_Node_Str",1,h * 0.25f,w - 2,h * 0.5f);
    }
  }
);
  mappings.setCallback(this);
  mappings.setSize(RenderStyle.BUTTON_WIDTH * 4,Float.NaN);
  mappings.setTooltip("String_Node_Str");
  buttons.add(mappings);
  buttons.addSpacer();
  GLButton b=new GLButton();
  b.setRenderer(GLRenderers.fillImage(RenderStyle.ICON_MAPPING_RESET));
  b.setCallback(this);
  b.setPickingObjectId(-1);
  b.setSize(RenderStyle.BUTTON_WIDTH,Float.NaN);
  buttons.add(b);
  this.add(buttons);
  setLayout(this);
}

Fixed version (ground truth):
public MappingFunctionUI(IMappingFunction model,IFloatList data,Color color,Color bgColor,ICallback<? super IMappingFunction> callback){
  this.callback=callback;
  this.model=model;
  this.raw=data;
  this.color=color;
  this.backgroundColor=bgColor;
  this.add(new RawHistogramElement(raw.map(FloatFunctions.normalize(model.getActMin(),model.getActMax()))));
  this.add(new NormalizedHistogramElement());
  this.add(new CodeElement());
  ButtonBar buttons=new ButtonBar();
  buttons.addSpacer();
  GLComboBox<EStandardMappings> mappings=new GLComboBox<>(Arrays.asList(EStandardMappings.values()),GLComboBox.DEFAULT,GLRenderers.fillRect(Color.WHITE));
  mappings.setRenderer(new IGLRenderer(){
    @Override public void render(    GLGraphics g,    float w,    float h,    GLElement parent){
      g.color(Color.BLACK).drawRect(0,0,w,h);
      g.drawText("String_Node_Str",1,h * 0.25f,w - 2,h * 0.5f);
    }
  }
);
  mappings.setCallback(this);
  mappings.setSize(RenderStyle.BUTTON_WIDTH * 4,Float.NaN);
  mappings.setTooltip("String_Node_Str");
  buttons.add(mappings);
  buttons.addSpacer();
  GLButton b=new GLButton();
  b.setRenderer(GLRenderers.fillImage(RenderStyle.ICON_MAPPING_RESET));
  b.setTooltip("String_Node_Str");
  b.setCallback(this);
  b.setPickingObjectId(-1);
  b.setSize(RenderStyle.BUTTON_WIDTH,Float.NaN);
  buttons.add(b);
  this.add(buttons);
  setLayout(this);
}
Program: 57185
Project: 57185
Buggy source:
private StackedRankColumnModel createPValue(RankTableModel table,final int column,final String label,Color color,Color bgColor){
  StackedRankColumnModel stacked=new StackedRankColumnModel();
  stacked.setTitle(label);
  table.add(stacked);
  for (  TumorType type : TumorType.values()) {
    stacked.add(new FloatRankColumnModel(new ValueGetter(type,column),GLRenderers.drawText(type.name() + "String_Node_Str" + label,VAlign.CENTER),color,bgColor,pValueMapping(),FloatInferrers.MEDIAN));
  }
  stacked.setWidth(250);
  return stacked;
}

Fixed version (ground truth):
private StackedRankColumnModel createPValue(RankTableModel table,final int column,final String label,Color color,Color bgColor){
  StackedRankColumnModel stacked=new StackedRankColumnModel();
  stacked.setTitle(label);
  table.add(stacked);
  for (  TumorType type : TumorType.values()) {
    stacked.add(pcol(type,column,label,color,bgColor));
  }
  stacked.setWidth(250);
  return stacked;
}
Program: 57186
Project: 57186
Buggy source:
private StackedRankColumnModel createUnBound(RankTableModel table,final int column,final String label,Color color,Color bgColor){
  StackedRankColumnModel stacked=new StackedRankColumnModel();
  stacked.setTitle(label);
  table.add(stacked);
  for (  TumorType type : TumorType.values()) {
    stacked.add(new FloatRankColumnModel(new ValueGetter(type,column),GLRenderers.drawText(type.name() + "String_Node_Str" + label,VAlign.CENTER),color,bgColor,new PiecewiseMapping(0,Float.NaN),FloatInferrers.MEDIAN));
  }
  stacked.setWidth(150);
  return stacked;
}

Fixed version (ground truth):
private StackedRankColumnModel createUnBound(RankTableModel table,final int column,final String label,Color color,Color bgColor){
  StackedRankColumnModel stacked=new StackedRankColumnModel();
  stacked.setTitle(label);
  table.add(stacked);
  for (  TumorType type : TumorType.values()) {
    stacked.add(ucol(type,column,label,color,bgColor));
  }
  stacked.setWidth(150);
  return stacked;
}