Program: 57945
Project: 57945
Buggy source:
@Override protected void handlePickingEvents(final PickingType pickingType,final PickingMode pickingMode,final int pickingID,final Pick pick){
  if (detailLevel == DetailLevel.VERY_LOW || bIsDraggingActive || bWasAxisMoved) {
    return;
  }
  SelectionType selectionType;
switch (pickingType) {
case PCS_VIEW_SELECTION:
    break;
case POLYLINE_SELECTION:
switch (pickingMode) {
case CLICKED:
    selectionType=SelectionType.SELECTION;
  if (bAngularBrushingSelectPolyline) {
    bAngularBrushingSelectPolyline=false;
    bIsAngularBrushingActive=true;
    iSelectedLineID=pickingID;
    linePick=pick;
    bIsAngularBrushingFirstTime=true;
  }
break;
case MOUSE_OVER:
selectionType=SelectionType.MOUSE_OVER;
break;
case RIGHT_CLICKED:
selectionType=SelectionType.SELECTION;
RecordContextMenuItemContainer recordContextMenuItemContainer=new RecordContextMenuItemContainer();
recordContextMenuItemContainer.setDataDomain(dataDomain);
recordContextMenuItemContainer.tableID(recordIDType,pickingID);
contextMenu.addItemContanier(recordContextMenuItemContainer);
if (!isRenderedRemote()) {
contextMenu.setLocation(pick.getPickedPoint(),getParentGLCanvas().getWidth(),getParentGLCanvas().getHeight());
contextMenu.setMasterGLView(this);
}
break;
default :
return;
}
if (recordSelectionManager.checkStatus(selectionType,pickingID)) {
break;
}
connectedElementRepresentationManager.clear(recordSelectionManager.getIDType(),selectionType);
recordSelectionManager.clearSelection(selectionType);
recordSelectionManager.addToType(selectionType,pickingID);
recordSelectionManager.addConnectionID(generalManager.getIDCreator().createID(ManagedObjectType.CONNECTION),pickingID);
if (!bAngularBrushingSelectPolyline) {
ISelectionDelta selectionDelta=recordSelectionManager.getDelta();
handleConnectedElementReps(selectionDelta);
SelectionUpdateEvent event=new SelectionUpdateEvent();
event.setSender(this);
event.setDataDomainID(dataDomain.getDataDomainID());
event.setSelectionDelta((SelectionDelta)selectionDelta);
event.setInfo(getShortInfoLocal());
eventPublisher.triggerEvent(event);
}
setDisplayListDirty();
break;
case X_AXIS_SELECTION:
break;
case Y_AXIS_SELECTION:
switch (pickingMode) {
case CLICKED:
selectionType=SelectionType.SELECTION;
break;
case MOUSE_OVER:
selectionType=SelectionType.MOUSE_OVER;
break;
case RIGHT_CLICKED:
selectionType=SelectionType.SELECTION;
if (!isRenderedRemote()) {
contextMenu.setLocation(pick.getPickedPoint(),getParentGLCanvas().getWidth(),getParentGLCanvas().getHeight());
contextMenu.setMasterGLView(this);
}
DimensionContextMenuItemContainer experimentContextMenuItemContainer=new DimensionContextMenuItemContainer();
experimentContextMenuItemContainer.setDataDomain(dataDomain);
experimentContextMenuItemContainer.tableID(dimensionIDType,pickingID);
contextMenu.addItemContanier(experimentContextMenuItemContainer);
default :
return;
}
dimensionSelectionManager.clearSelection(selectionType);
dimensionSelectionManager.addToType(selectionType,pickingID);
dimensionSelectionManager.addConnectionID(generalManager.getIDCreator().createID(ManagedObjectType.CONNECTION),pickingID);
connectedElementRepresentationManager.clear(dimensionSelectionManager.getIDType(),selectionType);
ISelectionDelta selectionDelta=dimensionSelectionManager.getDelta();
handleConnectedElementReps(selectionDelta);
SelectionUpdateEvent event=new SelectionUpdateEvent();
event.setSender(this);
event.setDataDomainID(dataDomain.getDataDomainID());
event.setSelectionDelta((SelectionDelta)selectionDelta);
eventPublisher.triggerEvent(event);
setDisplayListDirty();
break;
case GATE_TIP_SELECTION:
switch (pickingMode) {
case MOUSE_OVER:
iDraggedGateNumber=pickingID;
draggedObject=PickingType.GATE_TIP_SELECTION;
setDisplayListDirty();
break;
case CLICKED:
bIsDraggingActive=true;
draggedObject=PickingType.GATE_TIP_SELECTION;
iDraggedGateNumber=pickingID;
break;
}
break;
case GATE_BOTTOM_SELECTION:
switch (pickingMode) {
case MOUSE_OVER:
iDraggedGateNumber=pickingID;
draggedObject=PickingType.GATE_BOTTOM_SELECTION;
setDisplayListDirty();
break;
case CLICKED:
bIsDraggingActive=true;
draggedObject=PickingType.GATE_BOTTOM_SELECTION;
iDraggedGateNumber=pickingID;
break;
}
break;
case GATE_BODY_SELECTION:
switch (pickingMode) {
case MOUSE_OVER:
iDraggedGateNumber=pickingID;
draggedObject=PickingType.GATE_BODY_SELECTION;
setDisplayListDirty();
break;
case CLICKED:
bIsDraggingActive=true;
bIsGateDraggingFirstTime=true;
draggedObject=PickingType.GATE_BODY_SELECTION;
iDraggedGateNumber=pickingID;
break;
}
break;
case PC_ICON_SELECTION:
switch (pickingMode) {
case CLICKED:
break;
}
break;
case REMOVE_AXIS:
switch (pickingMode) {
case MOUSE_OVER:
dropTexture=EIconTextures.DROP_DELETE;
iChangeDropOnAxisNumber=pickingID;
break;
case CLICKED:
if (dimensionVA.occurencesOf(dimensionVA.get(pickingID)) == 1) {
removeGate(dimensionVA.get(pickingID));
}
Integer dimensionID=dimensionVA.get(pickingID);
dimensionSelectionManager.remove(pickingID);
DimensionVADelta vaDelta=new DimensionVADelta(DataTable.DIMENSION,dimensionIDType);
vaDelta.add(VADeltaItem.remove(pickingID));
triggerDimensionFilterEvent(vaDelta,"String_Node_Str" + dataDomain.getDimensionLabel(dimensionID));
setDisplayListDirty();
resetAxisSpacing();
break;
}
break;
case MOVE_AXIS:
switch (pickingMode) {
case CLICKED:
bWasAxisMoved=true;
bWasAxisDraggedFirstTime=true;
iMovedAxisPosition=pickingID;
setDisplayListDirty();
case MOUSE_OVER:
dropTexture=EIconTextures.DROP_MOVE;
iChangeDropOnAxisNumber=pickingID;
setDisplayListDirty();
break;
}
break;
case DUPLICATE_AXIS:
switch (pickingMode) {
case MOUSE_OVER:
dropTexture=EIconTextures.DROP_DUPLICATE;
iChangeDropOnAxisNumber=pickingID;
break;
case CLICKED:
if (pickingID >= 0) {
DimensionVADelta vaDelta=new DimensionVADelta(DataTable.DIMENSION,dimensionIDType);
vaDelta.add(VADeltaItem.copy(pickingID));
triggerDimensionFilterEvent(vaDelta,"String_Node_Str" + dataDomain.getDimensionLabel(dimensionVA.get(pickingID)));
setDisplayListDirty();
resetAxisSpacing();
break;
}
}
break;
case ADD_GATE:
switch (pickingMode) {
case CLICKED:
hasFilterChanged=true;
AGate gate;
if (table.isSetHomogeneous()) {
gate=new Gate(++iGateCounter,pickingID,(float)table.getRawForNormalized(0),(float)table.getRawForNormalized(0.5f),table,renderStyle);
}
 else {
gate=new NominalGate(++iGateCounter,pickingID,0,0.5f,table,renderStyle);
}
hashGates.put(this.iGateCounter,gate);
hashIsGateBlocking.put(this.iGateCounter,new ArrayList<Integer>());
handleUnselection();
triggerSelectionUpdate();
setDisplayListDirty();
break;
}
break;
case ADD_MASTER_GATE:
switch (pickingMode) {
case CLICKED:
hasFilterChanged=true;
Gate gate=new Gate(++iGateCounter,-1,(float)table.getRawForNormalized(0),(float)table.getRawForNormalized(0.5f),table,renderStyle);
gate.setMasterGate(true);
hashMasterGates.put(iGateCounter,gate);
hashIsGateBlocking.put(iGateCounter,new ArrayList<Integer>());
handleUnselection();
triggerSelectionUpdate();
setDisplayListDirty();
break;
}
break;
case REMOVE_GATE:
switch (pickingMode) {
case CLICKED:
hasFilterChanged=true;
if (hashGates.remove(pickingID) == null) hashMasterGates.remove(pickingID);
hashIsGateBlocking.remove(pickingID);
handleUnselection();
triggerSelectionUpdate();
setDisplayListDirty();
break;
}
break;
case ANGULAR_UPPER:
switch (pickingMode) {
case CLICKED:
bIsAngularDraggingActive=true;
case DRAGGED:
bIsAngularDraggingActive=true;
}
break;
case ANGULAR_LOWER:
switch (pickingMode) {
case CLICKED:
bIsAngularDraggingActive=true;
case DRAGGED:
bIsAngularDraggingActive=true;
}
break;
case REMOVE_NAN:
switch (pickingMode) {
case CLICKED:
hasFilterChanged=true;
if (hashExcludeNAN.containsKey(pickingID)) {
hashExcludeNAN.remove(pickingID);
}
 else {
hashExcludeNAN.put(pickingID,null);
}
setDisplayListDirty();
break;
}
break;
}
}

