nus-yam/ex-repair huggingface dataset:
Program: 57187
Project: 57187
Buggy source:
@Override public void apply(RankTableModel table) throws Exception {
  List<GeneRow> rows=readData();
  table.addData(rows);
  RankRankColumnModel rankRankColumnModel=new RankRankColumnModel();
  table.add(rankRankColumnModel);
  table.add(new StringRankColumnModel(GLRenderers.drawText("String_Node_Str",VAlign.CENTER),StringRankColumnModel.DEFAULT));
  StackedRankColumnModel m=createPValue(table,TumorTypeRow.COL_p,"String_Node_Str",Color.decode("String_Node_Str"),Color.decode("String_Node_Str"));
  m.setFilter(0.3f,1.0f);
  createPValue(table,TumorTypeRow.COL_q,"String_Node_Str",Color.decode("String_Node_Str"),Color.decode("String_Node_Str"));
  createUnBound(table,TumorTypeRow.COL_nflank,"String_Node_Str",Color.decode("String_Node_Str"),Color.decode("String_Node_Str"));
  createUnBound(table,TumorTypeRow.COL_nsil,"String_Node_Str",Color.decode("String_Node_Str"),Color.decode("String_Node_Str"));
  createUnBound(table,TumorTypeRow.COL_nnon,"String_Node_Str",Color.decode("String_Node_Str"),Color.decode("String_Node_Str"));
  createUnBound(table,TumorTypeRow.COL_nnull,"String_Node_Str",Color.decode("String_Node_Str"),Color.decode("String_Node_Str"));
}

Fixed version (ground truth):
@Override public void apply(RankTableModel table) throws Exception {
  List<GeneRow> rows=readData();
  table.addData(rows);
  for (  TumorType type : TumorType.values()) {
    OrderColumn c=new OrderColumn();
    c.setTitle(type.toString());
    table.add(c);
    table.add(new RankRankColumnModel());
    table.add(new StringRankColumnModel(GLRenderers.drawText("String_Node_Str",VAlign.CENTER),StringRankColumnModel.DEFAULT));
    FloatRankColumnModel ci=pcol(type,TumorTypeRow.COL_p,"String_Node_Str",Color.decode("String_Node_Str"),Color.decode("String_Node_Str"));
    ci.setFilterNotMappedEntries(true);
    table.add(ci);
    ci=pcol(type,TumorTypeRow.COL_q,"String_Node_Str",Color.decode("String_Node_Str"),Color.decode("String_Node_Str"));
    ci.setCollapsed(true);
    table.add(ci);
    ci=ucol(type,TumorTypeRow.COL_nflank,"String_Node_Str",Color.decode("String_Node_Str"),Color.decode("String_Node_Str"));
    ci.setCollapsed(true);
    table.add(ci);
    ci=ucol(type,TumorTypeRow.COL_nsil,"String_Node_Str",Color.decode("String_Node_Str"),Color.decode("String_Node_Str"));
    ci.setCollapsed(true);
    table.add(ci);
    ci=ucol(type,TumorTypeRow.COL_nnon,"String_Node_Str",Color.decode("String_Node_Str"),Color.decode("String_Node_Str"));
    ci.setCollapsed(true);
    table.add(ci);
    ci=ucol(type,TumorTypeRow.COL_nnull,"String_Node_Str",Color.decode("String_Node_Str"),Color.decode("String_Node_Str"));
    ci.setCollapsed(true);
    table.add(ci);
  }
}
Program: 57188
Project: 57188
Buggy source:
private PiecewiseMapping pValueMapping(){
  PiecewiseMapping p=new PiecewiseMapping(0,1);
  p.clear();
  p.put(0,1);
  p.put(1,0);
  return p;
}

Fixed version (ground truth):
private PiecewiseMapping pValueMapping(){
  PiecewiseMapping p=new PiecewiseMapping(0,1);
  p.clear();
  p.put(0,1);
  p.put(0.8f,0);
  return p;
}
Program: 57189
Project: 57189
Buggy source:
@Override public void mouseMoved(IMouseEvent mouseEvent){
  Point mousePosition=mouseEvent.getPoint();
  for (  PathwayMultiFormInfo info : pathwayInfos) {
    if (setWindowActive(mousePosition,info.window))     return;
  }
  if (setWindowActive(mousePosition,pathInfo.window))   return;
  if (setWindowActive(mousePosition,rankingWindow))   return;
  if (setWindowActive(mousePosition,dataMappingWindow))   return;
}

Fixed version (ground truth):
@Override public void mouseMoved(IMouseEvent mouseEvent){
  Point mousePosition=mouseEvent.getPoint();
  if (pathwayRow.getVisibility() != EVisibility.NONE) {
    for (    PathwayMultiFormInfo info : pathwayInfos) {
      if (setWindowActive(mousePosition,info.window))       return;
    }
  }
  if (setWindowActive(mousePosition,pathInfo.window))   return;
  if (setWindowActive(mousePosition,rankingWindow))   return;
  if (setWindowActive(mousePosition,dataMappingWindow))   return;
}
Program: 57192
Project: 57192
Buggy source:
private void addLinkRenderers(PathwayVertexRep vertexRep,PathwayMultiFormInfo sourceInfo,PathwayMultiFormInfo targetInfo,Pair<Rectangle2D,Boolean> sourcePair){
  Set<PathwayVertexRep> equivalentVertexReps=PathwayManager.get().getEquivalentVertexRepsInPathway(vertexRep,targetInfo.pathway);
  for (  PathwayVertexRep v : equivalentVertexReps) {
    if (isPathLink(vertexRep,v))     continue;
    Pair<Rectangle2D,Boolean> targetPair=getPortalLocation(v,targetInfo);
    float stubSize=Math.max(1,Math.abs(pathwayLayout.getColumnIndex((GLPathwayWindow)sourceInfo.window) - pathwayLayout.getColumnIndex((GLPathwayWindow)targetInfo.window)));
    LinkRenderer renderer=new LinkRenderer(this,vertexRep == currentPortalVertexRep || v == currentPortalVertexRep || isSelectedPortalLink(vertexRep,v),sourcePair.getFirst(),targetPair.getFirst(),sourceInfo,targetInfo,stubSize,sourcePair.getSecond(),targetPair.getSecond(),PathwayManager.get().areVerticesEquivalent(vertexRep,currentContextVertexRep),false,vertexRep,v);
    augmentation.add(renderer);
  }
}

