Program: 58247
Project: 58247
Buggy source:
@Override protected void handlePickingEvents(EPickingType ePickingType,EPickingMode pickingMode,int iExternalID,Pick pick){
  if (detailLevel == EDetailLevel.VERY_LOW) {
    return;
  }
switch (ePickingType) {
case PATHWAY_ELEMENT_SELECTION:
    SelectionType selectionType;
  PathwayVertexGraphItemRep tmpVertexGraphItemRep=(PathwayVertexGraphItemRep)pathwayItemManager.getItem(iExternalID);
setDisplayListDirty();
switch (pickingMode) {
case DOUBLE_CLICKED:
selectionType=SelectionType.SELECTION;
if (tmpVertexGraphItemRep.getType() == EPathwayVertexType.map) {
PathwayGraph pathway=pathwayManager.searchPathwayByName(tmpVertexGraphItemRep.getName(),EPathwayDatabaseType.KEGG);
if (pathway != null) {
  LoadPathwayEvent event=new LoadPathwayEvent();
  event.setSender(this);
  event.setPathwayID(pathway.getID());
  eventPublisher.triggerEvent(event);
}
}
 else {
}
break;
case CLICKED:
selectionType=SelectionType.SELECTION;
break;
case MOUSE_OVER:
selectionType=SelectionType.MOUSE_OVER;
break;
case RIGHT_CLICKED:
selectionType=SelectionType.SELECTION;
if (tmpVertexGraphItemRep.getType() == EPathwayVertexType.map) {
EmbeddedPathwayContextMenuItemContainer pathwayContextMenuItemContainer=new EmbeddedPathwayContextMenuItemContainer();
pathwayContextMenuItemContainer.setPathway(pathwayManager.searchPathwayByName(tmpVertexGraphItemRep.getName(),EPathwayDatabaseType.KEGG));
contextMenu.addItemContanier(pathwayContextMenuItemContainer);
}
 else if (tmpVertexGraphItemRep.getType() == EPathwayVertexType.gene) {
for (IGraphItem pathwayVertexGraphItem : tmpVertexGraphItemRep.getAllItemsByProp(EGraphItemProperty.ALIAS_PARENT)) {
ContentContextMenuItemContainer geneContextMenuItemContainer=new ContentContextMenuItemContainer();
geneContextMenuItemContainer.setID(EIDType.DAVID,pathwayItemManager.getDavidIdByPathwayVertexGraphItem((PathwayVertexGraphItem)pathwayVertexGraphItem));
contextMenu.addItemContanier(geneContextMenuItemContainer);
}
}
 else {
break;
}
default :
return;
}
if (selectionManager.checkStatus(selectionType,iExternalID)) {
break;
}
selectionManager.clearSelection(selectionType);
SelectionCommand command=new SelectionCommand(ESelectionCommandType.CLEAR,selectionType);
sendSelectionCommandEvent(EIDType.EXPRESSION_INDEX,command);
selectionManager.addToType(selectionType,tmpVertexGraphItemRep.getId());
int iConnectionID=generalManager.getIDManager().createID(EManagedObjectType.CONNECTION);
selectionManager.addConnectionID(iConnectionID,tmpVertexGraphItemRep.getId());
connectedElementRepresentationManager.clear(EIDType.EXPRESSION_INDEX);
createConnectionLines(selectionType,iConnectionID);
ISelectionDelta selectionDelta=createExternalSelectionDelta(selectionManager.getDelta());
SelectionUpdateEvent event=new SelectionUpdateEvent();
event.setSender(this);
event.setDataDomainType(mappingDataDomain.getDataDomainType());
event.setSelectionDelta((SelectionDelta)selectionDelta);
event.setInfo(getShortInfoLocal());
eventPublisher.triggerEvent(event);
break;
}
}

Fixed version (ground truth):
@Override protected void handlePickingEvents(EPickingType ePickingType,EPickingMode pickingMode,int iExternalID,Pick pick){
  if (detailLevel == EDetailLevel.VERY_LOW) {
    return;
  }
switch (ePickingType) {
case PATHWAY_ELEMENT_SELECTION:
    SelectionType selectionType;
  PathwayVertexGraphItemRep tmpVertexGraphItemRep=(PathwayVertexGraphItemRep)pathwayItemManager.getItem(iExternalID);
setDisplayListDirty();
switch (pickingMode) {
case DOUBLE_CLICKED:
selectionType=SelectionType.SELECTION;
if (tmpVertexGraphItemRep.getType() == EPathwayVertexType.map) {
PathwayGraph pathway=pathwayManager.searchPathwayByName(tmpVertexGraphItemRep.getName(),EPathwayDatabaseType.KEGG);
if (pathway != null) {
  LoadPathwayEvent event=new LoadPathwayEvent();
  event.setSender(this);
  event.setPathwayID(pathway.getID());
  eventPublisher.triggerEvent(event);
}
}
 else {
}
break;
case CLICKED:
selectionType=SelectionType.SELECTION;
break;
case MOUSE_OVER:
selectionType=SelectionType.MOUSE_OVER;
break;
case RIGHT_CLICKED:
selectionType=SelectionType.SELECTION;
if (tmpVertexGraphItemRep.getType() == EPathwayVertexType.map) {
EmbeddedPathwayContextMenuItemContainer pathwayContextMenuItemContainer=new EmbeddedPathwayContextMenuItemContainer();
pathwayContextMenuItemContainer.setPathway(pathwayManager.searchPathwayByName(tmpVertexGraphItemRep.getName(),EPathwayDatabaseType.KEGG));
contextMenu.addItemContanier(pathwayContextMenuItemContainer);
}
 else if (tmpVertexGraphItemRep.getType() == EPathwayVertexType.gene) {
for (IGraphItem pathwayVertexGraphItem : tmpVertexGraphItemRep.getAllItemsByProp(EGraphItemProperty.ALIAS_PARENT)) {
ContentContextMenuItemContainer geneContextMenuItemContainer=new ContentContextMenuItemContainer();
geneContextMenuItemContainer.setID(EIDType.DAVID,pathwayItemManager.getDavidIdByPathwayVertexGraphItem((PathwayVertexGraphItem)pathwayVertexGraphItem));
contextMenu.addItemContanier(geneContextMenuItemContainer);
}
}
 else {
break;
}
default :
return;
}
if (selectionManager.checkStatus(selectionType,iExternalID)) {
break;
}
selectionManager.clearSelection(selectionType);
SelectionCommand command=new SelectionCommand(ESelectionCommandType.CLEAR,selectionType);
sendSelectionCommandEvent(mappingDataDomain.getContentIDType(),command);
selectionManager.addToType(selectionType,tmpVertexGraphItemRep.getId());
int iConnectionID=generalManager.getIDManager().createID(EManagedObjectType.CONNECTION);
selectionManager.addConnectionID(iConnectionID,tmpVertexGraphItemRep.getId());
connectedElementRepresentationManager.clear(mappingDataDomain.getContentIDType());
createConnectionLines(selectionType,iConnectionID);
ISelectionDelta selectionDelta=createExternalSelectionDelta(selectionManager.getDelta());
SelectionUpdateEvent event=new SelectionUpdateEvent();
event.setSender(this);
event.setDataDomainType(mappingDataDomain.getDataDomainType());
event.setSelectionDelta((SelectionDelta)selectionDelta);
event.setInfo(getShortInfoLocal());
eventPublisher.triggerEvent(event);
break;
}
}