Program: 59156
Project: 59156
Buggy source:
protected void checkForHits(){
  if (pickingManager.getHits(this,GLPathwayManager.PATHWAY_VERTEX_SELECTION) != null) {
    ArrayList<Pick> tempList=pickingManager.getHits(this,GLPathwayManager.PATHWAY_VERTEX_SELECTION);
    if (tempList != null) {
      if (tempList.size() != 0) {
        int iElementID=pickingManager.getExternalIDFromPickingID(this,tempList.get(0).getPickingID());
        PathwayVertexGraphItemRep tmpVertexGraphItemRep=(PathwayVertexGraphItemRep)generalManager.getSingelton().getPathwayItemManager().getItem(iElementID);
        PathwayVertexGraphItem tmpVertexGraphItem=(PathwayVertexGraphItem)tmpVertexGraphItemRep.getAllItemsByProp(EGraphItemProperty.ALIAS_PARENT).get(0);
        int iGeneID=generalManager.getSingelton().getGenomeIdManager().getIdIntFromStringByMapping(tmpVertexGraphItem.getName().substring(4),EGenomeMappingType.NCBI_GENEID_CODE_2_NCBI_GENEID);
        if (iGeneID == -1) {
          return;
        }
        int iAccessionID=generalManager.getSingelton().getGenomeIdManager().getIdIntFromIntByMapping(iGeneID,EGenomeMappingType.NCBI_GENEID_2_ACCESSION);
        selectionManager.clear();
        int iPathwayHeight=((PathwayGraph)generalManager.getSingelton().getPathwayManager().getItem(iPathwayID)).getHeight();
        selectionManager.modifySelection(iAccessionID,new SelectedElementRep(this.getId(),tmpVertexGraphItemRep.getXOrigin(),iPathwayHeight - tmpVertexGraphItemRep.getYOrigin()),ESelectionMode.ReplacePick);
        int[] iArTmpSelectionId=new int[1];
        int[] iArTmpDepth=new int[1];
        iArTmpSelectionId[0]=iAccessionID;
        iArTmpDepth[0]=0;
        alSetSelection.get(0).getWriteToken();
        alSetSelection.get(0).updateSelectionSet(iUniqueId,iArTmpSelectionId,iArTmpDepth,new int[0]);
        alSetSelection.get(0).returnWriteToken();
        alSetSelection.get(0).updateSelectionSet(iUniqueId);
      }
    }
    pickingManager.flushHits(this,GLPathwayManager.PATHWAY_VERTEX_SELECTION);
  }
}

Fixed version (ground truth):
protected void checkForHits(){
  if (pickingManager.getHits(this,GLPathwayManager.PATHWAY_VERTEX_SELECTION) != null) {
    ArrayList<Pick> tempList=pickingManager.getHits(this,GLPathwayManager.PATHWAY_VERTEX_SELECTION);
    if (tempList != null) {
      if (tempList.size() != 0) {
        int iElementID=pickingManager.getExternalIDFromPickingID(this,tempList.get(0).getPickingID());
        PathwayVertexGraphItemRep tmpVertexGraphItemRep=(PathwayVertexGraphItemRep)generalManager.getSingelton().getPathwayItemManager().getItem(iElementID);
        PathwayVertexGraphItem tmpVertexGraphItem=(PathwayVertexGraphItem)tmpVertexGraphItemRep.getAllItemsByProp(EGraphItemProperty.ALIAS_PARENT).get(0);
        int iGeneID=generalManager.getSingelton().getGenomeIdManager().getIdIntFromStringByMapping(tmpVertexGraphItem.getName().substring(4),EGenomeMappingType.NCBI_GENEID_CODE_2_NCBI_GENEID);
        if (iGeneID == -1) {
          return;
        }
        int iAccessionID=generalManager.getSingelton().getGenomeIdManager().getIdIntFromIntByMapping(iGeneID,EGenomeMappingType.NCBI_GENEID_2_ACCESSION);
        selectionManager.clear();
        int iPathwayHeight=((PathwayGraph)generalManager.getSingelton().getPathwayManager().getItem(iPathwayID)).getHeight();
        selectionManager.modifySelection(iAccessionID,new SelectedElementRep(this.getId(),tmpVertexGraphItemRep.getXOrigin(),iPathwayHeight - tmpVertexGraphItemRep.getYOrigin()),ESelectionMode.AddPick);
        int[] iArTmpSelectionId=new int[1];
        int[] iArTmpDepth=new int[1];
        iArTmpSelectionId[0]=iAccessionID;
        iArTmpDepth[0]=0;
        alSetSelection.get(0).getWriteToken();
        alSetSelection.get(0).updateSelectionSet(iUniqueId,iArTmpSelectionId,iArTmpDepth,new int[0]);
        alSetSelection.get(0).returnWriteToken();
      }
    }
    pickingManager.flushHits(this,GLPathwayManager.PATHWAY_VERTEX_SELECTION);
  }
}