Fixed version (ground truth):
private void addLinkRenderers(PathwayVertexRep vertexRep,PathwayMultiFormInfo sourceInfo,PathwayMultiFormInfo targetInfo,Pair<Rectangle2D,Boolean> sourcePair){
  Set<PathwayVertexRep> equivalentVertexReps=PathwayManager.get().getEquivalentVertexRepsInPathway(vertexRep,targetInfo.pathway);
  for (  PathwayVertexRep v : equivalentVertexReps) {
    if (isPathLink(vertexRep,v) || pathwayRow.getVisibility() == EVisibility.NONE)     continue;
    Pair<Rectangle2D,Boolean> targetPair=getPortalLocation(v,targetInfo);
    float stubSize=Math.max(1,Math.abs(pathwayLayout.getColumnIndex((GLPathwayWindow)sourceInfo.window) - pathwayLayout.getColumnIndex((GLPathwayWindow)targetInfo.window)));
    LinkRenderer renderer=new LinkRenderer(this,vertexRep == currentPortalVertexRep || v == currentPortalVertexRep || isSelectedPortalLink(vertexRep,v),sourcePair.getFirst(),targetPair.getFirst(),sourceInfo,targetInfo,stubSize,sourcePair.getSecond(),targetPair.getSecond(),PathwayManager.get().areVerticesEquivalent(vertexRep,currentContextVertexRep),false,vertexRep,v);
    augmentation.add(renderer);
  }
}
Program: 57194
Project: 57194
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.setSizeConfig(PathSizeConfiguration.COMPACT);
  for (  VertexRepBasedContextMenuItem item : nodeContextMenuItems) {
    renderer.addVertexRepBasedContextMenuItem(item);
  }
  for (  Pair<VertexRepBasedEventFactory,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<VertexRepBasedEventFactory,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;
}
Program: 57195
Project: 57195
Buggy source:
@Override protected void onMouseOver(Pick pick){
  parentWindow.setActive(true);
}

Fixed version (ground truth):
@Override protected void onMouseOver(Pick pick){
}
Program: 57197
Project: 57197
Buggy source:
public GLPathwayBackground(GLWindow parentWindow){
  this.parentWindow=parentWindow;
}

Fixed version (ground truth):
public GLPathwayBackground(){
}
Program: 57198
Project: 57198
Buggy source:
@Override public void mouseMoved(IMouseEvent mouseEvent){
  Point mousePosition=mouseEvent.getPoint();
  for (  PathwayMultiFormInfo info : pathwayInfos) {
    if (setWindowActive(mousePosition,info.window))     return;
  }
  if (setWindowActive(mousePosition,pathInfo.window))   return;
  if (setWindowActive(mousePosition,rankingWindow))   return;
  setWindowActive(mousePosition,dataMappingWindow);
}

Fixed version (ground truth):
@Override public void mouseMoved(IMouseEvent mouseEvent){
  Point mousePosition=mouseEvent.getPoint();
  for (  PathwayMultiFormInfo info : pathwayInfos) {
    if (setWindowActive(mousePosition,info.window))     return;
  }
  if (setWindowActive(mousePosition,pathInfo.window))   return;
  if (setWindowActive(mousePosition,rankingWindow))   return;
  if (setWindowActive(mousePosition,dataMappingWindow))   return;
}
Program: 57200
Project: 57200
Buggy source:
@Override public void display(GL2 gl){
  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);
}

Fixed version (ground truth):
@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();
}
Program: 57201
Project: 57201
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;
  clearSelectedPortalLinks();
  updatePathwayPortals();
}

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);
  }
  this.activeWindow=activeWindow;
  isLayoutDirty=true;
}
Program: 57202
Project: 57202
Buggy source:
public void setActive(boolean active){
  if (active == this.active)   return;
  if (active) {
    view.setActiveWindow(this);
    repaint();
    if (showCloseButton)     titleBar.closeButton.setVisibility(EVisibility.PICKABLE);
  }
 else {
    titleBar.closeButton.setVisibility(EVisibility.NONE);
  }
  background.setHovered(active);
  this.active=active;
}

Fixed version (ground truth):
public void setActive(boolean active){
  if (active == this.active)   return;
  if (active) {
    view.setActiveWindow(this);
    repaint();
    if (showCloseButton)     titleBar.closeButton.setVisibility(EVisibility.PICKABLE);
  }
 else {
    titleBar.closeButton.setVisibility(EVisibility.NONE);
  }
  this.active=active;
}
Program: 57204
Project: 57204
Buggy source:
@Override public List<TablePerspective> getTablePerspectives(){
  return experimentalDataMappingElement.getTablePerspectives();
}

Fixed version (ground truth):
@Override public List<TablePerspective> getTablePerspectives(){
  return experimentalDataMappingElement.getDmState().getTablePerspectives();
}
Program: 57206
Project: 57206
Buggy source:
private void updatePathwayDatasets(){
  pathwayDatasets.clear();
  pathwayDatasets.add(new GLElement(){
    @Override protected void renderImpl(    GLGraphics g,    float w,    float h){
      g.drawText("String_Node_Str",0,-2,w,h);
    }
  }
.setSize(100,15));
  RadioController radio=new RadioController(new ISelectionCallback(){
    @Override public void onSelectionChanged(    GLButton button,    boolean selected){
      if (selected) {
        ATableBasedDataDomain dd=button.getLayoutDataAs(ATableBasedDataDomain.class,null);
        TablePerspective perspective=dmState.getMatchingTablePerspective(dd);
        PathwayMappingEvent event=new PathwayMappingEvent(perspective);
        EventPublisher.trigger(event);
      }
    }
  }
);
  PathwayDataSetElement ddElement=new PathwayDataSetElement("String_Node_Str");
  pathwayDatasets.add(ddElement);
  radio.add(ddElement);
  for (  ATableBasedDataDomain dd : dmState.getDataDomains()) {
    if (dd instanceof GeneticDataDomain) {
      ddElement=new PathwayDataSetElement(dd);
      pathwayDatasets.add(ddElement);
      radio.add(ddElement);
    }
  }
}

