nus-yam/ex-repair huggingface dataset:
Program: 58900
Project: 58900
Buggy source:
/** 
 * Reacts on the elements of the reaction substrate tag. An example reaction substrate tag looks like this: <substrate name="cpd:C01118"/>
 */
protected void handleReactionSubstrateTag(){
  String sReactionSubstrateName="String_Node_Str";
  for (int iAttributeIndex=0; iAttributeIndex < attributes.getLength(); iAttributeIndex++) {
    sAttributeName=attributes.getLocalName(iAttributeIndex);
    if ("String_Node_Str".equals(sAttributeName)) {
      sAttributeName=attributes.getQName(iAttributeIndex);
    }
    if (sAttributeName.equals("String_Node_Str")) {
      sReactionSubstrateName=attributes.getValue(iAttributeIndex);
    }
  }
  IGraphItem graphItemIn=hashKgmlNameToVertexRepId.get(sReactionSubstrateName);
  IGraphItem graphItemOut=hashKgmlReactionIdToVertexRepId.get(((PathwayReactionEdgeGraphItem)currentReactionSubstrateEdgeRep.getAllItemsByProp(EGraphItemProperty.ALIAS_PARENT).get(0)).getReactionId());
  if (graphItemIn == null || graphItemOut == null)   return;
  currentReactionSubstrateEdgeRep.addItemDoubleLinked(graphItemIn,EGraphItemProperty.INCOMING);
  currentReactionSubstrateEdgeRep.addItemDoubleLinked(graphItemOut,EGraphItemProperty.OUTGOING);
  IGraphItem tmpReactionEdge=(PathwayReactionEdgeGraphItem)currentReactionSubstrateEdgeRep.getAllItemsByProp(EGraphItemProperty.ALIAS_PARENT).get(0);
  if (tmpReactionEdge == null)   return;
  if (graphItemIn.getAllItemsByProp(EGraphItemProperty.ALIAS_PARENT).size() == 0)   return;
  tmpReactionEdge.addItemDoubleLinked(graphItemIn.getAllItemsByProp(EGraphItemProperty.ALIAS_PARENT).get(0),EGraphItemProperty.INCOMING);
  if (graphItemOut.getAllItemsByProp(EGraphItemProperty.ALIAS_PARENT).size() == 0)   return;
  tmpReactionEdge.addItemDoubleLinked((IGraphItem)graphItemOut.getAllItemsByProp(EGraphItemProperty.ALIAS_PARENT).get(0),EGraphItemProperty.OUTGOING);
}

Fixed version (ground truth):
/** 
 * Reacts on the elements of the reaction substrate tag. An example reaction substrate tag looks like this: <substrate name="cpd:C01118"/>
 */
protected void handleReactionSubstrateTag(){
}
Program: 58901
Project: 58901
Buggy source:
/** 
 * Constructor.
 */
