Program: 58969
Project: 58969
Buggy source:
@Override protected void handleEvents(final EPickingType ePickingType,final EPickingMode ePickingMode,final int iExternalID,final Pick pick){
  if (detailLevel == EDetailLevel.VERY_LOW || bIsDraggingActive || bWasAxisMoved) {
    pickingManager.flushHits(iUniqueID,ePickingType);
    return;
  }
  ESelectionType eSelectionType;
switch (ePickingType) {
case POLYLINE_SELECTION:
switch (ePickingMode) {
case DOUBLE_CLICKED:
      IDListEventContainer<Integer> idListEventContainer=new IDListEventContainer<Integer>(EEventType.LOAD_PATHWAY_BY_GENE,EIDType.REFSEQ_MRNA_INT);
    idListEventContainer.addID(getRefSeqFromStorageIndex(iExternalID));
  triggerEvent(EMediatorType.SELECTION_MEDIATOR,idListEventContainer);
case CLICKED:
eSelectionType=ESelectionType.SELECTION;
if (bAngularBrushingSelectPolyline) {
bAngularBrushingSelectPolyline=false;
bIsAngularBrushingActive=true;
iSelectedLineID=iExternalID;
linePick=pick;
bIsAngularBrushingFirstTime=true;
}
break;
case MOUSE_OVER:
eSelectionType=ESelectionType.MOUSE_OVER;
break;
default :
pickingManager.flushHits(iUniqueID,ePickingType);
return;
}
connectedElementRepresentationManager.clear(ePolylineDataType);
polylineSelectionManager.clearSelection(eSelectionType);
if (ePolylineDataType == EIDType.EXPRESSION_INDEX) {
Integer iRefSeqID=idMappingManager.getID(EMappingType.EXPRESSION_INDEX_2_REFSEQ_MRNA_INT,iExternalID);
for (Object iExpressionIndex : idMappingManager.getMultiID(EMappingType.REFSEQ_MRNA_INT_2_EXPRESSION_INDEX,iRefSeqID)) {
contentSelectionManager.addToType(eSelectionType,(Integer)iExpressionIndex);
}
}
 else {
polylineSelectionManager.addToType(eSelectionType,iExternalID);
}
polylineSelectionManager.addConnectionID(generalManager.getIDManager().createID(EManagedObjectType.CONNECTION),iExternalID);
if (ePolylineDataType == EIDType.EXPRESSION_INDEX && !bAngularBrushingSelectPolyline) {
triggerEvent(EMediatorType.SELECTION_MEDIATOR,new SelectionCommandEventContainer(EIDType.REFSEQ_MRNA_INT,new SelectionCommand(ESelectionCommandType.CLEAR,eSelectionType)));
ISelectionDelta selectionDelta=contentSelectionManager.getDelta();
handleConnectedElementRep(selectionDelta);
triggerEvent(EMediatorType.SELECTION_MEDIATOR,new DeltaEventContainer<ISelectionDelta>(selectionDelta));
}
setDisplayListDirty();
pickingManager.flushHits(iUniqueID,ePickingType);
break;
case X_AXIS_SELECTION:
pickingManager.flushHits(iUniqueID,ePickingType);
break;
case Y_AXIS_SELECTION:
switch (ePickingMode) {
case CLICKED:
eSelectionType=ESelectionType.SELECTION;
break;
case MOUSE_OVER:
eSelectionType=ESelectionType.MOUSE_OVER;
break;
default :
pickingManager.flushHits(iUniqueID,ePickingType);
return;
}
axisSelectionManager.clearSelection(eSelectionType);
axisSelectionManager.addToType(eSelectionType,iExternalID);
axisSelectionManager.addConnectionID(generalManager.getIDManager().createID(EManagedObjectType.CONNECTION),iExternalID);
connectedElementRepresentationManager.clear(eAxisDataType);
triggerEvent(EMediatorType.SELECTION_MEDIATOR,new SelectionCommandEventContainer(eAxisDataType,new SelectionCommand(ESelectionCommandType.CLEAR,eSelectionType)));
ISelectionDelta selectionDelta=axisSelectionManager.getDelta();
if (eAxisDataType == EIDType.EXPRESSION_INDEX) {
handleConnectedElementRep(selectionDelta);
}
triggerEvent(EMediatorType.SELECTION_MEDIATOR,new DeltaEventContainer<ISelectionDelta>(selectionDelta));
rePosition(iExternalID);
setDisplayListDirty();
pickingManager.flushHits(iUniqueID,ePickingType);
break;
case LOWER_GATE_TIP_SELECTION:
switch (ePickingMode) {
case MOUSE_OVER:
bIsGateMouseOver=true;
iDraggedGateNumber=iExternalID;
draggedObject=EPickingType.LOWER_GATE_TIP_SELECTION;
setDisplayListDirty();
break;
case CLICKED:
bIsDraggingActive=true;
draggedObject=EPickingType.LOWER_GATE_TIP_SELECTION;
iDraggedGateNumber=iExternalID;
break;
}
pickingManager.flushHits(iUniqueID,ePickingType);
break;
case LOWER_GATE_BOTTOM_SELECTION:
switch (ePickingMode) {
case MOUSE_OVER:
bIsGateMouseOver=true;
iDraggedGateNumber=iExternalID;
draggedObject=EPickingType.LOWER_GATE_BOTTOM_SELECTION;
setDisplayListDirty();
break;
case CLICKED:
bIsDraggingActive=true;
draggedObject=EPickingType.LOWER_GATE_BOTTOM_SELECTION;
iDraggedGateNumber=iExternalID;
break;
}
pickingManager.flushHits(iUniqueID,ePickingType);
break;
case LOWER_GATE_BODY_SELECTION:
switch (ePickingMode) {
case MOUSE_OVER:
bIsGateMouseOver=true;
iDraggedGateNumber=iExternalID;
draggedObject=EPickingType.LOWER_GATE_BODY_SELECTION;
setDisplayListDirty();
break;
case CLICKED:
bIsDraggingActive=true;
bIsGateDraggingFirstTime=true;
draggedObject=EPickingType.LOWER_GATE_BODY_SELECTION;
iDraggedGateNumber=iExternalID;
break;
}
pickingManager.flushHits(iUniqueID,ePickingType);
break;
case PC_ICON_SELECTION:
switch (ePickingMode) {
case CLICKED:
break;
}
pickingManager.flushHits(iUniqueID,EPickingType.PC_ICON_SELECTION);
break;
case REMOVE_AXIS:
IVirtualArray axisVA=set.getVA(iAxisVAID);
switch (ePickingMode) {
case CLICKED:
if (axisVA.containsElement(axisVA.get(iExternalID)) == 1) hashGates.remove(axisVA.get(iExternalID));
axisVA.remove(iExternalID);
IVirtualArrayDelta vaDelta=new VirtualArrayDelta(EIDType.EXPERIMENT_INDEX);
vaDelta.add(VADeltaItem.remove(iExternalID));
generalManager.getEventPublisher().triggerEvent(EMediatorType.SELECTION_MEDIATOR,this,new DeltaEventContainer<IVirtualArrayDelta>(vaDelta));
setDisplayListDirty();
resetAxisSpacing();
break;
}
pickingManager.flushHits(iUniqueID,EPickingType.REMOVE_AXIS);
break;
case MOVE_AXIS_LEFT:
switch (ePickingMode) {
case CLICKED:
if (iExternalID > 0) {
bWasAxisMoved=true;
bWasAxisDraggedFirstTime=true;
iMovedAxisPosition=iExternalID;
setDisplayListDirty();
}
break;
}
pickingManager.flushHits(iUniqueID,EPickingType.MOVE_AXIS_LEFT);
break;
case MOVE_AXIS_RIGHT:
switch (ePickingMode) {
case CLICKED:
resetAxisSpacing();
setDisplayListDirty();
break;
}
pickingManager.flushHits(iUniqueID,EPickingType.MOVE_AXIS_RIGHT);
break;
case DUPLICATE_AXIS:
switch (ePickingMode) {
case CLICKED:
if (iExternalID > 0) {
set.getVA(iAxisVAID).copy(iExternalID);
IVirtualArrayDelta vaDelta=new VirtualArrayDelta(EIDType.EXPERIMENT_INDEX);
vaDelta.add(VADeltaItem.copy(iExternalID));
generalManager.getEventPublisher().triggerEvent(EMediatorType.SELECTION_MEDIATOR,this,new DeltaEventContainer<IVirtualArrayDelta>(vaDelta));
setDisplayListDirty();
resetAxisSpacing();
break;
}
}
pickingManager.flushHits(iUniqueID,EPickingType.DUPLICATE_AXIS);
break;
case ANGULAR_UPPER:
switch (ePickingMode) {
case CLICKED:
bIsAngularDraggingActive=true;
case DRAGGED:
bIsAngularDraggingActive=true;
}
pickingManager.flushHits(iUniqueID,EPickingType.ANGULAR_UPPER);
break;
case ANGULAR_LOWER:
switch (ePickingMode) {
case CLICKED:
bIsAngularDraggingActive=true;
case DRAGGED:
bIsAngularDraggingActive=true;
}
break;
}
}