Fixed version (ground truth):
private void updatePathwayDatasets(){
  pathwayDatasets.clear();
  pathwayDatasets.add(new GLElement(){
    @Override protected void renderImpl(    GLGraphics g,    float w,    float h){
      g.drawText("String_Node_Str",0,-2,w,h);
    }
  }
.setSize(150,15));
  RadioController radio=new RadioController(new ISelectionCallback(){
    @Override public void onSelectionChanged(    GLButton button,    boolean selected){
      if (selected) {
        ATableBasedDataDomain dd=button.getLayoutDataAs(ATableBasedDataDomain.class,null);
        TablePerspective perspective=dmState.getMatchingTablePerspective(dd);
        dmState.setPathwayMappedTablePerspective(perspective);
        PathwayMappingEvent event=new PathwayMappingEvent(perspective);
        EventPublisher.trigger(event);
      }
    }
  }
);
  PathwayDataSetElement noMappingElement=new PathwayDataSetElement("String_Node_Str");
  pathwayDatasets.add(noMappingElement);
  radio.add(noMappingElement);
  PathwayDataSetElement pwMappingElement;
  boolean wasPreviouslySelected=false;
  for (  ATableBasedDataDomain dd : dmState.getDataDomains()) {
    if (dd instanceof GeneticDataDomain) {
      pwMappingElement=new PathwayDataSetElement(dd);
      pathwayDatasets.add(pwMappingElement);
      radio.add(pwMappingElement);
      if (dmState.getPathwayMappedTablePerspective() != null && dmState.getPathwayMappedTablePerspective().getDataDomain() == dd) {
        pwMappingElement.setSelected(true);
        wasPreviouslySelected=true;
      }
    }
  }
  if (!wasPreviouslySelected) {
    noMappingElement.setSelected(true);
    EventPublisher.trigger(new PathwayMappingEvent());
  }
}
Program: 57207
Project: 57207
Buggy source:
public GLExperimentalDataMapping(GLSubGraph view){
  this.view=view;
  setLayout(new GLFlowLayout(false,2,new GLPadding(2)));
  setSize(-1,40);
  dmState=new DataMappingState(view.getPathEventSpace());
  GLElementContainer ddElements=new GLElementContainer(new GLFlowLayout(true,10,new GLPadding(5)));
  GLElementContainer stratElements=new GLElementContainer(new GLFlowLayout(true,10,new GLPadding(5)));
  pathwayDatasets=new GLElementContainer(new GLFlowLayout(true,10,new GLPadding(5)));
  addPerspectiveElements(stratElements);
  addDataDomainElements(ddElements);
  updatePathwayDatasets();
  this.add(ddElements);
  this.add(stratElements);
  this.add(pathwayDatasets);
}

Fixed version (ground truth):
public GLExperimentalDataMapping(GLSubGraph view){
  this.view=view;
  setLayout(new GLFlowLayout(true,2,new GLPadding(5)));
  setSize(-1,50);
  dmState=new DataMappingState(view.getPathEventSpace());
  GLElementContainer generalMapping=new GLElementContainer(new GLFlowLayout(false,10,new GLPadding(5)));
  GLElementContainer ddElements=new GLElementContainer(new GLFlowLayout(true,10,new GLPadding(5)));
  GLElementContainer stratElements=new GLElementContainer(new GLFlowLayout(true,10,new GLPadding(5)));
  generalMapping.add(ddElements);
  generalMapping.add(stratElements);
  pathwayDatasets=new GLElementContainer(new GLFlowLayout(true,10,new GLPadding(5)));
  addPerspectiveElements(stratElements);
  addDataDomainElements(ddElements);
  updatePathwayDatasets();
  this.add(generalMapping);
  this.add(pathwayDatasets);
}
Program: 57209
Project: 57209
Buggy source:
private APathwayPathRenderer addPath(List<List<PathwayVertexRep>> pathSegments){
  VerticalPathRenderer renderer=new VerticalPathRenderer(view,tablePerspectives);
  renderer.setUpdateStrategy(new FixedPathUpdateStrategy(renderer,eventSpace,isPathSelectionMode,this));
  renderer.pathwayPathEventSpace=eventSpace;
  renderer.setPathway(pathway);
  renderer.setBranchPathExtractionEventSpace(BRANCH_PATH_EVENTSPACE);
  renderer.setAllowBranchPathExtraction(true);
  renderer.setSizeConfig(PathSizeConfiguration.COMPACT);
  for (  VertexRepBasedContextMenuItem item : nodeContextMenuItems) {
    renderer.addVertexRepBasedContextMenuItem(item);
  }
  for (  Pair<VertexRepBasedEventFactory,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.setSizeConfig(PathSizeConfiguration.COMPACT);
  for (  VertexRepBasedContextMenuItem item : nodeContextMenuItems) {
    renderer.addVertexRepBasedContextMenuItem(item);
  }
  for (  Pair<VertexRepBasedEventFactory,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;
}
Program: 57210
Project: 57210
Buggy source:
/** 
 * @param renderer
 * @param pathwayPathEventSpace
 */
public FixedPathUpdateStrategy(APathwayPathRenderer renderer,String pathwayPathEventSpace,boolean isPathSelectionMode,ContextualPathsRenderer contextualPathsRenderer){
  super(renderer,pathwayPathEventSpace);
  this.isPathSelectionMode=isPathSelectionMode;
  this.contextualPathsRenderer=contextualPathsRenderer;
}

Fixed version (ground truth):
/** 
 * @param renderer
 * @param pathwayPathEventSpace
 */
public FixedPathUpdateStrategy(APathwayPathRenderer renderer,String pathwayPathEventSpace,boolean isPathSelectionMode,ContextualPathsRenderer contextualPathsRenderer,List<List<PathwayVertexRep>> selectedPathSegments){
  super(renderer,pathwayPathEventSpace);
  this.isPathSelectionMode=isPathSelectionMode;
  this.contextualPathsRenderer=contextualPathsRenderer;
  setSelectedPathSegments(selectedPathSegments);
}
Program: 57211
Project: 57211
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 (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);
      gl.glColor4f(1,1,1,0.9f);
      gl.glBegin(GL2.GL_QUADS);
      gl.glVertex3f(0,0,0.1f);
      gl.glVertex3f(x,0,0.1f);
      gl.glVertex3f(x,y,0.1f);
      gl.glVertex3f(0,y,0.1f);
      gl.glEnd();
    }
    renderEdges(gl,pathNodes);
    gl.glEndList();
    setLayoutDirty(false);
  }
  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 (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);
  }
  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: 57213
