Program: 58655
Project: 58655
Buggy source:
@Override protected void handleEvents(EPickingType ePickingType,EPickingMode pickingMode,int iExternalID,Pick pick){
  if (detailLevel == EDetailLevel.VERY_LOW) {
    return;
  }
  ESelectionType eSelectionType=ESelectionType.NORMAL;
switch (ePickingType) {
case DENDROGRAM_CUT_SELECTION:
switch (pickingMode) {
case CLICKED:
      break;
case DRAGGED:
    bIsDraggingActive=true;
  setDisplayListDirty();
break;
case MOUSE_OVER:
break;
}
break;
case DENDROGRAM_GENE_LEAF_SELECTION:
switch (pickingMode) {
case CLICKED:
eSelectionType=ESelectionType.SELECTION;
break;
case DRAGGED:
break;
case MOUSE_OVER:
eSelectionType=ESelectionType.MOUSE_OVER;
break;
case RIGHT_CLICKED:
if (contentSelectionManager.checkStatus(iExternalID) == false && storageSelectionManager.checkStatus(iExternalID) == false) break;
if (generalManager.getUseCase().getUseCaseMode() != EUseCaseMode.GENETIC_DATA) break;
if (!isRenderedRemote()) {
contextMenu.setLocation(pick.getPickedPoint(),getParentGLCanvas().getWidth(),getParentGLCanvas().getHeight());
contextMenu.setMasterGLView(this);
}
GeneContextMenuItemContainer geneContextMenuItemContainer=new GeneContextMenuItemContainer();
geneContextMenuItemContainer.setID(EIDType.EXPRESSION_INDEX,iExternalID);
contextMenu.addItemContanier(geneContextMenuItemContainer);
break;
}
if (eSelectionType != ESelectionType.NORMAL) {
ISelectionDelta selectionDelta=null;
SelectionManager selectionManager=null;
selectionManager=contentSelectionManager;
selectionManager.clearSelection(eSelectionType);
selectionManager.addToType(eSelectionType,iExternalID);
selectionDelta=selectionManager.getDelta();
handleConnectedElementRep(selectionDelta);
SelectionUpdateEvent event=new SelectionUpdateEvent();
event.setSender(this);
event.setSelectionDelta((SelectionDelta)selectionDelta);
event.setInfo(getShortInfo());
eventPublisher.triggerEvent(event);
}
break;
case DENDROGRAM_GENE_NODE_SELECTION:
switch (pickingMode) {
case CLICKED:
eSelectionType=ESelectionType.SELECTION;
break;
case DRAGGED:
break;
case MOUSE_OVER:
eSelectionType=ESelectionType.MOUSE_OVER;
break;
}
if (eSelectionType != ESelectionType.NORMAL && tree.getNodeByNumber(iExternalID) != null) {
ClusterNodeSelectionEvent clusterNodeEvent=new ClusterNodeSelectionEvent();
SelectionDelta selectionDeltaClusterNode=new SelectionDelta(EIDType.CLUSTER_NUMBER);
selectionDeltaClusterNode.addSelection(iExternalID,eSelectionType);
clusterNodeEvent.setSelectionDelta(selectionDeltaClusterNode);
eventPublisher.triggerEvent(clusterNodeEvent);
}
break;
case DENDROGRAM_EXPERIMENT_LEAF_SELECTION:
switch (pickingMode) {
case CLICKED:
eSelectionType=ESelectionType.SELECTION;
break;
case DRAGGED:
break;
case MOUSE_OVER:
eSelectionType=ESelectionType.MOUSE_OVER;
break;
case RIGHT_CLICKED:
if (contentSelectionManager.checkStatus(iExternalID) == false && storageSelectionManager.checkStatus(iExternalID) == false) break;
if (!isRenderedRemote()) {
contextMenu.setLocation(pick.getPickedPoint(),getParentGLCanvas().getWidth(),getParentGLCanvas().getHeight());
contextMenu.setMasterGLView(this);
}
ExperimentContextMenuItemContainer experimentContextMenuItemContainer=new ExperimentContextMenuItemContainer();
experimentContextMenuItemContainer.setID(iExternalID);
contextMenu.addItemContanier(experimentContextMenuItemContainer);
break;
}
if (eSelectionType != ESelectionType.NORMAL) {
ISelectionDelta selectionDelta=null;
SelectionManager selectionManager=null;
selectionManager=storageSelectionManager;
selectionManager.clearSelection(eSelectionType);
selectionManager.addToType(eSelectionType,iExternalID);
selectionDelta=selectionManager.getDelta();
handleConnectedElementRep(selectionDelta);
SelectionUpdateEvent event=new SelectionUpdateEvent();
event.setSender(this);
event.setSelectionDelta((SelectionDelta)selectionDelta);
event.setInfo(getShortInfo());
eventPublisher.triggerEvent(event);
setDisplayListDirty();
}
break;
}
}