public KgmlSaxHandler(){
  super();
  hashKgmlEntryIdToVertexRepId=new HashMap<Integer,IGraphItem>();
  hashKgmlNameToVertexRepId=new HashMap<String,IGraphItem>();
  hashKgmlReactionIdToVertexRepId=new HashMap<String,IGraphItem>();
  pathwayItemManager=generalManager.getPathwayItemManager();
  pathwayManager=generalManager.getPathwayManager();
  alCurrentVertex=new ArrayList<IGraphItem>();
  setXmlActivationTag("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Constructor.
 */
public KgmlSaxHandler(){
  super();
  pathwayItemManager=generalManager.getPathwayItemManager();
  pathwayManager=generalManager.getPathwayManager();
  alCurrentVertex=new ArrayList<IGraphItem>();
  setXmlActivationTag("String_Node_Str");
}
Program: 58902
Project: 58902
Buggy source:
/** 
 * @see org.caleydo.core.parser.handler.IXmlParserHandler#destroyHandler()
 * @see org.caleydo.core.parser.handler.AXmlParserHandler#destroyHandler()
 */
@Override public void destroyHandler(){
  super.destroyHandler();
  hashKgmlEntryIdToVertexRepId.clear();
  hashKgmlNameToVertexRepId.clear();
  hashKgmlReactionIdToVertexRepId.clear();
}

Fixed version (ground truth):
/** 
 * @see org.caleydo.core.parser.handler.IXmlParserHandler#destroyHandler()
 * @see org.caleydo.core.parser.handler.AXmlParserHandler#destroyHandler()
 */
@Override public void destroyHandler(){
  super.destroyHandler();
}
Program: 58904
Project: 58904
Buggy source:
/** 
 * Reacts on the elements of the reaction product tag. An example reaction product tag looks like this: <product name="cpd:C02291"/>
 */
protected void handleReactionProductTag(){
  String sReactionProductName="String_Node_Str";
  for (int iAttributeIndex=0; iAttributeIndex < attributes.getLength(); iAttributeIndex++) {
    sAttributeName=attributes.getLocalName(iAttributeIndex);
    if ("String_Node_Str".equals(sAttributeName)) {
      sAttributeName=attributes.getQName(iAttributeIndex);
    }
    if (sAttributeName.equals("String_Node_Str")) {
      sReactionProductName=attributes.getValue(iAttributeIndex);
    }
  }
  IGraphItem graphItemOut=hashKgmlNameToVertexRepId.get(sReactionProductName);
  IGraphItem graphItemIn=hashKgmlReactionIdToVertexRepId.get(((PathwayReactionEdgeGraphItem)currentReactionProductEdgeRep.getAllItemsByProp(EGraphItemProperty.ALIAS_PARENT).get(0)).getReactionId());
  if (graphItemIn == null || graphItemOut == null)   return;
  currentReactionProductEdgeRep.addItemDoubleLinked(graphItemIn,EGraphItemProperty.INCOMING);
  currentReactionProductEdgeRep.addItemDoubleLinked(graphItemOut,EGraphItemProperty.OUTGOING);
  IGraphItem tmpReactionEdge=(PathwayReactionEdgeGraphItem)currentReactionProductEdgeRep.getAllItemsByProp(EGraphItemProperty.ALIAS_PARENT).get(0);
  if (tmpReactionEdge == null)   return;
  if (graphItemIn.getAllItemsByProp(EGraphItemProperty.ALIAS_PARENT).size() == 0)   return;
  tmpReactionEdge.addItemDoubleLinked((IGraphItem)graphItemIn.getAllItemsByProp(EGraphItemProperty.ALIAS_PARENT).get(0),EGraphItemProperty.INCOMING);
  if (graphItemOut.getAllItemsByProp(EGraphItemProperty.ALIAS_PARENT).size() == 0)   return;
  tmpReactionEdge.addItemDoubleLinked((IGraphItem)graphItemOut.getAllItemsByProp(EGraphItemProperty.ALIAS_PARENT).get(0),EGraphItemProperty.OUTGOING);
}

Fixed version (ground truth):
/** 
 * Reacts on the elements of the reaction product tag. An example reaction product tag looks like this: <product name="cpd:C02291"/>
 */
protected void handleReactionProductTag(){
}
Program: 58905
Project: 58905
Buggy source:
/** 
 * Reacts on the elements of the relation tag. An example relation tag looks like this: <relation entry1="28" entry2="32" type="ECrel">
 */
protected void handleRelationTag(){
  int iSourceVertexId=0;
  int iTargetVertexId=0;
  String sType="String_Node_Str";
  for (int iAttributeIndex=0; iAttributeIndex < attributes.getLength(); iAttributeIndex++) {
    sAttributeName=attributes.getLocalName(iAttributeIndex);
    if ("String_Node_Str".equals(sAttributeName)) {
      sAttributeName=attributes.getQName(iAttributeIndex);
    }
    if (sAttributeName.equals("String_Node_Str")) {
      sType=attributes.getValue(iAttributeIndex);
    }
 else     if (sAttributeName.equals("String_Node_Str")) {
      iSourceVertexId=Integer.valueOf(attributes.getValue(iAttributeIndex)).intValue();
    }
 else     if (sAttributeName.equals("String_Node_Str")) {
      iTargetVertexId=Integer.valueOf(attributes.getValue(iAttributeIndex)).intValue();
    }
  }
  IGraphItem graphItemIn=hashKgmlEntryIdToVertexRepId.get(iSourceVertexId);
  IGraphItem graphItemOut=hashKgmlEntryIdToVertexRepId.get(iTargetVertexId);
  IGraphItem relationEdge=pathwayItemManager.createRelationEdge(((PathwayVertexGraphItemRep)graphItemIn).getAllItemsByProp(EGraphItemProperty.ALIAS_PARENT),((PathwayVertexGraphItemRep)graphItemOut).getAllItemsByProp(EGraphItemProperty.ALIAS_PARENT),sType);
  pathwayItemManager.createRelationEdgeRep(currentPathway,relationEdge,graphItemIn,graphItemOut);
}

Fixed version (ground truth):
/** 
 * Reacts on the elements of the relation tag. An example relation tag looks like this: <relation entry1="28" entry2="32" type="ECrel">
 */
protected void handleRelationTag(){
  int iSourceVertexId=0;
  int iTargetVertexId=0;
  String sType="String_Node_Str";
  for (int iAttributeIndex=0; iAttributeIndex < attributes.getLength(); iAttributeIndex++) {
    sAttributeName=attributes.getLocalName(iAttributeIndex);
    if ("String_Node_Str".equals(sAttributeName)) {
      sAttributeName=attributes.getQName(iAttributeIndex);
    }
    if (sAttributeName.equals("String_Node_Str")) {
      sType=attributes.getValue(iAttributeIndex);
    }
 else     if (sAttributeName.equals("String_Node_Str")) {
      iSourceVertexId=Integer.valueOf(attributes.getValue(iAttributeIndex)).intValue();
    }
 else     if (sAttributeName.equals("String_Node_Str")) {
      iTargetVertexId=Integer.valueOf(attributes.getValue(iAttributeIndex)).intValue();
    }
  }
}
Program: 58906
Project: 58906
Buggy source:
/** 
 * draws the toolbar items within the views default toolbar (inline)
 * @param viewPart view to add the toolbar items
 */
private void drawInlineToolBar(CaleydoViewPart viewPart){
  List<Integer> viewIDs=getAllViewIDs(viewPart);
  ToolBarContentFactory contentFactory=ToolBarContentFactory.get();
  List<AToolBarContent> toolBarContents=contentFactory.getToolBarContent(viewIDs);
  final IToolBarManager toolBarManager=viewPart.getViewSite().getActionBars().getToolBarManager();
  for (  AToolBarContent toolBarContent : toolBarContents) {
    for (    ToolBarContainer container : toolBarContent.getInlineToolBar()) {
      for (      IToolBarItem item : container.getToolBarItems()) {
        if (item instanceof IAction) {
          toolBarManager.add((IAction)item);
        }
 else         if (item instanceof ControlContribution) {
          toolBarManager.add((ControlContribution)item);
        }
      }
      toolBarManager.add(new Separator());
    }
  }
  toolBarManager.update(true);
}

Fixed version (ground truth):
/** 
 * draws the toolbar items within the views default toolbar (inline)
 * @param viewPart view to add the toolbar items
 */
private void drawInlineToolBar(CaleydoViewPart viewPart){
  List<Integer> viewIDs=getAllViewIDs(viewPart);
  ToolBarContentFactory contentFactory=ToolBarContentFactory.get();
  List<AToolBarContent> toolBarContents=contentFactory.getToolBarContent(viewIDs);
  final IToolBarManager toolBarManager=viewPart.getViewSite().getActionBars().getToolBarManager();
  toolBarManager.removeAll();
  for (  AToolBarContent toolBarContent : toolBarContents) {
    for (    ToolBarContainer container : toolBarContent.getInlineToolBar()) {
      for (      IToolBarItem item : container.getToolBarItems()) {
        if (item instanceof IAction) {
          toolBarManager.add((IAction)item);
        }
 else         if (item instanceof ControlContribution) {
          toolBarManager.add((ControlContribution)item);
        }
      }
      toolBarManager.add(new Separator());
    }
  }
  toolBarManager.update(true);
}
Program: 58908
Project: 58908
Buggy source:
public void run(){
  for (  Group group : viewSpecificGroups) {
    for (    Control subControl : group.getChildren()) {
      if (subControl instanceof Label) {
        if (group.getData("String_Node_Str") != null && ((Integer)group.getData("String_Node_Str")).intValue() == iViewID || eventTrigger instanceof GLPathway && group.getData("String_Node_Str") == GLPathwayView.ID) {
          ((Label)subControl).setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GRAY));
        }
 else {
          ((Label)subControl).setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_GRAY));
        }
      }
    }
  }
}

Fixed version (ground truth):
public void run(){
  for (  Group group : viewSpecificGroups) {
    for (    Control subControl : group.getChildren()) {
      if (subControl instanceof Label && subControl.getData() == group) {
        if (group.getData("String_Node_Str") != null && ((Integer)group.getData("String_Node_Str")).intValue() == iViewID || eventTrigger instanceof GLPathway && group.getData("String_Node_Str") == GLPathwayView.ID) {
          ((Label)subControl).setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GRAY));
        }
 else {
          ((Label)subControl).setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_GREEN));
        }
      }
    }
  }
}
Program: 58909
Project: 58909
Buggy source:
@Override public void handleExternalEvent(final IMediatorSender eventTrigger,IEventContainer eventContainer,EMediatorType eMediatorType){
  if (eventTrigger instanceof AGLEventListener) {
    final int iViewID=((AGLEventListener)eventTrigger).getID();
    parentComposite.getDisplay().asyncExec(new Runnable(){
      public void run(){
        for (        Group group : viewSpecificGroups) {
          for (          Control subControl : group.getChildren()) {
            if (subControl instanceof Label) {
              if (group.getData("String_Node_Str") != null && ((Integer)group.getData("String_Node_Str")).intValue() == iViewID || eventTrigger instanceof GLPathway && group.getData("String_Node_Str") == GLPathwayView.ID) {
                ((Label)subControl).setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GRAY));
              }
 else {
                ((Label)subControl).setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_GRAY));
              }
            }
          }
        }
      }
    }
);
  }
}