Project: 57213
Buggy source:
public void handlePathwayElementSelection(SelectionType selectionType,int externalID){
  setDisplayListDirty();
  if (vertexSelectionManager.getElements(SelectionType.SELECTION).size() == 1) {
    pathStartVertexRep=pathwayItemManager.getPathwayVertexRep((Integer)vertexSelectionManager.getElements(SelectionType.SELECTION).toArray()[0]);
  }
  vertexSelectionManager.clearSelection(selectionType);
  if (metaboliteSelectionManager.getNumberOfElements(selectionType) > 0) {
    metaboliteSelectionManager.clearSelection(selectionType);
    metaboliteSelectionManager.triggerSelectionUpdateEvent();
  }
  PathwayVertexRep vertexRep=pathwayItemManager.getPathwayVertexRep(externalID);
  if (vertexRep.getType() == EPathwayVertexType.compound) {
    metaboliteSelectionManager.addToType(selectionType,vertexRep.getName().hashCode());
    metaboliteSelectionManager.triggerSelectionUpdateEvent();
  }
  vertexSelectionManager.addToType(selectionType,vertexRep.getID());
  SelectionDelta selectionDelta=vertexSelectionManager.getDelta();
  if (isPathSelectionMode) {
    selectPath(vertexRep,selectionType);
    SelectionUpdateEvent event=new SelectionUpdateEvent();
    event.setSender(this);
    event.setSelectionDelta(selectionDelta);
    eventPublisher.triggerEvent(event);
  }
  ShowPortalNodesEvent e=new ShowPortalNodesEvent(vertexRep);
  e.setSender(this);
  e.setEventSpace(pathwayPathEventSpace);
  eventPublisher.triggerEvent(e);
  highlightPortalNodes(vertexRep);
}

Fixed version (ground truth):
public void handlePathwayElementSelection(SelectionType selectionType,int externalID){
  setDisplayListDirty();
  if (vertexSelectionManager.getElements(SelectionType.SELECTION).size() == 1) {
    pathStartVertexRep=pathwayItemManager.getPathwayVertexRep((Integer)vertexSelectionManager.getElements(SelectionType.SELECTION).toArray()[0]);
  }
  vertexSelectionManager.clearSelection(selectionType);
  if (metaboliteSelectionManager.getNumberOfElements(selectionType) > 0) {
    metaboliteSelectionManager.clearSelection(selectionType);
    metaboliteSelectionManager.triggerSelectionUpdateEvent();
  }
  PathwayVertexRep vertexRep=pathwayItemManager.getPathwayVertexRep(externalID);
  if (vertexRep.getType() == EPathwayVertexType.compound) {
    metaboliteSelectionManager.addToType(selectionType,vertexRep.getName().hashCode());
    metaboliteSelectionManager.triggerSelectionUpdateEvent();
  }
  vertexSelectionManager.addToType(selectionType,vertexRep.getID());
  SelectionDelta selectionDelta=vertexSelectionManager.getDelta();
  if (isPathSelectionMode) {
    selectPath(vertexRep,selectionType);
    SelectionUpdateEvent event=new SelectionUpdateEvent();
    event.setSender(this);
    event.setSelectionDelta(selectionDelta);
    eventPublisher.triggerEvent(event);
  }
  ShowPortalNodesEvent e=new ShowPortalNodesEvent(vertexRep);
  e.setSender(this);
  e.setEventSpace(pathwayPathEventSpace);
  eventPublisher.triggerEvent(e);
  portalVertexReps=PathwayManager.get().getEquivalentVertexRepsInPathway(vertexRep,pathway);
}
Program: 57216
Project: 57216
Buggy source:
public boolean hasChanged(){
  return after != null && !before.equals(after);
}

Fixed version (ground truth):
public boolean hasChanged(){
  return after != null && !before.equals(after) && !(!areValidBounds(after) && !areValidBounds(before));
}
Program: 57217
Project: 57217
Buggy source:
private void removeAnimationsOf(GLElement child,boolean checkLayoutAnimations){
  removeStyleAnimationsOf(child);
  if (checkLayoutAnimations) {
    for (Iterator<ALayoutAnimation> it=layoutAnimations.iterator(); it.hasNext(); )     if (it.next().getAnimatedElement() == child)     it.remove();
  }
}

Fixed version (ground truth):
protected final void removeAnimationsOf(GLElement child,boolean checkLayoutAnimations){
  removeStyleAnimationsOf(child);
  if (checkLayoutAnimations) {
    for (Iterator<ALayoutAnimation> it=layoutAnimations.iterator(); it.hasNext(); )     if (it.next().getAnimatedElement() == child)     it.remove();
  }
}
Program: 57218
Project: 57218
Buggy source:
public final void add(int index,GLElement child,IDuration duration,IInTransition animation){
  int startIn=0;
  if (child.getParent() == this) {
    int from=indexOf(child);
    if (from < index)     index--;
  }
  this.layoutAnimations.add(createInAnimation(child.layoutElement,startIn,duration,animation));
  setup(child);
  dirtyAnimation=true;
  if (startIn == 0)   children.add(index,child);
  animate();
}