Fixed version (ground truth):
@Override protected void handleEvents(EPickingType ePickingType,EPickingMode pickingMode,int iExternalID,Pick pick){
  if (detailLevel == EDetailLevel.VERY_LOW) {
    return;
  }
  ESelectionType eSelectionType=ESelectionType.NORMAL;
switch (ePickingType) {
case DENDROGRAM_CUT_SELECTION:
switch (pickingMode) {
case CLICKED:
      break;
case DRAGGED:
    bIsDraggingActive=true;
  setDisplayListDirty();
break;
case MOUSE_OVER:
break;
}
break;
case DENDROGRAM_GENE_LEAF_SELECTION:
switch (pickingMode) {
case CLICKED:
eSelectionType=ESelectionType.SELECTION;
break;
case DRAGGED:
break;
case MOUSE_OVER:
eSelectionType=ESelectionType.MOUSE_OVER;
break;
case RIGHT_CLICKED:
if (contentSelectionManager.checkStatus(iExternalID) == false && storageSelectionManager.checkStatus(iExternalID) == false) break;
if (generalManager.getUseCase().getUseCaseMode() != EUseCaseMode.GENETIC_DATA) break;
if (!isRenderedRemote()) {
contextMenu.setLocation(pick.getPickedPoint(),getParentGLCanvas().getWidth(),getParentGLCanvas().getHeight());
contextMenu.setMasterGLView(this);
}
GeneContextMenuItemContainer geneContextMenuItemContainer=new GeneContextMenuItemContainer();
geneContextMenuItemContainer.setID(EIDType.EXPRESSION_INDEX,iExternalID);
contextMenu.addItemContanier(geneContextMenuItemContainer);
break;
}
if (eSelectionType != ESelectionType.NORMAL) {
resetAllTreeSelections();
if (tree.getNodeByNumber(iExternalID) != null) tree.getNodeByNumber(iExternalID).setSelectionType(eSelectionType);
ISelectionDelta selectionDelta=null;
SelectionManager selectionManager=null;
selectionManager=contentSelectionManager;
selectionManager.clearSelection(eSelectionType);
selectionManager.addToType(eSelectionType,iExternalID);
selectionDelta=selectionManager.getDelta();
handleConnectedElementRep(selectionDelta);
SelectionUpdateEvent event=new SelectionUpdateEvent();
event.setSender(this);
event.setSelectionDelta((SelectionDelta)selectionDelta);
event.setInfo(getShortInfo());
eventPublisher.triggerEvent(event);
setDisplayListDirty();
}
break;
case DENDROGRAM_GENE_NODE_SELECTION:
switch (pickingMode) {
case CLICKED:
eSelectionType=ESelectionType.SELECTION;
break;
case DRAGGED:
break;
case MOUSE_OVER:
eSelectionType=ESelectionType.MOUSE_OVER;
break;
}
if (eSelectionType != ESelectionType.NORMAL && tree.getNodeByNumber(iExternalID) != null) {
resetAllTreeSelections();
tree.getNodeByNumber(iExternalID).setSelectionType(eSelectionType);
ClusterNodeSelectionEvent clusterNodeEvent=new ClusterNodeSelectionEvent();
SelectionDelta selectionDeltaClusterNode=new SelectionDelta(EIDType.CLUSTER_NUMBER);
selectionDeltaClusterNode.addSelection(iExternalID,eSelectionType);
clusterNodeEvent.setSelectionDelta(selectionDeltaClusterNode);
eventPublisher.triggerEvent(clusterNodeEvent);
}
break;
case DENDROGRAM_EXPERIMENT_LEAF_SELECTION:
switch (pickingMode) {
case CLICKED:
eSelectionType=ESelectionType.SELECTION;
break;
case DRAGGED:
break;
case MOUSE_OVER:
eSelectionType=ESelectionType.MOUSE_OVER;
break;
case RIGHT_CLICKED:
if (contentSelectionManager.checkStatus(iExternalID) == false && storageSelectionManager.checkStatus(iExternalID) == false) break;
if (!isRenderedRemote()) {
contextMenu.setLocation(pick.getPickedPoint(),getParentGLCanvas().getWidth(),getParentGLCanvas().getHeight());
contextMenu.setMasterGLView(this);
}
ExperimentContextMenuItemContainer experimentContextMenuItemContainer=new ExperimentContextMenuItemContainer();
experimentContextMenuItemContainer.setID(iExternalID);
contextMenu.addItemContanier(experimentContextMenuItemContainer);
break;
}
if (eSelectionType != ESelectionType.NORMAL) {
resetAllTreeSelections();
if (tree.getNodeByNumber(iExternalID) != null) tree.getNodeByNumber(iExternalID).setSelectionType(eSelectionType);
ISelectionDelta selectionDelta=null;
SelectionManager selectionManager=null;
selectionManager=storageSelectionManager;
selectionManager.clearSelection(eSelectionType);
selectionManager.addToType(eSelectionType,iExternalID);
selectionDelta=selectionManager.getDelta();
handleConnectedElementRep(selectionDelta);
SelectionUpdateEvent event=new SelectionUpdateEvent();
event.setSender(this);
event.setSelectionDelta((SelectionDelta)selectionDelta);
event.setInfo(getShortInfo());
eventPublisher.triggerEvent(event);
setDisplayListDirty();
}
break;
}
}