Fixed version (ground truth):
@Override public void handleExternalEvent(final IMediatorSender eventTrigger,IEventContainer eventContainer,EMediatorType eMediatorType){
  if (eventTrigger instanceof AGLEventListener) {
    final int iViewID=((AGLEventListener)eventTrigger).getID();
    parentComposite.getDisplay().asyncExec(new Runnable(){
      public void run(){
        for (        Group group : viewSpecificGroups) {
          for (          Control subControl : group.getChildren()) {
            if (subControl instanceof Label && subControl.getData() == group) {
              if (group.getData("String_Node_Str") != null && ((Integer)group.getData("String_Node_Str")).intValue() == iViewID || eventTrigger instanceof GLPathway && group.getData("String_Node_Str") == GLPathwayView.ID) {
                ((Label)subControl).setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GRAY));
              }
 else {
                ((Label)subControl).setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_GREEN));
              }
            }
          }
        }
      }
    }
);
  }
}
Program: 58910
Project: 58910
Buggy source:
/** 
 * Creates and initializes a new view based on its serialized form. The view is already added to the list of event receivers and senders.
 * @param gl
 * @param serView serialized form of the view to create
 * @return the created view ready to be used within the application
 */
private AGLEventListener createView(GL gl,ASerializedView serView){
  ArrayList<Integer> iAlSetIDs=new ArrayList<Integer>();
  for (  ISet tmpSet : alSets) {
    if (tmpSet.getSetType() != ESetType.GENE_EXPRESSION_DATA)     continue;
    iAlSetIDs.add(tmpSet.getID());
  }
  ICommandManager cm=generalManager.getCommandManager();
  ECommandType cmdType=serView.getCreationCommandType();
  CmdCreateGLEventListener cmdView=(CmdCreateGLEventListener)cm.createCommandByType(cmdType);
  cmdView.setAttributesFromSerializedForm(serView);
  cmdView.setSetIDs(iAlSetIDs);
  cmdView.doCommand();
  AGLEventListener glView=cmdView.getCreatedObject();
  IEventPublisher eventPublisher=generalManager.getEventPublisher();
  eventPublisher.addSender(EMediatorType.SELECTION_MEDIATOR,(IMediatorSender)glView);
  eventPublisher.addReceiver(EMediatorType.SELECTION_MEDIATOR,(IMediatorReceiver)glView);
  triggerMostRecentDelta();
  return glView;
}

Fixed version (ground truth):
/** 
 * Creates and initializes a new view based on its serialized form. The view is already added to the list of event receivers and senders.
 * @param gl
 * @param serView serialized form of the view to create
 * @return the created view ready to be used within the application
 */
private AGLEventListener createView(GL gl,ASerializedView serView){
  ArrayList<Integer> iAlSetIDs=new ArrayList<Integer>();
  for (  ISet tmpSet : alSets) {
    if (tmpSet.getSetType() != ESetType.GENE_EXPRESSION_DATA)     continue;
    iAlSetIDs.add(tmpSet.getID());
  }
  ICommandManager cm=generalManager.getCommandManager();
  ECommandType cmdType=serView.getCreationCommandType();
  CmdCreateGLEventListener cmdView=(CmdCreateGLEventListener)cm.createCommandByType(cmdType);
  cmdView.setAttributesFromSerializedForm(serView);
  cmdView.setSetIDs(iAlSetIDs);
  cmdView.doCommand();
  AGLEventListener glView=cmdView.getCreatedObject();
  if (glView instanceof GLPathway) {
    initializePathwayView((GLPathway)glView);
  }
  IEventPublisher eventPublisher=generalManager.getEventPublisher();
  eventPublisher.addSender(EMediatorType.SELECTION_MEDIATOR,(IMediatorSender)glView);
  eventPublisher.addReceiver(EMediatorType.SELECTION_MEDIATOR,(IMediatorReceiver)glView);
  triggerMostRecentDelta();
  return glView;
}
Program: 58911
Project: 58911
Buggy source:
/** 
 * removes all inline toolbar items
 * @param viewPart view to remove the toolbar items from
 */
private void removeInlineToolBar(AGLViewPart viewPart){
  final IToolBarManager toolBarManager=viewPart.getViewSite().getActionBars().getToolBarManager();
  toolBarManager.removeAll();
  toolBarManager.update(true);
}

Fixed version (ground truth):
/** 
 * removes all inline toolbar items
 * @param viewPart view to remove the toolbar items from
 */
private void removeInlineToolBar(CaleydoViewPart viewPart){
  final IToolBarManager toolBarManager=viewPart.getViewSite().getActionBars().getToolBarManager();
  toolBarManager.removeAll();
  toolBarManager.update(true);
}
Program: 58912
Project: 58912
Buggy source:
@Override public void partVisible(IWorkbenchPartReference partRef){
  IWorkbenchPart activePart=partRef.getPart(false);
  if (!(activePart instanceof CaleydoViewPart)) {
    return;
  }
  CaleydoViewPart viewPart=(CaleydoViewPart)activePart;
  viewPart.setAttached(isViewAttached(viewPart));
  log.info("String_Node_Str" + viewPart);
  if (viewPart instanceof AGLViewPart) {
    GeneralManager.get().getViewGLCanvasManager().registerGLCanvasToAnimator(((AGLViewPart)viewPart).getGLCanvas().getID());
  }
  if (!activePart.getSite().getShell().getText().equals("String_Node_Str")) {
    if (viewPart instanceof CaleydoViewPart) {
      drawInlineToolBar(viewPart);
      removeViewSpecificToolBarItems();
    }
  }
 else {
    if (viewPart instanceof AGLViewPart) {
      removeInlineToolBar((AGLViewPart)viewPart);
      sendViewActivationEvent(viewPart);
    }
  }
}

Fixed version (ground truth):
@Override public void partVisible(IWorkbenchPartReference partRef){
  IWorkbenchPart activePart=partRef.getPart(false);
  if (!(activePart instanceof CaleydoViewPart)) {
    return;
  }
  CaleydoViewPart viewPart=(CaleydoViewPart)activePart;
  viewPart.setAttached(isViewAttached(viewPart));
  log.info("String_Node_Str" + viewPart);
  if (viewPart instanceof AGLViewPart) {
    GeneralManager.get().getViewGLCanvasManager().registerGLCanvasToAnimator(((AGLViewPart)viewPart).getGLCanvas().getID());
  }
  if (!activePart.getSite().getShell().getText().equals("String_Node_Str")) {
    drawInlineToolBar(viewPart);
    removeViewSpecificToolBarItems();
  }
 else {
    removeInlineToolBar((CaleydoViewPart)viewPart);
    sendViewActivationEvent(viewPart);
  }
}
Program: 58913
Project: 58913
Buggy source:
/** 
 * Reads the file and counts the numbers of lines to be read.
 */
