Program: 58371
Project: 58371
Buggy source:
@Override protected void handlePickingEvents(EPickingType ePickingType,EPickingMode pickingMode,int iExternalID,Pick pick){
  if (detailLevel == EDetailLevel.VERY_LOW) {
    return;
  }
  SelectionType selectionType;
switch (ePickingType) {
case HEAT_MAP_LINE_SELECTION:
    iCurrentMouseOverElement=iExternalID;
switch (pickingMode) {
case CLICKED:
    selectionType=SelectionType.SELECTION;
  setActive(true);
break;
case MOUSE_OVER:
selectionType=SelectionType.MOUSE_OVER;
break;
case RIGHT_CLICKED:
selectionType=SelectionType.SELECTION;
if (generalManager.getUseCase(dataDomain).getDataDomain() != EDataDomain.GENETIC_DATA) break;
if (!isRenderedRemote()) {
contextMenu.setLocation(pick.getPickedPoint(),getParentGLCanvas().getWidth(),getParentGLCanvas().getHeight());
contextMenu.setMasterGLView(this);
}
ContentContextMenuItemContainer geneContextMenuItemContainer=new ContentContextMenuItemContainer();
geneContextMenuItemContainer.setID(EIDType.EXPRESSION_INDEX,iExternalID);
contextMenu.addItemContanier(geneContextMenuItemContainer);
default :
return;
}
createContentSelection(selectionType,iExternalID);
break;
case HEAT_MAP_STORAGE_SELECTION:
switch (pickingMode) {
case CLICKED:
selectionType=SelectionType.SELECTION;
break;
case MOUSE_OVER:
selectionType=SelectionType.MOUSE_OVER;
break;
case RIGHT_CLICKED:
if (!isRenderedRemote()) {
contextMenu.setLocation(pick.getPickedPoint(),getParentGLCanvas().getWidth(),getParentGLCanvas().getHeight());
contextMenu.setMasterGLView(this);
}
ExperimentContextMenuItemContainer experimentContextMenuItemContainer=new ExperimentContextMenuItemContainer();
experimentContextMenuItemContainer.setID(iExternalID);
contextMenu.addItemContanier(experimentContextMenuItemContainer);
default :
return;
}
createStorageSelection(selectionType,iExternalID);
break;
case HEAT_MAP_HIDE_HIDDEN_ELEMENTS:
if (pickingMode == EPickingMode.CLICKED) if (hideElements) hideElements=false;
 else hideElements=true;
setDisplayListDirty();
break;
case HEAT_MAP_SHOW_CAPTIONS:
if (pickingMode == EPickingMode.CLICKED) if (showCaptions) showCaptions=false;
 else {
showCaptions=true;
}
template.recalculateSpacings();
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;
switch (ePickingType) {
case HEAT_MAP_LINE_SELECTION:
    iCurrentMouseOverElement=iExternalID;
switch (pickingMode) {
case CLICKED:
    selectionType=SelectionType.SELECTION;
  setActive(true);
break;
case MOUSE_OVER:
selectionType=SelectionType.MOUSE_OVER;
break;
case RIGHT_CLICKED:
selectionType=SelectionType.SELECTION;
if (generalManager.getUseCase(dataDomain).getDataDomain() != EDataDomain.GENETIC_DATA) break;
if (!isRenderedRemote()) {
contextMenu.setLocation(pick.getPickedPoint(),getParentGLCanvas().getWidth(),getParentGLCanvas().getHeight());
contextMenu.setMasterGLView(this);
}
ContentContextMenuItemContainer geneContextMenuItemContainer=new ContentContextMenuItemContainer();
geneContextMenuItemContainer.setID(EIDType.EXPRESSION_INDEX,iExternalID);
contextMenu.addItemContanier(geneContextMenuItemContainer);
default :
return;
}
createContentSelection(selectionType,iExternalID);
break;
case HEAT_MAP_STORAGE_SELECTION:
switch (pickingMode) {
case CLICKED:
selectionType=SelectionType.SELECTION;
break;
case MOUSE_OVER:
selectionType=SelectionType.MOUSE_OVER;
break;
case RIGHT_CLICKED:
if (!isRenderedRemote()) {
contextMenu.setLocation(pick.getPickedPoint(),getParentGLCanvas().getWidth(),getParentGLCanvas().getHeight());
contextMenu.setMasterGLView(this);
}
ExperimentContextMenuItemContainer experimentContextMenuItemContainer=new ExperimentContextMenuItemContainer();
experimentContextMenuItemContainer.setID(iExternalID);
contextMenu.addItemContanier(experimentContextMenuItemContainer);
default :
return;
}
createStorageSelection(selectionType,iExternalID);
break;
case HEAT_MAP_HIDE_HIDDEN_ELEMENTS:
if (pickingMode == EPickingMode.CLICKED) if (hideElements) hideElements=false;
 else hideElements=true;
HideHeatMapElementsEvent event=new HideHeatMapElementsEvent(hideElements);
event.setSender(this);
eventPublisher.triggerEvent(event);
setDisplayListDirty();
break;
case HEAT_MAP_SHOW_CAPTIONS:
if (pickingMode == EPickingMode.CLICKED) if (showCaptions) showCaptions=false;
 else {
showCaptions=true;
}
template.recalculateSpacings();
setDisplayListDirty();
break;
}
}