Fixed version (ground truth):
public final void add(int index,GLElement child,IDuration duration,IInTransition animation){
  int startIn=0;
  if (child.getParent() == this) {
    int from=indexOf(child);
    if (from < index)     index--;
  }
  if (duration.getDuration() > 0)   this.layoutAnimations.add(createInAnimation(child.layoutElement,startIn,duration,animation));
  setup(child);
  dirtyAnimation=true;
  if (startIn == 0)   children.add(index,child);
  animate();
}
Program: 57219
Project: 57219
Buggy source:
@Override protected final void layout(){
  super.layout();
  Vec2f size=getSize();
  if (dirtyAnimation || forceLayout) {
    List<ALayoutAnimation> tmp=new LinkedList<>(layoutAnimations);
    Collection<GLElement> elems=asSeenIn(0);
    List<RecordingLayoutElement> l=new ArrayList<>(elems.size());
    for (    GLElement elem : elems) {
      if (elem.getVisibility() != EVisibility.NONE)       l.add(new RecordingLayoutElement(elem.layoutElement));
    }
    layout.doLayout(l,size.x(),size.y());
    outer:     for (    RecordingLayoutElement elem : l) {
      for (Iterator<ALayoutAnimation> ita=tmp.iterator(); ita.hasNext(); ) {
        ALayoutAnimation anim=ita.next();
        if (anim.getAnimated() == elem.wrappee) {
          anim.init(elem.before,elem.after);
          ita.remove();
          continue outer;
        }
      }
      if (elem.hasChanged()) {
        ALayoutAnimation anim=createMoveAnimation(elem.wrappee,elem.before,elem.after);
        layoutAnimations.add(anim);
      }
    }
  }
}

Fixed version (ground truth):
@Override protected final void layout(){
  super.layout();
  Vec2f size=getSize();
  if (dirtyAnimation || forceLayout) {
    Collection<GLElement> elems=asSeenIn(0);
    List<RecordingLayoutElement> l=new ArrayList<>(elems.size());
    for (    GLElement elem : elems) {
      if (elem.getVisibility() != EVisibility.NONE)       l.add(new RecordingLayoutElement(elem.layoutElement));
    }
    layout.doLayout(l,size.x(),size.y());
    List<ALayoutAnimation> tmp=new LinkedList<>(layoutAnimations);
    int i=0;
    outer:     for (    RecordingLayoutElement elem : l) {
      if (i == 61) {
        System.err.println();
      }
      for (Iterator<ALayoutAnimation> ita=tmp.iterator(); ita.hasNext(); ) {
        ALayoutAnimation anim=ita.next();
        if (anim.getAnimated() == elem.wrappee) {
          updateMoveAnimation(anim,elem.wrappee,elem.before,elem.after);
          ita.remove();
          continue outer;
        }
      }
      if (elem.hasChanged()) {
        ALayoutAnimation anim=createMoveAnimation(elem.wrappee,elem.before,elem.after);
        layoutAnimations.add(anim);
      }
      i++;
    }
  }
}
Program: 57220
Project: 57220
Buggy source:
protected final void removeStyleAnimationsOf(GLElement child){
  for (Iterator<StyleAnimation> it=styleAnimations.iterator(); it.hasNext(); )   if (it.next().getAnimatedElement() == child)   it.remove();
}

Fixed version (ground truth):
private void removeStyleAnimationsOf(GLElement child){
  for (Iterator<StyleAnimation> it=styleAnimations.iterator(); it.hasNext(); )   if (it.next().getAnimatedElement() == child)   it.remove();
}
Program: 57221
Project: 57221
Buggy source:
@Override protected void firstTime(float w,float h){
}

Fixed version (ground truth):
@Override protected void firstTime(float w,float h){
switch (type) {
case IN:
    break;
case MOVE:
case OUT:
  animated.setBounds(from);
break;
default :
break;
}
}
Program: 57222
Project: 57222
Buggy source:
@Override public void init(Vec4f from,Vec4f to){
  this.to=to;
}

Fixed version (ground truth):
@Override public void init(Vec4f from,Vec4f to){
  this.from=from;
  this.to=to;
}
Program: 57223
Project: 57223
Buggy source:
@Override protected void firstTime(float w,float h){
}

Fixed version (ground truth):
@Override protected void firstTime(float w,float h){
  animated.setBounds(from);
}
Program: 57224
Project: 57224
Buggy source:
public MoveAnimation(int startIn,IDuration duration,IGLLayoutElement animated,IMoveTransition animation){
  super(startIn,duration,animated);
  this.from=animated.getBounds();
  this.animation=animation;
}

Fixed version (ground truth):
public MoveAnimation(int startIn,IDuration duration,IGLLayoutElement animated,IMoveTransition animation){
  super(startIn,duration,animated);
  this.animation=animation;
}
Program: 57225
Project: 57225
Buggy source:
@Override public void layout(IRowSetter setter,float x,float w,int selectedIndex){
  float y=0;
  for (int r=0; r < offset; ++r)   setter.set(order[r],x,0,w,0,order[r] == selectedIndex);
  for (int i=unused.nextSetBit(0); i >= 0; i=unused.nextSetBit(i + 1)) {
    setter.set(i,x,h,w,0,i == selectedIndex);
  }
  for (int r=offset; r < (offset + numVisibles); ++r) {
    int rowIndex=order[r];
    float hr=rowHeight(base - r);
    setter.set(rowIndex,x,y,w,hr,rowIndex == selectedIndex);
    y+=hr;
  }
}

Fixed version (ground truth):
@Override public void layout(IRowSetter setter,float x,float w,int selectedIndex){
  float y=0;
  for (int r=0; r < offset; ++r)   setter.set(order[r],x,0,w,0,false);
  for (int i=unused.nextSetBit(0); i >= 0; i=unused.nextSetBit(i + 1)) {
    setter.set(i,x,h,w,0,false);
  }
  for (int r=offset; r < (offset + numVisibles); ++r) {
    int rowIndex=order[r];
    float hr=rowHeight(base - r);
    setter.set(rowIndex,x,y,w,hr,rowIndex == selectedIndex);
    y+=hr;
  }
}
Program: 57226
Project: 57226
Buggy source:
@Override public void layout(IRowSetter setter,float x,float w,int selectedIndex){
  float y=0;
  for (int r=0; r < offset; ++r)   setter.set(order[r],x,0,w,0,order[r] == selectedIndex);
  for (int i=unused.nextSetBit(0); i >= 0; i=unused.nextSetBit(i + 1)) {
    setter.set(i,x,h,w,0,i == selectedIndex);
  }
  for (int r=offset; r < (offset + numVisibles); ++r) {
    int rowIndex=order[r];
    float hr=ROW_HEIGHT;
    setter.set(rowIndex,x,y,w,hr,rowIndex == selectedIndex);
    y+=hr;
  }
}