protected final int computeNumberOfLinesInFile(String sFileName) throws IOException {
  int iCountLinesToBeRead=0;
  int iCountLines=0;
  try {
    BufferedReader brFile=GeneralManager.get().getResourceLoader().getResource(sFileName);
    while (brFile.readLine() != null && iCountLines <= iStopParsingAtLine) {
      if (iCountLines > this.iStartParsingAtLine) {
        iCountLinesToBeRead++;
      }
      iCountLines++;
    }
    brFile.close();
  }
 catch (  IOException ioe) {
    throw new RuntimeException();
  }
  iLinesInFileToBeRead=iCountLinesToBeRead;
  if (iStopParsingAtLine == Integer.MAX_VALUE) {
    iStopParsingAtLine=iLinesInFileToBeRead;
  }
  return iCountLinesToBeRead;
}

Fixed version (ground truth):
/** 
 * Reads the file and counts the numbers of lines to be read.
 */
protected final int computeNumberOfLinesInFile(String sFileName) throws IOException {
  int iCountLinesToBeRead=0;
  int iCountLines=0;
  try {
    BufferedReader brFile=GeneralManager.get().getResourceLoader().getResource(sFileName);
    while (brFile.readLine() != null && iCountLines <= iStopParsingAtLine) {
      if (iCountLines > this.iStartParsingAtLine) {
        iCountLinesToBeRead++;
      }
      iCountLines++;
    }
    brFile.close();
  }
 catch (  IOException ioe) {
    throw new RuntimeException();
  }
  iLinesInFileToBeRead=iCountLinesToBeRead + iStartParsingAtLine;
  if (iStopParsingAtLine == Integer.MAX_VALUE) {
    iStopParsingAtLine=iLinesInFileToBeRead;
  }
  return iLinesInFileToBeRead;
}
Program: 58915
Project: 58915
Buggy source:
public void handleEvent(Event e){
  String string=e.text;
  char[] chars=new char[string.length()];
  string.getChars(0,chars.length,chars,0);
  for (  char c : chars) {
  }
}

Fixed version (ground truth):
public void handleEvent(Event e){
  String string=e.text;
  char[] chars=new char[string.length()];
  string.getChars(0,chars.length,chars,0);
}
Program: 58919
Project: 58919
Buggy source:
@Override public int createSetVA(ArrayList<Integer> iAlSelections){
  VirtualArray virtualArray=new VirtualArray(depth(),iAlSelections);
  int iUniqueID=virtualArray.getID();
  hashSetVAs.put(iUniqueID,virtualArray);
  return iUniqueID;
}

Fixed version (ground truth):
@Override public int createSetVA(ArrayList<Integer> iAlSelections){
  VirtualArray virtualArray=new VirtualArray(size(),iAlSelections);
  int iUniqueID=virtualArray.getID();
  hashSetVAs.put(iUniqueID,virtualArray);
  return iUniqueID;
}
Program: 58921
Project: 58921
Buggy source:
@Override public void partVisible(IWorkbenchPartReference partRef){
  log.info("String_Node_Str");
  IWorkbenchPart activePart=partRef.getPart(false);
  if (!(activePart instanceof CaleydoViewPart)) {
    return;
  }
  CaleydoViewPart viewPart=(CaleydoViewPart)activePart;
  if (viewPart instanceof AGLViewPart) {
    GeneralManager.get().getViewGLCanvasManager().registerGLCanvasToAnimator(((AGLViewPart)viewPart).getGLCanvas().getID());
  }
  if (!activePart.getSite().getShell().getText().equals("String_Node_Str")) {
    if (viewPart instanceof AGLViewPart) {
      drawInlineToolBar((AGLViewPart)viewPart);
    }
  }
}

Fixed version (ground truth):
@Override public void partVisible(IWorkbenchPartReference partRef){
  log.info("String_Node_Str");
  IWorkbenchPart activePart=partRef.getPart(false);
  if (!(activePart instanceof CaleydoViewPart)) {
    return;
  }
  CaleydoViewPart viewPart=(CaleydoViewPart)activePart;
  if (viewPart instanceof AGLViewPart) {
    GeneralManager.get().getViewGLCanvasManager().registerGLCanvasToAnimator(((AGLViewPart)viewPart).getGLCanvas().getID());
  }
  if (!activePart.getSite().getShell().getText().equals("String_Node_Str")) {
    if (viewPart instanceof AGLViewPart) {
      drawInlineToolBar((AGLViewPart)viewPart);
    }
  }
 else {
    if (viewPart instanceof AGLViewPart) {
      removeInlineToolBar((AGLViewPart)viewPart);
    }
  }
}
Program: 58922
Project: 58922
Buggy source:
private void drawInlineToolBar(AGLViewPart viewPart){
  AGLViewPart glViewPart=(AGLViewPart)viewPart;
  AGLEventListener glView=glViewPart.getGLEventListener();
  List<Integer> viewIDs=glView.getAllViewIDs();
  ToolBarContentFactory contentFactory=ToolBarContentFactory.get();
  List<AToolBarContent> toolBarContents=contentFactory.getToolBarContent(viewIDs);
  final IToolBarManager toolBarManager=viewPart.getViewSite().getActionBars().getToolBarManager();
  toolBarManager.removeAll();
  for (  AToolBarContent toolBarContent : toolBarContents) {
    for (    ToolBarContainer container : toolBarContent.getDefaultToolBar()) {
      for (      IToolBarItem item : container.getToolBarItems()) {
        if (item instanceof IAction) {
          toolBarManager.add((IAction)item);
        }
 else         if (item instanceof ControlContribution) {
          toolBarManager.add((ControlContribution)item);
        }
      }
      toolBarManager.add(new Separator());
    }
  }
  toolBarManager.update(true);
}

Fixed version (ground truth):
/** 
 * draws the toolbar items within the views default toolbar (inline)
 * @param viewPart view to add the toolbar items
 */
private void drawInlineToolBar(AGLViewPart viewPart){
  AGLViewPart glViewPart=(AGLViewPart)viewPart;
  AGLEventListener glView=glViewPart.getGLEventListener();
  List<Integer> viewIDs=glView.getAllViewIDs();
  ToolBarContentFactory contentFactory=ToolBarContentFactory.get();
  List<AToolBarContent> toolBarContents=contentFactory.getToolBarContent(viewIDs);
  final IToolBarManager toolBarManager=viewPart.getViewSite().getActionBars().getToolBarManager();
  for (  AToolBarContent toolBarContent : toolBarContents) {
    for (    ToolBarContainer container : toolBarContent.getDefaultToolBar()) {
      for (      IToolBarItem item : container.getToolBarItems()) {
        if (item instanceof IAction) {
          toolBarManager.add((IAction)item);
        }
 else         if (item instanceof ControlContribution) {
          toolBarManager.add((ControlContribution)item);
        }
      }
      toolBarManager.add(new Separator());
    }
  }
  toolBarManager.update(true);
}
Program: 58923
Project: 58923
Buggy source:
public synchronized void loadDependentPathways(final List<ICaleydoGraphItem> alVertex){
  Iterator<ICaleydoGraphItem> iterPathwayGraphItem=alVertex.iterator();
  Iterator<IGraphItem> iterIdenticalPathwayGraphItemRep=null;
  IGraphItem pathwayGraphItem;
  int iPathwayID=0;
  while (iterPathwayGraphItem.hasNext()) {
    pathwayGraphItem=iterPathwayGraphItem.next();
    if (pathwayGraphItem == null) {
      continue;
    }
    iterIdenticalPathwayGraphItemRep=pathwayGraphItem.getAllItemsByProp(EGraphItemProperty.ALIAS_CHILD).iterator();
    while (iterIdenticalPathwayGraphItemRep.hasNext()) {
      iPathwayID=((PathwayGraph)iterIdenticalPathwayGraphItemRep.next().getAllGraphByType(EGraphItemHierarchy.GRAPH_PARENT).toArray()[0]).getId();
      if (!generalManager.getPathwayManager().isPathwayVisible(iPathwayID)) {
        SerializedPathwayView serPathway=new SerializedPathwayView();
        serPathway.setPathwayID(iPathwayID);
        newViews.add(serPathway);
      }
    }
  }
  if (newViews.isEmpty()) {
    return;
  }
  pickingManager.enablePicking(false);
  if (bucketMouseWheelListener.isZoomedIn()) {
    bucketMouseWheelListener.triggerZoom(false);
  }
  for (  AGLEventListener tmpGLEventListener : GeneralManager.get().getViewGLCanvasManager().getAllGLEventListeners()) {
    if (!tmpGLEventListener.isRenderedRemote()) {
      tmpGLEventListener.enableBusyMode(true);
    }
  }
}

