Program: 58976
Project: 58976
Buggy source:
@Override protected void handleEvents(EPickingType ePickingType,EPickingMode pickingMode,int iExternalID,Pick pick){
  if (detailLevel == EDetailLevel.VERY_LOW) {
    pickingManager.flushHits(iUniqueID,ePickingType);
    return;
  }
switch (ePickingType) {
case PATHWAY_ELEMENT_SELECTION:
    PathwayVertexGraphItemRep tmpVertexGraphItemRep=(PathwayVertexGraphItemRep)generalManager.getPathwayItemManager().getItem(iExternalID);
  if (selectionManager.checkStatus(ESelectionType.MOUSE_OVER,tmpVertexGraphItemRep.getId()) && !pickingMode.equals(EPickingMode.CLICKED) && !pickingMode.equals(EPickingMode.DOUBLE_CLICKED)) {
    pickingManager.flushHits(iUniqueID,ePickingType);
    return;
  }
setDisplayListDirty();
selectionManager.clearSelection(ESelectionType.NEIGHBORHOOD_1);
selectionManager.clearSelection(ESelectionType.NEIGHBORHOOD_2);
selectionManager.clearSelection(ESelectionType.NEIGHBORHOOD_3);
if (pickingMode == EPickingMode.DOUBLE_CLICKED) {
if (tmpVertexGraphItemRep.getType() == EPathwayVertexType.map) {
int iPathwayID=generalManager.getPathwayManager().searchPathwayIdByName(tmpVertexGraphItemRep.getName(),EPathwayDatabaseType.KEGG);
if (iPathwayID != -1) {
ISelectionDelta selectionDelta=new SelectionDelta(EIDType.PATHWAY);
selectionDelta.addSelection(iPathwayID,ESelectionType.SELECTION);
triggerUpdate(EMediatorType.SELECTION_MEDIATOR,selectionDelta,null);
}
}
selectionManager.clearSelection(ESelectionType.SELECTION);
selectionManager.addToType(ESelectionType.SELECTION,tmpVertexGraphItemRep.getId());
}
 else if (pickingMode == EPickingMode.MOUSE_OVER || pickingMode == EPickingMode.CLICKED) {
selectionManager.clearSelection(ESelectionType.MOUSE_OVER);
selectionManager.addToType(ESelectionType.MOUSE_OVER,tmpVertexGraphItemRep.getId());
}
int iConnectionID=generalManager.getIDManager().createID(EManagedObjectType.CONNECTION);
selectionManager.addConnectionID(iConnectionID,tmpVertexGraphItemRep.getId());
connectedElementRepresentationManager.clear(EIDType.EXPRESSION_INDEX);
gLPathwayContentCreator.performIdenticalNodeHighlighting();
createConnectionLines(tmpVertexGraphItemRep,iConnectionID);
Collection<SelectionCommand> colSelectionCommand=new ArrayList<SelectionCommand>();
colSelectionCommand.add(new SelectionCommand(ESelectionCommandType.CLEAR,ESelectionType.MOUSE_OVER));
ISelectionDelta delta=selectionManager.getDelta();
triggerUpdate(EMediatorType.SELECTION_MEDIATOR,createExternalSelectionDelta(delta),colSelectionCommand);
pickingManager.flushHits(iUniqueID,ePickingType);
break;
}
}

Fixed version (ground truth):
@Override protected void handleEvents(EPickingType ePickingType,EPickingMode pickingMode,int iExternalID,Pick pick){
  if (detailLevel == EDetailLevel.VERY_LOW) {
    pickingManager.flushHits(iUniqueID,ePickingType);
    return;
  }
switch (ePickingType) {
case PATHWAY_ELEMENT_SELECTION:
    PathwayVertexGraphItemRep tmpVertexGraphItemRep=(PathwayVertexGraphItemRep)generalManager.getPathwayItemManager().getItem(iExternalID);
  if (selectionManager.checkStatus(ESelectionType.MOUSE_OVER,tmpVertexGraphItemRep.getId()) && !pickingMode.equals(EPickingMode.CLICKED) && !pickingMode.equals(EPickingMode.DOUBLE_CLICKED)) {
    pickingManager.flushHits(iUniqueID,ePickingType);
    return;
  }
setDisplayListDirty();
selectionManager.clearSelection(ESelectionType.NEIGHBORHOOD_1);
selectionManager.clearSelection(ESelectionType.NEIGHBORHOOD_2);
selectionManager.clearSelection(ESelectionType.NEIGHBORHOOD_3);
if (pickingMode == EPickingMode.DOUBLE_CLICKED) {
if (tmpVertexGraphItemRep.getType() == EPathwayVertexType.map) {
int iPathwayID=generalManager.getPathwayManager().searchPathwayIdByName(tmpVertexGraphItemRep.getName(),EPathwayDatabaseType.KEGG);
if (iPathwayID != -1) {
ISelectionDelta selectionDelta=new SelectionDelta(EIDType.PATHWAY);
selectionDelta.addSelection(iPathwayID,ESelectionType.SELECTION);
triggerUpdate(EMediatorType.SELECTION_MEDIATOR,selectionDelta,null);
}
}
selectionManager.clearSelection(ESelectionType.SELECTION);
selectionManager.addToType(ESelectionType.SELECTION,tmpVertexGraphItemRep.getId());
}
 else if (pickingMode == EPickingMode.MOUSE_OVER || pickingMode == EPickingMode.CLICKED) {
selectionManager.clearSelection(ESelectionType.MOUSE_OVER);
selectionManager.addToType(ESelectionType.MOUSE_OVER,tmpVertexGraphItemRep.getId());
}
int iConnectionID=generalManager.getIDManager().createID(EManagedObjectType.CONNECTION);
selectionManager.addConnectionID(iConnectionID,tmpVertexGraphItemRep.getId());
connectedElementRepresentationManager.clear(EIDType.EXPRESSION_INDEX);
gLPathwayContentCreator.performIdenticalNodeHighlighting();
createConnectionLines(tmpVertexGraphItemRep,iConnectionID);
Collection<SelectionCommand> colSelectionCommand=new ArrayList<SelectionCommand>();
colSelectionCommand.add(new SelectionCommand(ESelectionCommandType.CLEAR,ESelectionType.MOUSE_OVER));
ISelectionDelta delta=selectionManager.getDelta();
triggerUpdate(EMediatorType.SELECTION_MEDIATOR,createExternalSelectionDelta(delta),colSelectionCommand);
pickingManager.flushHits(iUniqueID,EPickingType.PATHWAY_ELEMENT_SELECTION);
break;
}
}