Fixed version (ground truth):
@Override public void layout(IRowSetter setter,float x,float w,int selectedIndex){
  float y=0;
  for (int r=0; r < offset; ++r)   setter.set(order[r],x,0,w,0,false);
  for (int i=unused.nextSetBit(0); i >= 0; i=unused.nextSetBit(i + 1)) {
    setter.set(i,x,h,w,0,false);
  }
  for (int r=offset; r < (offset + numVisibles); ++r) {
    int rowIndex=order[r];
    float hr=ROW_HEIGHT;
    setter.set(rowIndex,x,y,w,hr,rowIndex == selectedIndex);
    y+=hr;
  }
}
Program: 57227
Project: 57227
Buggy source:
@Override public void set(int rowIndex,float x,float y,float w,float h,boolean pickable){
  int at=rowIndexToGlElement.get(rowIndex);
  if (h <= 0 && at >= 0) {
    before.set(rowIndex,y <= 0);
    rowIndexToGlElement.remove(rowIndex);
    inPool.set(at);
    IGLLayoutElement row=children.get(at);
    if (h > 0)     System.err.println();
    row.setBounds(x,y,w,h);
    ValueElement elem=(ValueElement)row.asElement();
    elem.setAnimationFlag(before.get(rowIndex) ? FLAG_FROM_ABOVE : FLAG_FROM_BELOW);
    elem.setVisibility(EVisibility.VISIBLE);
  }
 else   if (h <= 0) {
    before.set(rowIndex,y <= 0);
  }
 else   if (at < 0) {
    if (inPool.isEmpty()) {
    }
 else {
      at=inPool.length() - 1;
      inPool.clear(at);
      rowIndexToGlElement.put(rowIndex,at);
      IGLLayoutElement row=children.get(at);
      row.setBounds(x,y,w,h);
      ValueElement elem=(ValueElement)row.asElement();
      elem.setLayoutData(table.getDataItem(rowIndex));
      elem.setAnimationFlag(before.get(rowIndex) ? FLAG_FROM_ABOVE : FLAG_FROM_BELOW);
      elem.setVisibility(pickable ? EVisibility.PICKABLE : EVisibility.VISIBLE);
    }
  }
 else {
    if (at > children.size()) {
      System.err.println();
    }
    IGLLayoutElement row=children.get(at);
    row.setBounds(x,y,w,h);
    ValueElement elem=(ValueElement)row.asElement();
    elem.setAnimationFlag(FLAG_NONE);
    elem.setVisibility(pickable ? EVisibility.PICKABLE : EVisibility.VISIBLE);
  }
}

Fixed version (ground truth):
@Override public void set(int rowIndex,float x,float y,float w,float h,boolean pickable){
  int at=rowIndexToGlElement.get(rowIndex);
  if (h <= 0 && at >= 0) {
    before.set(rowIndex,y <= 0);
    rowIndexToGlElement.remove(rowIndex);
    inPool.set(at);
    IGLLayoutElement row=children.get(at);
    row.setBounds(x,y,w,h);
    ValueElement elem=(ValueElement)row.asElement();
    elem.setAnimationFlag(before.get(rowIndex) ? FLAG_TO_ABOVE : FLAG_TO_BELOW);
    elem.setVisibility(EVisibility.VISIBLE);
  }
 else   if (h <= 0) {
    before.set(rowIndex,y <= 0);
  }
 else   if (at < 0) {
    if (inPool.isEmpty()) {
    }
 else {
      at=inPool.nextSetBit(0);
      inPool.clear(at);
      rowIndexToGlElement.put(rowIndex,at);
      if (rowIndex == 20)       System.err.println();
      IGLLayoutElement row=children.get(at);
      row.setBounds(x,y,w,h);
      ValueElement elem=(ValueElement)row.asElement();
      removeAnimationsOf(elem,true);
      elem.setRow(table.getDataItem(rowIndex));
      elem.setAnimationFlag(before.get(rowIndex) ? FLAG_FROM_ABOVE : FLAG_FROM_BELOW);
      elem.setVisibility(pickable ? EVisibility.PICKABLE : EVisibility.VISIBLE);
    }
  }
 else {
    IGLLayoutElement row=children.get(at);
    row.setBounds(x,y,w,h);
    ValueElement elem=(ValueElement)row.asElement();
    elem.setAnimationFlag(FLAG_NONE);
    elem.setVisibility(pickable ? EVisibility.PICKABLE : EVisibility.VISIBLE);
  }
}
Program: 57228
Project: 57228
Buggy source:
@Override public final void checkLayout(){
  int rows=getColumnParent().getNumVisibleRows(model);
  int cached=this.size();
  if (cached < rows) {
    int addItems=Math.min(20,rows - cached);
    for (int i=0; i < addItems; ++i)     add(createPoolItem(),Durations.NO);
    inPool.set(cached,cached + addItems);
  }
 else   if ((cached - rows) > 50 && inPool.cardinality() > 20) {
    int at=cached - 1;
    for (int toRemove=(inPool.cardinality() - 20); toRemove >= 0; toRemove--) {
      while (!inPool.get(at)) {
        GLElement replacement=get(at);
        int index=replacement.getLayoutDataAs(IRow.class,null).getIndex();
        rowIndexToGlElement.put(index,at - toRemove - 1);
        at--;
      }
      remove(get(at),Durations.NO);
      inPool.clear(at);
      at--;
    }
  }
  super.checkLayout();
}