Fixed version (ground truth):
@Override protected void handleEvents(final EPickingType ePickingType,final EPickingMode ePickingMode,final int iExternalID,final Pick pick){
  if (detailLevel == EDetailLevel.VERY_LOW || bIsDraggingActive || bWasAxisMoved) {
    pickingManager.flushHits(iUniqueID,ePickingType);
    return;
  }
  ESelectionType eSelectionType;
switch (ePickingType) {
case POLYLINE_SELECTION:
switch (ePickingMode) {
case DOUBLE_CLICKED:
      IDListEventContainer<Integer> idListEventContainer=new IDListEventContainer<Integer>(EEventType.LOAD_PATHWAY_BY_GENE,EIDType.REFSEQ_MRNA_INT);
    idListEventContainer.addID(getRefSeqFromStorageIndex(iExternalID));
  triggerEvent(EMediatorType.SELECTION_MEDIATOR,idListEventContainer);
case CLICKED:
eSelectionType=ESelectionType.SELECTION;
if (bAngularBrushingSelectPolyline) {
bAngularBrushingSelectPolyline=false;
bIsAngularBrushingActive=true;
iSelectedLineID=iExternalID;
linePick=pick;
bIsAngularBrushingFirstTime=true;
}
break;
case MOUSE_OVER:
eSelectionType=ESelectionType.MOUSE_OVER;
break;
default :
pickingManager.flushHits(iUniqueID,ePickingType);
return;
}
connectedElementRepresentationManager.clear(ePolylineDataType);
polylineSelectionManager.clearSelection(eSelectionType);
if (ePolylineDataType == EIDType.EXPRESSION_INDEX) {
Integer iRefSeqID=idMappingManager.getID(EMappingType.EXPRESSION_INDEX_2_REFSEQ_MRNA_INT,iExternalID);
for (Object iExpressionIndex : idMappingManager.getMultiID(EMappingType.REFSEQ_MRNA_INT_2_EXPRESSION_INDEX,iRefSeqID)) {
contentSelectionManager.addToType(eSelectionType,(Integer)iExpressionIndex);
}
}
 else {
polylineSelectionManager.addToType(eSelectionType,iExternalID);
}
polylineSelectionManager.addConnectionID(generalManager.getIDManager().createID(EManagedObjectType.CONNECTION),iExternalID);
if (ePolylineDataType == EIDType.EXPRESSION_INDEX && !bAngularBrushingSelectPolyline) {
triggerEvent(EMediatorType.SELECTION_MEDIATOR,new SelectionCommandEventContainer(EIDType.REFSEQ_MRNA_INT,new SelectionCommand(ESelectionCommandType.CLEAR,eSelectionType)));
ISelectionDelta selectionDelta=contentSelectionManager.getDelta();
handleConnectedElementRep(selectionDelta);
triggerEvent(EMediatorType.SELECTION_MEDIATOR,new DeltaEventContainer<ISelectionDelta>(selectionDelta));
}
setDisplayListDirty();
pickingManager.flushHits(iUniqueID,ePickingType);
break;
case X_AXIS_SELECTION:
pickingManager.flushHits(iUniqueID,ePickingType);
break;
case Y_AXIS_SELECTION:
switch (ePickingMode) {
case CLICKED:
eSelectionType=ESelectionType.SELECTION;
break;
case MOUSE_OVER:
eSelectionType=ESelectionType.MOUSE_OVER;
break;
default :
pickingManager.flushHits(iUniqueID,ePickingType);
return;
}
axisSelectionManager.clearSelection(eSelectionType);
axisSelectionManager.addToType(eSelectionType,iExternalID);
axisSelectionManager.addConnectionID(generalManager.getIDManager().createID(EManagedObjectType.CONNECTION),iExternalID);
connectedElementRepresentationManager.clear(eAxisDataType);
triggerEvent(EMediatorType.SELECTION_MEDIATOR,new SelectionCommandEventContainer(eAxisDataType,new SelectionCommand(ESelectionCommandType.CLEAR,eSelectionType)));
ISelectionDelta selectionDelta=axisSelectionManager.getDelta();
if (eAxisDataType == EIDType.EXPRESSION_INDEX) {
handleConnectedElementRep(selectionDelta);
}
triggerEvent(EMediatorType.SELECTION_MEDIATOR,new DeltaEventContainer<ISelectionDelta>(selectionDelta));
rePosition(iExternalID);
setDisplayListDirty();
pickingManager.flushHits(iUniqueID,ePickingType);
break;
case LOWER_GATE_TIP_SELECTION:
switch (ePickingMode) {
case MOUSE_OVER:
bIsGateMouseOver=true;
iDraggedGateNumber=iExternalID;
draggedObject=EPickingType.LOWER_GATE_TIP_SELECTION;
setDisplayListDirty();
break;
case CLICKED:
bIsDraggingActive=true;
draggedObject=EPickingType.LOWER_GATE_TIP_SELECTION;
iDraggedGateNumber=iExternalID;
System.out.println("String_Node_Str");
break;
}
pickingManager.flushHits(iUniqueID,ePickingType);
break;
case LOWER_GATE_BOTTOM_SELECTION:
switch (ePickingMode) {
case MOUSE_OVER:
bIsGateMouseOver=true;
iDraggedGateNumber=iExternalID;
draggedObject=EPickingType.LOWER_GATE_BOTTOM_SELECTION;
setDisplayListDirty();
System.out.println("String_Node_Str");
break;
case CLICKED:
bIsDraggingActive=true;
draggedObject=EPickingType.LOWER_GATE_BOTTOM_SELECTION;
iDraggedGateNumber=iExternalID;
System.out.println("String_Node_Str");
break;
}
pickingManager.flushHits(iUniqueID,ePickingType);
break;
case LOWER_GATE_BODY_SELECTION:
switch (ePickingMode) {
case MOUSE_OVER:
bIsGateMouseOver=true;
iDraggedGateNumber=iExternalID;
draggedObject=EPickingType.LOWER_GATE_BODY_SELECTION;
setDisplayListDirty();
break;
case CLICKED:
bIsDraggingActive=true;
bIsGateDraggingFirstTime=true;
draggedObject=EPickingType.LOWER_GATE_BODY_SELECTION;
iDraggedGateNumber=iExternalID;
break;
}
pickingManager.flushHits(iUniqueID,ePickingType);
break;
case PC_ICON_SELECTION:
switch (ePickingMode) {
case CLICKED:
break;
}
pickingManager.flushHits(iUniqueID,EPickingType.PC_ICON_SELECTION);
break;
case REMOVE_AXIS:
IVirtualArray axisVA=set.getVA(iAxisVAID);
switch (ePickingMode) {
case CLICKED:
if (axisVA.containsElement(axisVA.get(iExternalID)) == 1) hashGates.remove(axisVA.get(iExternalID));
axisVA.remove(iExternalID);
IVirtualArrayDelta vaDelta=new VirtualArrayDelta(EIDType.EXPERIMENT_INDEX);
vaDelta.add(VADeltaItem.remove(iExternalID));
generalManager.getEventPublisher().triggerEvent(EMediatorType.SELECTION_MEDIATOR,this,new DeltaEventContainer<IVirtualArrayDelta>(vaDelta));
setDisplayListDirty();
resetAxisSpacing();
break;
}
pickingManager.flushHits(iUniqueID,EPickingType.REMOVE_AXIS);
break;
case MOVE_AXIS_LEFT:
switch (ePickingMode) {
case CLICKED:
if (iExternalID > 0) {
bWasAxisMoved=true;
bWasAxisDraggedFirstTime=true;
iMovedAxisPosition=iExternalID;
setDisplayListDirty();
}
break;
}
pickingManager.flushHits(iUniqueID,EPickingType.MOVE_AXIS_LEFT);
break;
case MOVE_AXIS_RIGHT:
switch (ePickingMode) {
case CLICKED:
resetAxisSpacing();
setDisplayListDirty();
break;
}
pickingManager.flushHits(iUniqueID,EPickingType.MOVE_AXIS_RIGHT);
break;
case DUPLICATE_AXIS:
switch (ePickingMode) {
case CLICKED:
if (iExternalID > 0) {
set.getVA(iAxisVAID).copy(iExternalID);
IVirtualArrayDelta vaDelta=new VirtualArrayDelta(EIDType.EXPERIMENT_INDEX);
vaDelta.add(VADeltaItem.copy(iExternalID));
generalManager.getEventPublisher().triggerEvent(EMediatorType.SELECTION_MEDIATOR,this,new DeltaEventContainer<IVirtualArrayDelta>(vaDelta));
setDisplayListDirty();
resetAxisSpacing();
break;
}
}
pickingManager.flushHits(iUniqueID,EPickingType.DUPLICATE_AXIS);
break;
case ANGULAR_UPPER:
switch (ePickingMode) {
case CLICKED:
bIsAngularDraggingActive=true;
case DRAGGED:
bIsAngularDraggingActive=true;
}
pickingManager.flushHits(iUniqueID,EPickingType.ANGULAR_UPPER);
break;
case ANGULAR_LOWER:
switch (ePickingMode) {
case CLICKED:
bIsAngularDraggingActive=true;
case DRAGGED:
bIsAngularDraggingActive=true;
}
break;
}
}