Fixed version (ground truth):
@Override protected void handlePickingEvents(final PickingType pickingType,final PickingMode pickingMode,final int pickingID,final Pick pick){
  if (detailLevel == DetailLevel.VERY_LOW || bIsDraggingActive || bWasAxisMoved) {
    return;
  }
  SelectionType selectionType;
switch (pickingType) {
case PCS_VIEW_SELECTION:
    break;
case POLYLINE_SELECTION:
switch (pickingMode) {
case CLICKED:
    selectionType=SelectionType.SELECTION;
  if (bAngularBrushingSelectPolyline) {
    bAngularBrushingSelectPolyline=false;
    bIsAngularBrushingActive=true;
    iSelectedLineID=pickingID;
    linePick=pick;
    bIsAngularBrushingFirstTime=true;
  }
break;
case MOUSE_OVER:
selectionType=SelectionType.MOUSE_OVER;
break;
case RIGHT_CLICKED:
selectionType=SelectionType.SELECTION;
RecordContextMenuItemContainer recordContextMenuItemContainer=new RecordContextMenuItemContainer();
recordContextMenuItemContainer.setDataDomain(dataDomain);
recordContextMenuItemContainer.tableID(recordIDType,pickingID);
contextMenu.addItemContanier(recordContextMenuItemContainer);
if (!isRenderedRemote()) {
contextMenu.setLocation(pick.getPickedPoint(),getParentGLCanvas().getWidth(),getParentGLCanvas().getHeight());
contextMenu.setMasterGLView(this);
}
break;
default :
return;
}
if (recordSelectionManager.checkStatus(selectionType,pickingID)) {
break;
}
connectedElementRepresentationManager.clear(recordSelectionManager.getIDType(),selectionType);
recordSelectionManager.clearSelection(selectionType);
recordSelectionManager.addToType(selectionType,pickingID);
recordSelectionManager.addConnectionID(generalManager.getIDCreator().createID(ManagedObjectType.CONNECTION),pickingID);
if (!bAngularBrushingSelectPolyline) {
ISelectionDelta selectionDelta=recordSelectionManager.getDelta();
handleConnectedElementReps(selectionDelta);
SelectionUpdateEvent event=new SelectionUpdateEvent();
event.setSender(this);
event.setDataDomainID(dataDomain.getDataDomainID());
event.setSelectionDelta((SelectionDelta)selectionDelta);
event.setInfo(getShortInfoLocal());
eventPublisher.triggerEvent(event);
}
setDisplayListDirty();
break;
case X_AXIS_SELECTION:
break;
case Y_AXIS_SELECTION:
switch (pickingMode) {
case CLICKED:
selectionType=SelectionType.SELECTION;
break;
case MOUSE_OVER:
selectionType=SelectionType.MOUSE_OVER;
break;
case RIGHT_CLICKED:
selectionType=SelectionType.SELECTION;
if (!isRenderedRemote()) {
contextMenu.setLocation(pick.getPickedPoint(),getParentGLCanvas().getWidth(),getParentGLCanvas().getHeight());
contextMenu.setMasterGLView(this);
}
DimensionContextMenuItemContainer experimentContextMenuItemContainer=new DimensionContextMenuItemContainer();
experimentContextMenuItemContainer.setDataDomain(dataDomain);
experimentContextMenuItemContainer.tableID(dimensionIDType,pickingID);
contextMenu.addItemContanier(experimentContextMenuItemContainer);
default :
return;
}
dimensionSelectionManager.clearSelection(selectionType);
dimensionSelectionManager.addToType(selectionType,pickingID);
dimensionSelectionManager.addConnectionID(generalManager.getIDCreator().createID(ManagedObjectType.CONNECTION),pickingID);
connectedElementRepresentationManager.clear(dimensionSelectionManager.getIDType(),selectionType);
ISelectionDelta selectionDelta=dimensionSelectionManager.getDelta();
handleConnectedElementReps(selectionDelta);
SelectionUpdateEvent event=new SelectionUpdateEvent();
event.setSender(this);
event.setDataDomainID(dataDomain.getDataDomainID());
event.setSelectionDelta((SelectionDelta)selectionDelta);
eventPublisher.triggerEvent(event);
setDisplayListDirty();
break;
case GATE_TIP_SELECTION:
switch (pickingMode) {
case MOUSE_OVER:
iDraggedGateNumber=pickingID;
draggedObject=PickingType.GATE_TIP_SELECTION;
setDisplayListDirty();
break;
case CLICKED:
bIsDraggingActive=true;
draggedObject=PickingType.GATE_TIP_SELECTION;
iDraggedGateNumber=pickingID;
break;
}
break;
case GATE_BOTTOM_SELECTION:
switch (pickingMode) {
case MOUSE_OVER:
iDraggedGateNumber=pickingID;
draggedObject=PickingType.GATE_BOTTOM_SELECTION;
setDisplayListDirty();
break;
case CLICKED:
bIsDraggingActive=true;
draggedObject=PickingType.GATE_BOTTOM_SELECTION;
iDraggedGateNumber=pickingID;
break;
}
break;
case GATE_BODY_SELECTION:
switch (pickingMode) {
case MOUSE_OVER:
iDraggedGateNumber=pickingID;
draggedObject=PickingType.GATE_BODY_SELECTION;
setDisplayListDirty();
break;
case CLICKED:
bIsDraggingActive=true;
bIsGateDraggingFirstTime=true;
draggedObject=PickingType.GATE_BODY_SELECTION;
iDraggedGateNumber=pickingID;
break;
}
break;
case PC_ICON_SELECTION:
switch (pickingMode) {
case CLICKED:
break;
}
break;
case REMOVE_AXIS:
switch (pickingMode) {
case MOUSE_OVER:
dropTexture=EIconTextures.DROP_DELETE;
iChangeDropOnAxisNumber=pickingID;
break;
case CLICKED:
if (dimensionVA.occurencesOf(dimensionVA.get(pickingID)) == 1) {
removeGate(dimensionVA.get(pickingID));
}
DimensionVADelta vaDelta=new DimensionVADelta(DataTable.DIMENSION,dimensionIDType);
vaDelta.add(VADeltaItem.remove(pickingID));
Integer dimensionID=dimensionVA.get(pickingID);
triggerDimensionFilterEvent(vaDelta,"String_Node_Str" + dataDomain.getDimensionLabel(dimensionID));
setDisplayListDirty();
resetAxisSpacing();
break;
}
break;
case MOVE_AXIS:
switch (pickingMode) {
case CLICKED:
bWasAxisMoved=true;
bWasAxisDraggedFirstTime=true;
iMovedAxisPosition=pickingID;
setDisplayListDirty();
case MOUSE_OVER:
dropTexture=EIconTextures.DROP_MOVE;
iChangeDropOnAxisNumber=pickingID;
setDisplayListDirty();
break;
}
break;
case DUPLICATE_AXIS:
switch (pickingMode) {
case MOUSE_OVER:
dropTexture=EIconTextures.DROP_DUPLICATE;
iChangeDropOnAxisNumber=pickingID;
break;
case CLICKED:
if (pickingID >= 0) {
DimensionVADelta vaDelta=new DimensionVADelta(DataTable.DIMENSION,dimensionIDType);
vaDelta.add(VADeltaItem.copy(pickingID));
triggerDimensionFilterEvent(vaDelta,"String_Node_Str" + dataDomain.getDimensionLabel(dimensionVA.get(pickingID)));
setDisplayListDirty();
resetAxisSpacing();
break;
}
}
break;
case ADD_GATE:
switch (pickingMode) {
case CLICKED:
hasFilterChanged=true;
AGate gate;
if (table.isSetHomogeneous()) {
gate=new Gate(++iGateCounter,pickingID,(float)table.getRawForNormalized(0),(float)table.getRawForNormalized(0.5f),table,renderStyle);
}
 else {
gate=new NominalGate(++iGateCounter,pickingID,0,0.5f,table,renderStyle);
}
hashGates.put(this.iGateCounter,gate);
hashIsGateBlocking.put(this.iGateCounter,new ArrayList<Integer>());
handleUnselection();
triggerSelectionUpdate();
setDisplayListDirty();
break;
}
break;
case ADD_MASTER_GATE:
switch (pickingMode) {
case CLICKED:
hasFilterChanged=true;
Gate gate=new Gate(++iGateCounter,-1,(float)table.getRawForNormalized(0),(float)table.getRawForNormalized(0.5f),table,renderStyle);
gate.setMasterGate(true);
hashMasterGates.put(iGateCounter,gate);
hashIsGateBlocking.put(iGateCounter,new ArrayList<Integer>());
handleUnselection();
triggerSelectionUpdate();
setDisplayListDirty();
break;
}
break;
case REMOVE_GATE:
switch (pickingMode) {
case CLICKED:
hasFilterChanged=true;
if (hashGates.remove(pickingID) == null) hashMasterGates.remove(pickingID);
hashIsGateBlocking.remove(pickingID);
handleUnselection();
triggerSelectionUpdate();
setDisplayListDirty();
break;
}
break;
case ANGULAR_UPPER:
switch (pickingMode) {
case CLICKED:
bIsAngularDraggingActive=true;
case DRAGGED:
bIsAngularDraggingActive=true;
}
break;
case ANGULAR_LOWER:
switch (pickingMode) {
case CLICKED:
bIsAngularDraggingActive=true;
case DRAGGED:
bIsAngularDraggingActive=true;
}
break;
case REMOVE_NAN:
switch (pickingMode) {
case CLICKED:
hasFilterChanged=true;
if (hashExcludeNAN.containsKey(pickingID)) {
hashExcludeNAN.remove(pickingID);
}
 else {
hashExcludeNAN.put(pickingID,null);
}
setDisplayListDirty();
break;
}
break;
}
}