Fixed version (ground truth):
@Override public final void checkLayout(){
  int rows=getColumnParent().getNumVisibleRows(model);
  int cached=this.size();
  if (cached < rows) {
    int addItems=Math.min(20,rows - cached);
    for (int i=0; i < addItems; ++i)     add(createPoolItem(),Durations.NO);
    inPool.set(cached,cached + addItems);
  }
 else   if ((cached - rows) > 50 && inPool.cardinality() > 20) {
    int at=cached - 1;
    final int itemsToRemove=Math.max(0,cached - (cached - rows) - 20);
    for (int toRemove=itemsToRemove; toRemove > 0; toRemove--) {
      while (!inPool.get(at)) {
        GLElement replacement=get(at);
        int index=replacement.getLayoutDataAs(IRow.class,null).getIndex();
        rowIndexToGlElement.put(index,at - toRemove - 1);
        at--;
      }
      remove(get(at).setVisibility(EVisibility.HIDDEN),Durations.NO);
      inPool.clear(at);
      at--;
    }
  }
  super.checkLayout();
}
Program: 57229
Project: 57229
Buggy source:
@Override protected ALayoutAnimation createMoveAnimation(IGLLayoutElement elem,Vec4f before,Vec4f after){
  if (getColumnParent().getRanker(model).isInternalReLayout()) {
    DummyAnimation d=new DummyAnimation(EAnimationType.MOVE,elem);
    d.init(before,after);
    return d;
  }
  return super.createMoveAnimation(elem,before,after);
}

Fixed version (ground truth):
@Override protected ALayoutAnimation createMoveAnimation(IGLLayoutElement elem,Vec4f before,Vec4f after){
  int flag=((ValueElement)elem.asElement()).getAnimationFlag();
switch (flag) {
case FLAG_NONE:
    break;
case FLAG_FROM_ABOVE:
  before=before.copy();
before.setY(0);
before.setW(0);
break;
case FLAG_FROM_BELOW:
before=before.copy();
before.setY(getSize().y());
before.setW(0);
break;
case FLAG_TO_ABOVE:
after=after.copy();
after.setY(0);
after.setW(0);
break;
case FLAG_TO_BELOW:
after=after.copy();
after.setY(getSize().y());
after.setW(0);
break;
}
if (getColumnParent().getRanker(model).isInternalReLayout()) {
DummyAnimation d=new DummyAnimation(EAnimationType.MOVE,elem);
d.init(before,after);
return d;
}
return super.createMoveAnimation(elem,before,after);
}
Program: 57231
Project: 57231
Buggy source:
@Override protected ALayoutAnimation createMoveAnimation(IGLLayoutElement elem,Vec4f before,Vec4f after){
  if (areValidBounds(after)) {
    OrderColumnUI ranker=getColumnParent().getRanker(model);
    IRow row=elem.getLayoutDataAs(IRow.class,null);
    int delta=ranker.getRankDelta(row);
    if (delta != 0 && delta != Integer.MAX_VALUE) {
      removeStyleAnimationsOf(elem.asElement());
      animate(elem.asElement(),RenderStyle.hightlightAnimationDuration(delta),ColorTransition.get(delta));
    }
  }
  return super.createMoveAnimation(elem,before,after);
}

Fixed version (ground truth):
@Override protected ALayoutAnimation createMoveAnimation(IGLLayoutElement elem,Vec4f before,Vec4f after){
  if (areValidBounds(after)) {
    OrderColumnUI ranker=getColumnParent().getRanker(model);
    IRow row=elem.getLayoutDataAs(IRow.class,null);
    int delta=ranker.getRankDelta(row);
    if (delta != 0 && delta != Integer.MAX_VALUE) {
      removeAnimationsOf(elem.asElement(),false);
      animate(elem.asElement(),RenderStyle.hightlightAnimationDuration(delta),ColorTransition.get(delta));
    }
  }
  return super.createMoveAnimation(elem,before,after);
}
Program: 57232
Project: 57232
Buggy source:
/** 
 * returns the row represented by this element of this column
 * @return
 */
protected final IRow getRow(){
  return getLayoutDataAs(IRow.class,null);
}

Fixed version (ground truth):
/** 
 * returns the row represented by this element of this column
 * @return
 */
protected final IRow getRow(){
  return row;
}
Program: 57233
Project: 57233
Buggy source:
public APathwayPathRenderer(AGLView view,List<TablePerspective> tablePerspectives){
  this.view=view;
  this.tablePerspectives=tablePerspectives;
  this.pixelGLConverter=view.getPixelGLConverter();
  this.textRenderer=new CaleydoTextRenderer(24);
  geneSelectionManager=new EventBasedSelectionManager(this,IDType.getIDType("String_Node_Str"));
  geneSelectionManager.registerEventListeners();
  metaboliteSelectionManager=new EventBasedSelectionManager(this,IDType.getIDType("String_Node_Str"));
  metaboliteSelectionManager.registerEventListeners();
  List<GeneticDataDomain> dataDomains=DataDomainManager.get().getDataDomainsByType(GeneticDataDomain.class);
  if (dataDomains.size() != 0) {
    IDType sampleIDType=dataDomains.get(0).getSampleIDType().getIDCategory().getPrimaryMappingType();
    sampleSelectionManager=new EventBasedSelectionManager(this,sampleIDType);
    sampleSelectionManager.registerEventListeners();
  }
}

Fixed version (ground truth):
public APathwayPathRenderer(AGLView view,List<TablePerspective> tablePerspectives){
  this.view=view;
  this.tablePerspectives=tablePerspectives;
  this.pixelGLConverter=view.getPixelGLConverter();
  this.textRenderer=view.getTextRenderer();
  geneSelectionManager=new EventBasedSelectionManager(this,IDType.getIDType("String_Node_Str"));
  geneSelectionManager.registerEventListeners();
  metaboliteSelectionManager=new EventBasedSelectionManager(this,IDType.getIDType("String_Node_Str"));
  metaboliteSelectionManager.registerEventListeners();
  List<GeneticDataDomain> dataDomains=DataDomainManager.get().getDataDomainsByType(GeneticDataDomain.class);
  if (dataDomains.size() != 0) {
    IDType sampleIDType=dataDomains.get(0).getSampleIDType().getIDCategory().getPrimaryMappingType();
    sampleSelectionManager=new EventBasedSelectionManager(this,sampleIDType);
    sampleSelectionManager.registerEventListeners();
  }
}
Program: 57235
Project: 57235
Buggy source:
@Override public void display(GL2 gl){
  boolean updateAugmentation=false;
  if (isLayoutDirty)   updateAugmentation=true;
  super.display(gl);
  if (updateAugmentation)   updatePathLinks();
}

