Program: 58238
Project: 58238
Buggy source:
@Override protected void handlePickingEvents(EPickingType ePickingType,EPickingMode pickingMode,int iExternalID,Pick pick){
  if (detailLevel == EDetailLevel.VERY_LOW) {
    return;
  }
  SelectionType selectionType=SelectionType.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:
selectionType=SelectionType.SELECTION;
break;
case DRAGGED:
break;
case MOUSE_OVER:
selectionType=SelectionType.MOUSE_OVER;
break;
case RIGHT_CLICKED:
ClusterNode leafNode=tree.getNodeByNumber(iExternalID);
if (contentSelectionManager.checkStatus(leafNode.getLeafID()) == false && storageSelectionManager.checkStatus(leafNode.getLeafID()) == false) break;
if (!dataDomain.getDataDomainType().equals("String_Node_Str")) break;
if (!isRenderedRemote()) {
contextMenu.setLocation(pick.getPickedPoint(),getParentGLCanvas().getWidth(),getParentGLCanvas().getHeight());
contextMenu.setMasterGLView(this);
}
ContentContextMenuItemContainer geneContextMenuItemContainer=new ContentContextMenuItemContainer();
geneContextMenuItemContainer.setID(EIDType.EXPRESSION_INDEX,leafNode.getLeafID());
contextMenu.addItemContanier(geneContextMenuItemContainer);
break;
}
if (selectionType != SelectionType.NORMAL) {
resetAllTreeSelections();
if (tree.getNodeByNumber(iExternalID) != null) tree.getNodeByNumber(iExternalID).setSelectionType(selectionType);
ISelectionDelta selectionDelta=null;
VABasedSelectionManager selectionManager=null;
selectionManager=contentSelectionManager;
selectionManager.clearSelection(selectionType);
selectionManager.addToType(selectionType,tree.getNodeByNumber(iExternalID).getLeafID());
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:
selectionType=SelectionType.SELECTION;
break;
case DRAGGED:
break;
case MOUSE_OVER:
selectionType=SelectionType.MOUSE_OVER;
break;
}
if (selectionType != SelectionType.NORMAL && tree.getNodeByNumber(iExternalID) != null) {
resetAllTreeSelections();
tree.getNodeByNumber(iExternalID).setSelectionType(selectionType);
ClusterNodeSelectionEvent clusterNodeEvent=new ClusterNodeSelectionEvent();
SelectionDelta selectionDeltaClusterNode=new SelectionDelta(EIDType.CLUSTER_NUMBER);
selectionDeltaClusterNode.addSelection(iExternalID,selectionType);
clusterNodeEvent.setSelectionDelta(selectionDeltaClusterNode);
eventPublisher.triggerEvent(clusterNodeEvent);
}
break;
case DENDROGRAM_EXPERIMENT_LEAF_SELECTION:
switch (pickingMode) {
case CLICKED:
selectionType=SelectionType.SELECTION;
break;
case DRAGGED:
break;
case MOUSE_OVER:
selectionType=SelectionType.MOUSE_OVER;
break;
case RIGHT_CLICKED:
ClusterNode leafNode=tree.getNodeByNumber(iExternalID);
if (contentSelectionManager.checkStatus(leafNode.getLeafID()) == false && storageSelectionManager.checkStatus(leafNode.getLeafID()) == false) break;
if (!isRenderedRemote()) {
contextMenu.setLocation(pick.getPickedPoint(),getParentGLCanvas().getWidth(),getParentGLCanvas().getHeight());
contextMenu.setMasterGLView(this);
}
ExperimentContextMenuItemContainer experimentContextMenuItemContainer=new ExperimentContextMenuItemContainer();
experimentContextMenuItemContainer.setID(leafNode.getLeafID());
contextMenu.addItemContanier(experimentContextMenuItemContainer);
break;
}
if (selectionType != SelectionType.NORMAL) {
resetAllTreeSelections();
if (tree.getNodeByNumber(iExternalID) != null) tree.getNodeByNumber(iExternalID).setSelectionType(selectionType);
ISelectionDelta selectionDelta=null;
VABasedSelectionManager selectionManager=null;
selectionManager=storageSelectionManager;
selectionManager.clearSelection(selectionType);
selectionManager.addToType(selectionType,tree.getNodeByNumber(iExternalID).getLeafID());
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 handlePickingEvents(EPickingType ePickingType,EPickingMode pickingMode,int iExternalID,Pick pick){
  if (detailLevel == EDetailLevel.VERY_LOW) {
    return;
  }
  SelectionType selectionType=SelectionType.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:
selectionType=SelectionType.SELECTION;
break;
case DRAGGED:
break;
case MOUSE_OVER:
selectionType=SelectionType.MOUSE_OVER;
break;
case RIGHT_CLICKED:
ClusterNode leafNode=tree.getNodeByNumber(iExternalID);
if (contentSelectionManager.checkStatus(leafNode.getLeafID()) == false && storageSelectionManager.checkStatus(leafNode.getLeafID()) == false) break;
if (!dataDomain.getDataDomainType().equals("String_Node_Str")) break;
if (!isRenderedRemote()) {
contextMenu.setLocation(pick.getPickedPoint(),getParentGLCanvas().getWidth(),getParentGLCanvas().getHeight());
contextMenu.setMasterGLView(this);
}
ContentContextMenuItemContainer geneContextMenuItemContainer=new ContentContextMenuItemContainer();
geneContextMenuItemContainer.setID(contentIDType,leafNode.getLeafID());
contextMenu.addItemContanier(geneContextMenuItemContainer);
break;
}
if (selectionType != SelectionType.NORMAL) {
resetAllTreeSelections();
if (tree.getNodeByNumber(iExternalID) != null) tree.getNodeByNumber(iExternalID).setSelectionType(selectionType);
ISelectionDelta selectionDelta=null;
VABasedSelectionManager selectionManager=null;
selectionManager=contentSelectionManager;
selectionManager.clearSelection(selectionType);
selectionManager.addToType(selectionType,tree.getNodeByNumber(iExternalID).getLeafID());
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:
selectionType=SelectionType.SELECTION;
break;
case DRAGGED:
break;
case MOUSE_OVER:
selectionType=SelectionType.MOUSE_OVER;
break;
}
if (selectionType != SelectionType.NORMAL && tree.getNodeByNumber(iExternalID) != null) {
resetAllTreeSelections();
tree.getNodeByNumber(iExternalID).setSelectionType(selectionType);
ClusterNodeSelectionEvent clusterNodeEvent=new ClusterNodeSelectionEvent();
SelectionDelta selectionDeltaClusterNode=new SelectionDelta(EIDType.CLUSTER_NUMBER);
selectionDeltaClusterNode.addSelection(iExternalID,selectionType);
clusterNodeEvent.setSelectionDelta(selectionDeltaClusterNode);
eventPublisher.triggerEvent(clusterNodeEvent);
}
break;
case DENDROGRAM_EXPERIMENT_LEAF_SELECTION:
switch (pickingMode) {
case CLICKED:
selectionType=SelectionType.SELECTION;
break;
case DRAGGED:
break;
case MOUSE_OVER:
selectionType=SelectionType.MOUSE_OVER;
break;
case RIGHT_CLICKED:
ClusterNode leafNode=tree.getNodeByNumber(iExternalID);
if (contentSelectionManager.checkStatus(leafNode.getLeafID()) == false && storageSelectionManager.checkStatus(leafNode.getLeafID()) == false) break;
if (!isRenderedRemote()) {
contextMenu.setLocation(pick.getPickedPoint(),getParentGLCanvas().getWidth(),getParentGLCanvas().getHeight());
contextMenu.setMasterGLView(this);
}
ExperimentContextMenuItemContainer experimentContextMenuItemContainer=new ExperimentContextMenuItemContainer();
experimentContextMenuItemContainer.setID(leafNode.getLeafID());
contextMenu.addItemContanier(experimentContextMenuItemContainer);
break;
}
if (selectionType != SelectionType.NORMAL) {
resetAllTreeSelections();
if (tree.getNodeByNumber(iExternalID) != null) tree.getNodeByNumber(iExternalID).setSelectionType(selectionType);
ISelectionDelta selectionDelta=null;
VABasedSelectionManager selectionManager=null;
selectionManager=storageSelectionManager;
selectionManager.clearSelection(selectionType);
selectionManager.addToType(selectionType,tree.getNodeByNumber(iExternalID).getLeafID());
selectionDelta=selectionManager.getDelta();
handleConnectedElementRep(selectionDelta);
SelectionUpdateEvent event=new SelectionUpdateEvent();
event.setSender(this);
event.setSelectionDelta((SelectionDelta)selectionDelta);
event.setInfo(getShortInfo());
eventPublisher.triggerEvent(event);
setDisplayListDirty();
}
break;
}
}