Fixed version (ground truth):
public synchronized void loadDependentPathways(final List<ICaleydoGraphItem> alVertex){
  Iterator<ICaleydoGraphItem> iterPathwayGraphItem=alVertex.iterator();
  Iterator<IGraphItem> iterIdenticalPathwayGraphItemRep=null;
  while (iterPathwayGraphItem.hasNext()) {
    IGraphItem pathwayGraphItem=iterPathwayGraphItem.next();
    if (pathwayGraphItem == null) {
      continue;
    }
    iterIdenticalPathwayGraphItemRep=pathwayGraphItem.getAllItemsByProp(EGraphItemProperty.ALIAS_CHILD).iterator();
    Set<Integer> newPathwayIDs=new HashSet<Integer>();
    while (iterIdenticalPathwayGraphItemRep.hasNext()) {
      int pathwayID=((PathwayGraph)iterIdenticalPathwayGraphItemRep.next().getAllGraphByType(EGraphItemHierarchy.GRAPH_PARENT).toArray()[0]).getId();
      newPathwayIDs.add(pathwayID);
    }
    for (    int pathwayID : newPathwayIDs) {
      addPathwayView(pathwayID);
    }
  }
  if (newViews.isEmpty()) {
    return;
  }
  pickingManager.enablePicking(false);
  if (bucketMouseWheelListener.isZoomedIn()) {
    bucketMouseWheelListener.triggerZoom(false);
  }
  for (  AGLEventListener tmpGLEventListener : GeneralManager.get().getViewGLCanvasManager().getAllGLEventListeners()) {
    if (!tmpGLEventListener.isRenderedRemote()) {
      tmpGLEventListener.enableBusyMode(true);
    }
  }
}
Program: 58924
Project: 58924
Buggy source:
/** 
 * Add pathway view. Also used when serialized pathways are loaded.
 * @param iPathwayIDToLoad
 */
public synchronized void addPathwayView(final int iPathwayIDToLoad){
  SerializedPathwayView serPathway=new SerializedPathwayView();
  serPathway.setPathwayID(iPathwayIDToLoad);
  newViews.add(serPathway);
}

Fixed version (ground truth):
/** 
 * Add pathway view. Also used when serialized pathways are loaded.
 * @param iPathwayIDToLoad
 */
public synchronized void addPathwayView(final int iPathwayIDToLoad){
  if (!generalManager.getPathwayManager().isPathwayVisible(iPathwayIDToLoad)) {
    SerializedPathwayView serPathway=new SerializedPathwayView();
    serPathway.setPathwayID(iPathwayIDToLoad);
    newViews.add(serPathway);
  }
}
Program: 58926
Project: 58926
Buggy source:
private void buildDisplayList(final GL gl,int iGLDisplayListIndex){
  gl.glNewList(iGLDisplayListIndex,GL.GL_COMPILE);
  gl.glColor4f(1,1,1,1);
  float fXCenter=viewFrustum.getWidth() / 2;
  float fYCenter=viewFrustum.getHeight() / 2;
  gl.glTranslatef(fXCenter,fYCenter,0);
  int iDisplayedHierarchyDepth=Math.min(iMaxDisplayedHierarchyDepth,pdCurrentRootElement.getHierarchyDepth());
  float fDiscWidth=Math.min(fXCenter - (fXCenter / 10),fYCenter - (fYCenter / 10)) / iDisplayedHierarchyDepth;
  pdCurrentRootElement.drawHierarchyRoot(gl,glu,fDiscWidth,iDisplayedHierarchyDepth);
  gl.glEndList();
}

Fixed version (ground truth):
private void buildDisplayList(final GL gl,int iGLDisplayListIndex){
  gl.glNewList(iGLDisplayListIndex,GL.GL_COMPILE);
  gl.glColor4f(1,1,1,1);
  float fXCenter=viewFrustum.getWidth() / 2;
  float fYCenter=viewFrustum.getHeight() / 2;
  gl.glTranslatef(fXCenter,fYCenter,0);
  int iDisplayedHierarchyDepth=Math.min(iMaxDisplayedHierarchyDepth,pdCurrentRootElement.getHierarchyDepth());
  float fDiscWidth=Math.min(fXCenter - (fXCenter / 10),fYCenter - (fYCenter / 10)) / iDisplayedHierarchyDepth;
  pdCurrentRootElement.drawHierarchyRoot(gl,glu,fDiscWidth,iDisplayedHierarchyDepth);
  gl.glTranslatef(-fXCenter,-fYCenter,0);
  gl.glEndList();
}
Program: 58927
Project: 58927
Buggy source:
/** 
 * Adds new remote-rendered-views that have been queued for displaying to this view. Only one view is taken from the list and added for remote rendering per call to this method.
 * @param GL   
 */