Fixed version (ground truth):
@Override public void display(GL2 gl){
  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)   updatePathLinks();
}
Program: 57237
Project: 57237
Buggy source:
/** 
 * Returns all elements that are in a specific selection type
 * @param sSelectionType
 * @return the elements in the type. Null if the type does not exist yet or if no elements are contained for thistype. Note that no normal types are contained at any time.
 */
public synchronized Set<Integer> getElements(SelectionType selectionType){
  if (hashSelectionTypes.containsKey(selectionType))   return hashSelectionTypes.get(selectionType).keySet();
  return null;
}

Fixed version (ground truth):
/** 
 * Returns all elements that are in a specific selection type
 * @param sSelectionType
 * @return the elements in the type. Null if the type does not exist yet or if no elements are contained for thistype. Note that no normal types are contained at any time.
 */
public synchronized Set<Integer> getElements(SelectionType selectionType){
  if (hashSelectionTypes.containsKey(selectionType))   return new HashSet<>(hashSelectionTypes.get(selectionType).keySet());
  return null;
}
Program: 57238
Project: 57238
Buggy source:
protected void renderAdapter(GLGraphics g,float w,float h){
  if (viewFrustum.getRight() != w || viewFrustum.getTop() != h) {
    viewFrustum.setRight(w);
    viewFrustum.setTop(h);
    layout.updateLayout();
  }
  g.save();
  final GL2 gl=g.gl;
  gl.glTranslatef(0,0,g.z());
  gl.glTranslatef(0,h,0);
  gl.glScalef(1,-1,1);
  g.checkError();
  layout.render(gl);
  g.checkError();
  g.restore();
}

Fixed version (ground truth):
protected void renderAdapter(GLGraphics g,float w,float h){
  if (viewFrustum.getRight() != w || viewFrustum.getTop() != h) {
    viewFrustum.setRight(w);
    viewFrustum.setTop(h);
    layout.updateLayout();
  }
  g.save();
  final GL2 gl=g.gl;
  gl.glTranslatef(0,h,g.z());
  gl.glScalef(1,-1,1);
  g.checkError();
  layout.render(gl);
  g.checkError();
  g.restore();
}
Program: 57239
Project: 57239
Buggy source:
public void removeDataDomain(ATableBasedDataDomain dd){
  if (!hashDDToTablePerspective.containsKey(dd))   return;
  AEvent event=new RemoveTablePerspectiveEvent(hashDDToTablePerspective.get(dd));
  event.setEventSpace(eventSpace);
  event.setSender(this);
  EventPublisher.publishEvent(event);
  hashDDToTablePerspective.remove(dd);
  mappedTablePerspectives.remove(dd);
}

Fixed version (ground truth):
public void removeDataDomain(ATableBasedDataDomain dd){
  if (!hashDDToTablePerspective.containsKey(dd))   return;
  AEvent event=new RemoveTablePerspectiveEvent(hashDDToTablePerspective.get(dd));
  event.setEventSpace(eventSpace);
  event.setSender(this);
  EventPublisher.publishEvent(event);
  mappedTablePerspectives.remove(hashDDToTablePerspective.get(dd));
  hashDDToTablePerspective.remove(dd);
}
Program: 57240
Project: 57240
Buggy source:
private void addPerspectiveElements(GLElementContainer stratElements){
  stratElements.add(new GLElement(){
    @Override protected void renderImpl(    GLGraphics g,    float w,    float h){
      g.drawText("String_Node_Str",0,-2,w,h);
    }
  }
.setSize(100,15));
  ATableBasedDataDomain mRNAdd=null;
  for (  ATableBasedDataDomain dd : DataDomainManager.get().getDataDomainsByType(ATableBasedDataDomain.class)) {
    if (dd.getLabel().equals("String_Node_Str")) {
      mRNAdd=dd;
      break;
    }
  }
  if (mRNAdd == null)   return;
  RadioController radio=new RadioController(this);
  for (  String recordPerspectiveIDs : mRNAdd.getRecordPerspectiveIDs()) {
    PerspectiveElement perspective=new PerspectiveElement(mRNAdd.getTable().getRecordPerspective(recordPerspectiveIDs),dmState);
    stratElements.add(perspective);
    radio.add(perspective);
  }
  dmState.setPerspective(mRNAdd.getTable().getDefaultRecordPerspective());
  dmState.addDataDomain(mRNAdd);
}

Fixed version (ground truth):
private void addPerspectiveElements(GLElementContainer stratElements){
  stratElements.add(new GLElement(){
    @Override protected void renderImpl(    GLGraphics g,    float w,    float h){
      g.drawText("String_Node_Str",0,-2,w,h);
    }
  }
.setSize(100,15));
  ATableBasedDataDomain mRNAdd=null;
  for (  ATableBasedDataDomain dd : DataDomainManager.get().getDataDomainsByType(ATableBasedDataDomain.class)) {
    if (dd.getLabel().equals("String_Node_Str")) {
      mRNAdd=dd;
      break;
    }
  }
  if (mRNAdd == null)   return;
  RadioController radio=new RadioController(this);
  for (  String recordPerspectiveIDs : mRNAdd.getRecordPerspectiveIDs()) {
    PerspectiveElement perspective=new PerspectiveElement(mRNAdd.getTable().getRecordPerspective(recordPerspectiveIDs),dmState);
    stratElements.add(perspective);
    radio.add(perspective);
  }
  dmState.setPerspective(mRNAdd.getTable().getDefaultRecordPerspective());
}