private synchronized void initNewView(GL gl){
  if (arSlerpActions.isEmpty()) {
    if (!newViews.isEmpty()) {
      ISerializedView serView=newViews.remove(0);
      AGLEventListener view=createView(gl,serView);
      addSlerpActionForView(gl,view);
      if (newViews.isEmpty()) {
        enableUserInteraction();
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Adds new remote-rendered-views that have been queued for displaying to this view. Only one view is taken from the list and added for remote rendering per call to this method.
 * @param GL   
 */
private synchronized void initNewView(GL gl){
  if (arSlerpActions.isEmpty()) {
    if (!newViews.isEmpty()) {
      ISerializedView serView=newViews.remove(0);
      AGLEventListener view=createView(gl,serView);
      addSlerpActionForView(gl,view);
      if (newViews.isEmpty()) {
        enableUserInteraction();
      }
      iAlContainedViewIDs.add(view.getID());
    }
  }
}
Program: 58928
Project: 58928
Buggy source:
@Override public void run(){
  super.run();
  for (  AGLEventListener tmpGLEventListener : generalManager.getViewGLCanvasManager().getAllGLEventListeners()) {
    if (!tmpGLEventListener.isRenderedRemote()) {
      tmpGLEventListener.enableBusyMode(true);
    }
  }
  Iterator<PathwayDatabase> iterPathwayDatabase=pathwayDatabases.iterator();
  while (iterPathwayDatabase.hasNext()) {
    loadAllPathwaysByType(generalManager,iterPathwayDatabase.next());
  }
  for (  AGLEventListener tmpGLEventListener : generalManager.getViewGLCanvasManager().getAllGLEventListeners()) {
    if (!tmpGLEventListener.isRenderedRemote()) {
      tmpGLEventListener.enableBusyMode(false);
    }
  }
  generalManager.getPathwayManager().notifyPathwayLoadingFinished(true);
}

Fixed version (ground truth):
@Override public void run(){
  super.run();
  IViewManager viewManager=generalManager.getViewGLCanvasManager();
  viewManager.requestBusyMode(this);
  Iterator<PathwayDatabase> iterPathwayDatabase=pathwayDatabases.iterator();
  while (iterPathwayDatabase.hasNext()) {
    loadAllPathwaysByType(generalManager,iterPathwayDatabase.next());
  }
  viewManager.releaseBusyMode(this);
  generalManager.getPathwayManager().notifyPathwayLoadingFinished(true);
}
Program: 58929
Project: 58929
Buggy source:
/** 
 * Constructor.
 */
public ViewManager(){
  pickingManager=new PickingManager();
  selectionManager=new ConnectedElementRepresentationManager();
  infoAreaManager=new GLInfoAreaManager();
  hashGLCanvasID2GLCanvas=new HashMap<Integer,GLCaleydoCanvas>();
  hashGLCanvasID2GLEventListeners=new HashMap<Integer,ArrayList<AGLEventListener>>();
  hashGLEventListenerID2GLEventListener=new HashMap<Integer,AGLEventListener>();
  arWorkspaceJFrame=new ArrayList<JFrame>();
  fpsAnimator=new FPSAnimator(null,60);
}

Fixed version (ground truth):
/** 
 * Constructor.
 */
public ViewManager(){
  pickingManager=new PickingManager();
  selectionManager=new ConnectedElementRepresentationManager();
  infoAreaManager=new GLInfoAreaManager();
  hashGLCanvasID2GLCanvas=new HashMap<Integer,GLCaleydoCanvas>();
  hashGLCanvasID2GLEventListeners=new HashMap<Integer,ArrayList<AGLEventListener>>();
  hashGLEventListenerID2GLEventListener=new HashMap<Integer,AGLEventListener>();
  arWorkspaceJFrame=new ArrayList<JFrame>();
  fpsAnimator=new FPSAnimator(null,60);
  busyRequests=new HashSet<Object>();
}
Program: 58930
Project: 58930
Buggy source:
public void enableBusyMode(final boolean bBusyMode){
  if (!bBusyMode && eBusyModeState == EBusyModeState.ON) {
    eBusyModeState=EBusyModeState.SWITCH_OFF;
    pickingManager.enablePicking(true);
  }
 else   if (bBusyMode) {
    pickingManager.enablePicking(false);
    eBusyModeState=EBusyModeState.ON;
  }
}

Fixed version (ground truth):
public void enableBusyMode(final boolean bBusyMode){
  if (!bBusyMode && eBusyModeState == EBusyModeState.ON) {
    eBusyModeState=EBusyModeState.SWITCH_OFF;
    pickingManager.enablePicking(true);
  }
 else   if (bBusyMode) {
    eBusyModeState=EBusyModeState.ON;
  }
}
Program: 58931
Project: 58931
Buggy source:
public void enableBusyMode(final boolean bBusyMode){
  if (!bBusyMode && eBusyModeState == EBusyModeState.ON) {
    eBusyModeState=EBusyModeState.SWITCH_OFF;
    pickingManager.enablePicking(true);
  }
 else   if (bBusyMode) {
    eBusyModeState=EBusyModeState.ON;
  }
}

Fixed version (ground truth):
public void enableBusyMode(final boolean bBusyMode){
  if (!bBusyMode && eBusyModeState == EBusyModeState.ON) {
    eBusyModeState=EBusyModeState.SWITCH_OFF;
    pickingManager.enablePicking(true);
  }
 else   if (bBusyMode) {
    pickingManager.enablePicking(false);
    eBusyModeState=EBusyModeState.ON;
  }
}
Program: 58932
Project: 58932
Buggy source:
@Override public final void initViewRCP(Composite parentComposite){
  this.parentComposite=parentComposite;
  initViewSWTComposite(parentComposite);
}

Fixed version (ground truth):
@Override public final void initViewRCP(final Composite parentComposite){
  this.parentComposite=parentComposite;
  initViewSWTComposite(parentComposite);
}
Program: 58934
Project: 58934
Buggy source:
@Override public void partActivated(IWorkbenchPartReference partRef){
}

Fixed version (ground truth):
@Override public void partActivated(IWorkbenchPartReference partRef){
  IWorkbenchPart activePart=partRef.getPart(false);
  if (activePart instanceof CaleydoViewPart && !(activePart instanceof HTMLBrowserView))   GeneralManager.get().getViewGLCanvasManager().setActiveSWTView(((CaleydoViewPart)activePart).getSWTComposite());
}
Program: 58935
Project: 58935
Buggy source:
@Override public void createPartControl(Composite parent){
  tabularDataView=(TabularDataViewRep)GeneralManager.get().getViewGLCanvasManager().createView(EManagedObjectType.VIEW_SWT_TABULAR_DATA_VIEWER,-1,"String_Node_Str");
  for (  ISet set : GeneralManager.get().getSetManager().getAllItems()) {
    tabularDataView.addSet(set);
  }
  tabularDataView.initViewRCP(parent);
  tabularDataView.drawView();
  GeneralManager.get().getViewGLCanvasManager().registerItem(tabularDataView);
}

Fixed version (ground truth):
@Override public void createPartControl(Composite parent){
  tabularDataView=(TabularDataViewRep)GeneralManager.get().getViewGLCanvasManager().createView(EManagedObjectType.VIEW_SWT_TABULAR_DATA_VIEWER,-1,"String_Node_Str");
  for (  ISet set : GeneralManager.get().getSetManager().getAllItems()) {
    tabularDataView.addSet(set);
  }
  tabularDataView.initViewRCP(parent);
  tabularDataView.drawView();
  swtComposite=parent;
  GeneralManager.get().getViewGLCanvasManager().registerItem(tabularDataView);
}
Program: 58936
Project: 58936
Buggy source:
@Override public synchronized void clearAllSelections(){
  AlSelection.clear();
  AlExpMouseOver.clear();
  AlExpSelected.clear();
  iSelectorBar=1;
  initPosCursor();
  setDisplayListDirty();
  triggerSelectionBlock();
  glHeatMapView.setDisplayListDirty();
}

Fixed version (ground truth):
@Override public synchronized void clearAllSelections(){
  contentSelectionManager.clearSelections();
  storageSelectionManager.clearSelections();
  AlSelection.clear();
  AlExpMouseOver.clear();
  AlExpSelected.clear();
  iSelectorBar=1;
  initPosCursor();
  setDisplayListDirty();
  triggerSelectionBlock();
  glHeatMapView.setDisplayListDirty();
}
Program: 58937
Project: 58937
Buggy source:
private void setTexture(){
  boolean bSetCurrentTexture=true;
  if (AlSelection.size() > 0) {
    for (    HeatMapSelection selection : AlSelection) {
      if (selection.getTexture() == iSelectorBar + 0 || selection.getTexture() == iSelectorBar - 1) {
        bSetCurrentTexture=false;
        break;
      }
    }
    if (bSetCurrentTexture) {
      iSelectorBar=AlSelection.get(0).getTexture() + 1;
      if (iSelectorBar == iNrSelBar)       iSelectorBar--;
      initPosCursor();
    }
  }
}

Fixed version (ground truth):
private void setTexture(){
  boolean bSetCurrentTexture=true;
  if (AlSelection.size() > 0) {
    for (    HeatMapSelection selection : AlSelection) {
      if ((selection.getTexture() == iSelectorBar && selection.getPos() >= iFirstSample && selection.getPos() <= iLastSample) || (selection.getTexture() == iSelectorBar - 1 && selection.getPos() >= iFirstSample && selection.getPos() <= iLastSample)) {
        bSetCurrentTexture=false;
        break;
      }
    }
    if (bSetCurrentTexture) {
      iSelectorBar=AlSelection.get(0).getTexture() + 1;
      if (iSelectorBar == iNrSelBar)       iSelectorBar--;
      initPosCursor();
    }
  }
}
Program: 58938
Project: 58938
Buggy source:
private ISelectionDelta createExternalSelectionDelta(ISelectionDelta selectionDelta){
  ISelectionDelta newSelectionDelta=new SelectionDelta(EIDType.REFSEQ_MRNA_INT);
  IIDMappingManager idMappingManager=generalManager.getIDMappingManager();
  for (  SelectionDeltaItem item : selectionDelta) {
    for (    int iDavidID : getDavidFromPathwayVertexGraphItemRep(item.getPrimaryID())) {
      Set<Integer> iSetRefSeq=idMappingManager.getMultiID(EMappingType.DAVID_2_REFSEQ_MRNA_INT,iDavidID);
      if (iSetRefSeq == null) {
        generalManager.getLogger().log(Level.SEVERE,"String_Node_Str" + iDavidID);
        continue;
      }
      for (      Object iRefSeqID : iSetRefSeq) {
        newSelectionDelta.addSelection((Integer)iRefSeqID,item.getSelectionType(),item.getPrimaryID());
        for (        Integer iConnectionID : item.getConnectionID()) {
          newSelectionDelta.addConnectionID((Integer)iRefSeqID,iConnectionID);
        }
      }
    }
  }
  return newSelectionDelta;
}

Fixed version (ground truth):
private ISelectionDelta createExternalSelectionDelta(ISelectionDelta selectionDelta){
  ISelectionDelta newSelectionDelta=new SelectionDelta(EIDType.REFSEQ_MRNA_INT);
  for (  SelectionDeltaItem item : selectionDelta) {
    for (    int iRefSeqID : getRefSeqIDsFromPathwayVertexGraphItemRep(item.getPrimaryID())) {
      newSelectionDelta.addSelection((Integer)iRefSeqID,item.getSelectionType(),item.getPrimaryID());
      for (      Integer iConnectionID : item.getConnectionID()) {
        newSelectionDelta.addConnectionID((Integer)iRefSeqID,iConnectionID);
      }
    }
  }
  return newSelectionDelta;
}
Program: 58941
Project: 58941
Buggy source:
@Override public void init(GLAutoDrawable drawable){
  GeneralManager.get().getLogger().log(Level.INFO,"String_Node_Str" + iGLCanvasID + "String_Node_Str"+ "String_Node_Str"+ drawable.getChosenGLCapabilities());
  GL gl=drawable.getGL();
  gl.setSwapInterval(0);
  fpsCounter=new FPSCounter(drawable,16);
  fpsCounter.setColor(0.5f,0.5f,0.5f,1);
  gl.glShadeModel(GL.GL_SMOOTH);
  gl.glClearColor(1.0f,1.0f,1.0f,1.0f);
  gl.glClearDepth(1.0f);
  gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT | GL.GL_STENCIL_BUFFER_BIT);
  gl.glEnable(GL.GL_DEPTH_TEST);
  gl.glDepthFunc(GL.GL_LEQUAL);
  gl.glEnable(GL.GL_BLEND);
  gl.glBlendFunc(GL.GL_SRC_ALPHA,GL.GL_ONE_MINUS_SRC_ALPHA);
  gl.glEnable(GL.GL_LINE_SMOOTH);
  gl.glHint(GL.GL_LINE_SMOOTH_HINT,GL.GL_NICEST);
  gl.glHint(GL.GL_PERSPECTIVE_CORRECTION_HINT,GL.GL_NICEST);
  gl.glEnable(GL.GL_COLOR_MATERIAL);
  gl.glColorMaterial(GL.GL_FRONT,GL.GL_DIFFUSE);
}

Fixed version (ground truth):
@Override public void init(GLAutoDrawable drawable){
  GeneralManager.get().getLogger().log(Level.INFO,"String_Node_Str" + iGLCanvasID + "String_Node_Str"+ "String_Node_Str"+ drawable.getChosenGLCapabilities());
  GL gl=drawable.getGL();
  gl.setSwapInterval(0);
  fpsCounter=new FPSCounter(drawable,16);
  fpsCounter.setColor(0.5f,0.5f,0.5f,1);
  gl.glShadeModel(GL.GL_SMOOTH);
  gl.glClearColor(1.0f,1.0f,1.0f,1.0f);
  gl.glClearDepth(1.0f);
  gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT | GL.GL_STENCIL_BUFFER_BIT);
  gl.glEnable(GL.GL_DEPTH_TEST);
  gl.glDepthFunc(GL.GL_LEQUAL);
  gl.glEnable(GL.GL_BLEND);
  gl.glBlendFunc(GL.GL_SRC_ALPHA,GL.GL_ONE_MINUS_SRC_ALPHA);
  gl.glEnable(GL.GL_LINE_SMOOTH);
  gl.glHint(GL.GL_LINE_SMOOTH_HINT,GL.GL_NICEST);
  gl.glEnable(GL.GL_POLYGON_SMOOTH);
  gl.glHint(GL.GL_POLYGON_SMOOTH_HINT,GL.GL_NICEST);
  gl.glHint(GL.GL_PERSPECTIVE_CORRECTION_HINT,GL.GL_NICEST);
  gl.glEnable(GL.GL_COLOR_MATERIAL);
  gl.glColorMaterial(GL.GL_FRONT,GL.GL_DIFFUSE);
}
Program: 58942
Project: 58942
Buggy source:
@Override public synchronized void initLocal(GL gl){
  bIsLocal=true;
  float fInitZoom=-10f;
  Rotf t=new Rotf();
  t.set(new Vec3f(-1,0,0),(float)(Math.PI / 4.0 - 2.0 * Math.PI * (-(fInitZoom + 3)) / 360.0));
  this.getViewCamera().setCameraRotation(t);
  this.getViewCamera().addCameraPosition(new Vec3f(0,0,fInitZoom));
  init(gl);
{
    MouseListener[] ml=parentGLCanvas.getMouseListeners();
    for (    MouseListener l : ml) {
      if (l instanceof JoglMouseListener)       ((JoglMouseListener)l).setNavigationModes(false,false,false);
    }
  }
  if (mouseListener_ != null) {
    parentGLCanvas.addMouseListener(mouseListener_);
    mouseListener_.setNavigationModes(true,false,true);
  }
  if (iViewRole != 2 && mouseListener_ != null) {
    parentGLCanvas.addMouseMotionListener(mouseListener_);
    parentGLCanvas.addMouseWheelListener(mouseListener_);
    parentGLCanvas.addKeyListener(keyListener_);
  }
  grid_.setGlyphPositions(EIconIDs.DISPLAY_RECTANGLE);
  if (this.iViewRole == 2)   grid_.setGlyphPositions(EIconIDs.DISPLAY_CIRCLE);
}

Fixed version (ground truth):
@Override public synchronized void initLocal(GL gl){
  generalManager.getEventPublisher().addSender(EMediatorType.SELECTION_MEDIATOR,this);
  generalManager.getEventPublisher().addReceiver(EMediatorType.SELECTION_MEDIATOR,this);
  bIsLocal=true;
  float fInitZoom=-10f;
  Rotf t=new Rotf();
  t.set(new Vec3f(-1,0,0),(float)(Math.PI / 4.0 - 2.0 * Math.PI * (-(fInitZoom + 3)) / 360.0));
  this.getViewCamera().setCameraRotation(t);
  this.getViewCamera().addCameraPosition(new Vec3f(0,0,fInitZoom));
  init(gl);
{
    MouseListener[] ml=parentGLCanvas.getMouseListeners();
    for (    MouseListener l : ml) {
      if (l instanceof JoglMouseListener)       ((JoglMouseListener)l).setNavigationModes(false,false,false);
    }
  }
  if (mouseListener_ != null) {
    parentGLCanvas.addMouseListener(mouseListener_);
    mouseListener_.setNavigationModes(true,false,true);
  }
  if (iViewRole != 2 && mouseListener_ != null) {
    parentGLCanvas.addMouseMotionListener(mouseListener_);
    parentGLCanvas.addMouseWheelListener(mouseListener_);
    parentGLCanvas.addKeyListener(keyListener_);
  }
  grid_.setGlyphPositions(EIconIDs.DISPLAY_RECTANGLE);
  if (this.iViewRole == 2)   grid_.setGlyphPositions(EIconIDs.DISPLAY_CIRCLE);
}
Program: 58945
Project: 58945
Buggy source:
@Override public RemoteLevel initFocusLevel(){
  Transform transform=new Transform();
  transform.setTranslation(new Vec3f(-2,-2,4 * fZoomFactor));
  transform.setScale(new Vec3f(fScalingFactorFocusLevel,fScalingFactorFocusLevel,fScalingFactorFocusLevel));
  focusLevel.getElementByPositionIndex(0).setTransform(transform);
  return focusLevel;
}

Fixed version (ground truth):
@Override public RemoteLevel initFocusLevel(){
  Transform transform=new Transform();
  transform.setTranslation(new Vec3f(-2 + fInputDeviceXCorrection,-2,4 * fZoomFactor));
  transform.setScale(new Vec3f(fScalingFactorFocusLevel,fScalingFactorFocusLevel,fScalingFactorFocusLevel));
  focusLevel.getElementByPositionIndex(0).setTransform(transform);
  return focusLevel;
}
Program: 58948
Project: 58948
Buggy source:
/** 
 * Constructor
 */
public PickingManager(){
  hashSignatureToHitList=new HashMap<Integer,ArrayList<Pick>>();
  hashSignatureToPickingIDHashMap=new HashMap<Integer,HashMap<Integer,Integer>>();
  hashSignatureToExternalIDHashMap=new HashMap<Integer,HashMap<Integer,Integer>>();
  hashViewIDToLastMouseMovedTimeStamp=new HashMap<Integer,Long>();
  hashViewIDToIsMouseOverPickingEvent=new HashMap<Integer,Boolean>();
}

Fixed version (ground truth):
/** 
 * Constructor
 */
public PickingManager(){
  hashSignatureToHitList=new HashMap<Integer,ArrayList<Pick>>();
  hashSignatureToPickingIDHashMap=new HashMap<Integer,HashMap<Integer,Integer>>();
  hashSignatureToExternalIDHashMap=new HashMap<Integer,HashMap<Integer,Integer>>();
  hashViewIDToIsMouseOverPickingEvent=new HashMap<Integer,Boolean>();
}
Program: 58949
Project: 58949
Buggy source:
@Override public void initLocal(final GL gl){
  init(gl);
  pickingTriggerMouseAdapter.resetEvents();
}

Fixed version (ground truth):
@Override public void initLocal(final GL gl){
  init(gl);
}
Program: 58950
Project: 58950
Buggy source:
@Override public synchronized void displayLocal(final GL gl){
  pickingManager.handlePicking(iUniqueID,gl,false);
  if (bIsDisplayListDirtyLocal) {
    bIsDisplayListDirtyLocal=false;
  }
  display(gl);
  pickingTriggerMouseAdapter.resetEvents();
}

Fixed version (ground truth):
@Override public synchronized void displayLocal(final GL gl){
  pickingManager.handlePicking(iUniqueID,gl,false);
  if (bIsDisplayListDirtyLocal) {
    bIsDisplayListDirtyLocal=false;
  }
  display(gl);
}
Program: 58951
Project: 58951
Buggy source:
@Override public synchronized void displayLocal(GL gl){
  pickingManager.handlePicking(iUniqueID,gl,true);
  display(gl);
  checkForHits(gl);
  pickingTriggerMouseAdapter.resetEvents();
}

Fixed version (ground truth):
@Override public synchronized void displayLocal(GL gl){
  pickingManager.handlePicking(iUniqueID,gl,true);
  display(gl);
  checkForHits(gl);
}
Program: 58952
Project: 58952
Buggy source:
@Override public void displayLocal(GL gl){
  pickingManager.handlePicking(iUniqueID,gl,true);
  display(gl);
  checkForHits(gl);
  pickingTriggerMouseAdapter.resetEvents();
}

Fixed version (ground truth):
@Override public void displayLocal(GL gl){
  pickingManager.handlePicking(iUniqueID,gl,true);
  display(gl);
  checkForHits(gl);
}
Program: 58953
Project: 58953
Buggy source:
@Override public void initLocal(final GL gl){
  iGLDisplayListIndexLocal=gl.glGenLists(1);
  iGLDisplayListToCall=iGLDisplayListIndexLocal;
  init(gl);
  pickingTriggerMouseAdapter.resetEvents();
}

Fixed version (ground truth):
@Override public void initLocal(final GL gl){
  iGLDisplayListIndexLocal=gl.glGenLists(1);
  iGLDisplayListToCall=iGLDisplayListIndexLocal;
  init(gl);
}