Program: 58868
Project: 58868
Buggy source:
@Override protected void handleEvents(EPickingType pickingType,EPickingMode pickingMode,int iExternalID,Pick pick){
switch (pickingType) {
case BUCKET_DRAG_ICON_SELECTION:
switch (pickingMode) {
case CLICKED:
      if (!dragAndDrop.isDragActionRunning()) {
        dragAndDrop.startDragAction(iExternalID);
      }
    iMouseOverObjectID=iExternalID;
  compactPoolLevel();
break;
}
pickingManager.flushHits(iUniqueID,EPickingType.BUCKET_DRAG_ICON_SELECTION);
pickingManager.flushHits(iUniqueID,EPickingType.REMOTE_LEVEL_ELEMENT);
break;
case BUCKET_REMOVE_ICON_SELECTION:
switch (pickingMode) {
case CLICKED:
RemoteLevelElement element=RemoteElementManager.get().getItem(iExternalID);
AGLEventListener glEventListener=(AGLEventListener)generalManager.getViewGLCanvasManager().getGLEventListener(element.getContainedElementID());
removeView(glEventListener);
element.setContainedElementID(-1);
containedViewIDs.remove(new Integer(glEventListener.getID()));
if (element.getRemoteLevel() == poolLevel) {
compactPoolLevel();
}
break;
}
pickingManager.flushHits(iUniqueID,EPickingType.BUCKET_REMOVE_ICON_SELECTION);
break;
case BUCKET_LOCK_ICON_SELECTION:
switch (pickingMode) {
case CLICKED:
RemoteLevelElement element=RemoteElementManager.get().getItem(iExternalID);
element.lock(!element.isLocked());
break;
}
pickingManager.flushHits(iUniqueID,EPickingType.BUCKET_LOCK_ICON_SELECTION);
break;
case REMOTE_LEVEL_ELEMENT:
switch (pickingMode) {
case MOUSE_OVER:
case DRAGGED:
iMouseOverObjectID=iExternalID;
break;
case CLICKED:
if (dragAndDrop.isDragActionRunning()) {
break;
}
for (RemoteLevelElement element : poolLevel.getAllElements()) {
if (element.getID() == iExternalID) {
loadViewToFocusLevel(iExternalID);
break;
}
}
break;
}
pickingManager.flushHits(iUniqueID,pickingType);
break;
case VIEW_SELECTION:
switch (pickingMode) {
case MOUSE_OVER:
if (iActiveViewID == iExternalID) {
break;
}
iActiveViewID=iExternalID;
setDisplayListDirty();
break;
case CLICKED:
break;
}
pickingManager.flushHits(iUniqueID,EPickingType.VIEW_SELECTION);
break;
case BUCKET_MOVE_IN_ICON_SELECTION:
switch (pickingMode) {
case CLICKED:
loadViewToFocusLevel(iExternalID);
bEnableNavigationOverlay=false;
break;
case MOUSE_OVER:
iNavigationMouseOverViewID_left=-1;
iNavigationMouseOverViewID_right=-1;
iNavigationMouseOverViewID_out=-1;
iNavigationMouseOverViewID_in=iExternalID;
iNavigationMouseOverViewID_lock=-1;
break;
}
pickingManager.flushHits(iUniqueID,EPickingType.BUCKET_MOVE_IN_ICON_SELECTION);
break;
case BUCKET_MOVE_OUT_ICON_SELECTION:
switch (pickingMode) {
case CLICKED:
if (iSlerpFactor > 0 && iSlerpFactor < SLERP_RANGE) {
break;
}
arSlerpActions.clear();
RemoteLevelElement element=RemoteElementManager.get().getItem(iExternalID);
SlerpAction slerpActionTransition=new SlerpAction(element,poolLevel.getNextFree());
arSlerpActions.add(slerpActionTransition);
bEnableNavigationOverlay=false;
generalManager.getViewGLCanvasManager().getGLEventListener(element.getContainedElementID()).broadcastElements(EVAOperation.REMOVE_ELEMENT);
break;
case MOUSE_OVER:
iNavigationMouseOverViewID_left=-1;
iNavigationMouseOverViewID_right=-1;
iNavigationMouseOverViewID_out=iExternalID;
iNavigationMouseOverViewID_in=-1;
iNavigationMouseOverViewID_lock=-1;
break;
}
pickingManager.flushHits(iUniqueID,EPickingType.BUCKET_MOVE_OUT_ICON_SELECTION);
break;
case BUCKET_MOVE_LEFT_ICON_SELECTION:
switch (pickingMode) {
case CLICKED:
if (iSlerpFactor > 0 && iSlerpFactor < SLERP_RANGE) {
break;
}
arSlerpActions.clear();
RemoteLevelElement selectedElement=RemoteElementManager.get().getItem(iExternalID);
int iDestinationPosIndex=stackLevel.getPositionIndexByElementID(selectedElement);
if (iDestinationPosIndex == 3) {
iDestinationPosIndex=0;
}
 else {
iDestinationPosIndex++;
}
if (stackLevel.getElementByPositionIndex(iDestinationPosIndex).getContainedElementID() == -1) {
SlerpAction slerpAction=new SlerpAction(selectedElement,stackLevel.getElementByPositionIndex(iDestinationPosIndex));
arSlerpActions.add(slerpAction);
}
 else {
SlerpAction slerpActionTransition=new SlerpAction(selectedElement,transitionLevel.getElementByPositionIndex(0));
arSlerpActions.add(slerpActionTransition);
SlerpAction slerpAction=new SlerpAction(stackLevel.getElementByPositionIndex(iDestinationPosIndex),selectedElement);
arSlerpActions.add(slerpAction);
SlerpAction slerpActionTransitionReverse=new SlerpAction(selectedElement.getContainedElementID(),transitionLevel.getElementByPositionIndex(0),stackLevel.getElementByPositionIndex(iDestinationPosIndex));
arSlerpActions.add(slerpActionTransitionReverse);
}
bEnableNavigationOverlay=false;
break;
case MOUSE_OVER:
iNavigationMouseOverViewID_left=iExternalID;
iNavigationMouseOverViewID_right=-1;
iNavigationMouseOverViewID_out=-1;
iNavigationMouseOverViewID_in=-1;
iNavigationMouseOverViewID_lock=-1;
break;
}
pickingManager.flushHits(iUniqueID,EPickingType.BUCKET_MOVE_LEFT_ICON_SELECTION);
break;
case BUCKET_MOVE_RIGHT_ICON_SELECTION:
switch (pickingMode) {
case CLICKED:
if (iSlerpFactor > 0 && iSlerpFactor < SLERP_RANGE) {
break;
}
arSlerpActions.clear();
RemoteLevelElement selectedElement=RemoteElementManager.get().getItem(iExternalID);
int iDestinationPosIndex=stackLevel.getPositionIndexByElementID(selectedElement);
if (iDestinationPosIndex == 0) {
iDestinationPosIndex=3;
}
 else {
iDestinationPosIndex--;
}
if (stackLevel.getElementByPositionIndex(iDestinationPosIndex).getContainedElementID() == -1) {
SlerpAction slerpAction=new SlerpAction(selectedElement,stackLevel.getElementByPositionIndex(iDestinationPosIndex));
arSlerpActions.add(slerpAction);
}
 else {
SlerpAction slerpActionTransition=new SlerpAction(selectedElement,transitionLevel.getElementByPositionIndex(0));
arSlerpActions.add(slerpActionTransition);
SlerpAction slerpAction=new SlerpAction(stackLevel.getElementByPositionIndex(iDestinationPosIndex),selectedElement);
arSlerpActions.add(slerpAction);
SlerpAction slerpActionTransitionReverse=new SlerpAction(selectedElement.getContainedElementID(),transitionLevel.getElementByPositionIndex(0),stackLevel.getElementByPositionIndex(iDestinationPosIndex));
arSlerpActions.add(slerpActionTransitionReverse);
}
bEnableNavigationOverlay=false;
break;
case MOUSE_OVER:
iNavigationMouseOverViewID_left=-1;
iNavigationMouseOverViewID_right=iExternalID;
iNavigationMouseOverViewID_out=-1;
iNavigationMouseOverViewID_in=-1;
iNavigationMouseOverViewID_lock=-1;
break;
}
pickingManager.flushHits(iUniqueID,EPickingType.BUCKET_MOVE_RIGHT_ICON_SELECTION);
break;
}
}

Fixed version (ground truth):
@Override protected void handleEvents(EPickingType pickingType,EPickingMode pickingMode,int iExternalID,Pick pick){
switch (pickingType) {
case BUCKET_DRAG_ICON_SELECTION:
switch (pickingMode) {
case CLICKED:
      if (!dragAndDrop.isDragActionRunning()) {
        dragAndDrop.startDragAction(iExternalID);
      }
    iMouseOverObjectID=iExternalID;
  compactPoolLevel();
break;
}
pickingManager.flushHits(iUniqueID,EPickingType.BUCKET_DRAG_ICON_SELECTION);
pickingManager.flushHits(iUniqueID,EPickingType.REMOTE_LEVEL_ELEMENT);
break;
case BUCKET_REMOVE_ICON_SELECTION:
switch (pickingMode) {
case CLICKED:
RemoteLevelElement element=RemoteElementManager.get().getItem(iExternalID);
AGLEventListener glEventListener=(AGLEventListener)generalManager.getViewGLCanvasManager().getGLEventListener(element.getContainedElementID());
removeView(glEventListener);
element.setContainedElementID(-1);
containedViewIDs.remove(new Integer(glEventListener.getID()));
if (element.getRemoteLevel() == poolLevel) {
compactPoolLevel();
}
break;
}
pickingManager.flushHits(iUniqueID,EPickingType.BUCKET_REMOVE_ICON_SELECTION);
break;
case BUCKET_LOCK_ICON_SELECTION:
switch (pickingMode) {
case CLICKED:
RemoteLevelElement element=RemoteElementManager.get().getItem(iExternalID);
element.lock(!element.isLocked());
break;
}
pickingManager.flushHits(iUniqueID,EPickingType.BUCKET_LOCK_ICON_SELECTION);
break;
case REMOTE_LEVEL_ELEMENT:
switch (pickingMode) {
case MOUSE_OVER:
case DRAGGED:
iMouseOverObjectID=iExternalID;
break;
case CLICKED:
if (dragAndDrop.isDragActionRunning()) {
break;
}
for (RemoteLevelElement element : poolLevel.getAllElements()) {
if (element.getID() == iExternalID) {
loadViewToFocusLevel(iExternalID);
break;
}
}
break;
}
pickingManager.flushHits(iUniqueID,pickingType);
break;
case VIEW_SELECTION:
switch (pickingMode) {
case MOUSE_OVER:
if (iActiveViewID == iExternalID) {
break;
}
iActiveViewID=iExternalID;
setDisplayListDirty();
break;
case CLICKED:
break;
}
infoAreaManager.setData(iExternalID,EIDType.EXPRESSION_INDEX,pick.getPickedPoint(),0.3f);
pickingManager.flushHits(iUniqueID,EPickingType.VIEW_SELECTION);
break;
case BUCKET_MOVE_IN_ICON_SELECTION:
switch (pickingMode) {
case CLICKED:
loadViewToFocusLevel(iExternalID);
bEnableNavigationOverlay=false;
break;
case MOUSE_OVER:
iNavigationMouseOverViewID_left=-1;
iNavigationMouseOverViewID_right=-1;
iNavigationMouseOverViewID_out=-1;
iNavigationMouseOverViewID_in=iExternalID;
iNavigationMouseOverViewID_lock=-1;
break;
}
pickingManager.flushHits(iUniqueID,EPickingType.BUCKET_MOVE_IN_ICON_SELECTION);
break;
case BUCKET_MOVE_OUT_ICON_SELECTION:
switch (pickingMode) {
case CLICKED:
if (iSlerpFactor > 0 && iSlerpFactor < SLERP_RANGE) {
break;
}
arSlerpActions.clear();
RemoteLevelElement element=RemoteElementManager.get().getItem(iExternalID);
SlerpAction slerpActionTransition=new SlerpAction(element,poolLevel.getNextFree());
arSlerpActions.add(slerpActionTransition);
bEnableNavigationOverlay=false;
generalManager.getViewGLCanvasManager().getGLEventListener(element.getContainedElementID()).broadcastElements(EVAOperation.REMOVE_ELEMENT);
break;
case MOUSE_OVER:
iNavigationMouseOverViewID_left=-1;
iNavigationMouseOverViewID_right=-1;
iNavigationMouseOverViewID_out=iExternalID;
iNavigationMouseOverViewID_in=-1;
iNavigationMouseOverViewID_lock=-1;
break;
}
pickingManager.flushHits(iUniqueID,EPickingType.BUCKET_MOVE_OUT_ICON_SELECTION);
break;
case BUCKET_MOVE_LEFT_ICON_SELECTION:
switch (pickingMode) {
case CLICKED:
if (iSlerpFactor > 0 && iSlerpFactor < SLERP_RANGE) {
break;
}
arSlerpActions.clear();
RemoteLevelElement selectedElement=RemoteElementManager.get().getItem(iExternalID);
int iDestinationPosIndex=stackLevel.getPositionIndexByElementID(selectedElement);
if (iDestinationPosIndex == 3) {
iDestinationPosIndex=0;
}
 else {
iDestinationPosIndex++;
}
if (stackLevel.getElementByPositionIndex(iDestinationPosIndex).getContainedElementID() == -1) {
SlerpAction slerpAction=new SlerpAction(selectedElement,stackLevel.getElementByPositionIndex(iDestinationPosIndex));
arSlerpActions.add(slerpAction);
}
 else {
SlerpAction slerpActionTransition=new SlerpAction(selectedElement,transitionLevel.getElementByPositionIndex(0));
arSlerpActions.add(slerpActionTransition);
SlerpAction slerpAction=new SlerpAction(stackLevel.getElementByPositionIndex(iDestinationPosIndex),selectedElement);
arSlerpActions.add(slerpAction);
SlerpAction slerpActionTransitionReverse=new SlerpAction(selectedElement.getContainedElementID(),transitionLevel.getElementByPositionIndex(0),stackLevel.getElementByPositionIndex(iDestinationPosIndex));
arSlerpActions.add(slerpActionTransitionReverse);
}
bEnableNavigationOverlay=false;
break;
case MOUSE_OVER:
iNavigationMouseOverViewID_left=iExternalID;
iNavigationMouseOverViewID_right=-1;
iNavigationMouseOverViewID_out=-1;
iNavigationMouseOverViewID_in=-1;
iNavigationMouseOverViewID_lock=-1;
break;
}
pickingManager.flushHits(iUniqueID,EPickingType.BUCKET_MOVE_LEFT_ICON_SELECTION);
break;
case BUCKET_MOVE_RIGHT_ICON_SELECTION:
switch (pickingMode) {
case CLICKED:
if (iSlerpFactor > 0 && iSlerpFactor < SLERP_RANGE) {
break;
}
arSlerpActions.clear();
RemoteLevelElement selectedElement=RemoteElementManager.get().getItem(iExternalID);
int iDestinationPosIndex=stackLevel.getPositionIndexByElementID(selectedElement);
if (iDestinationPosIndex == 0) {
iDestinationPosIndex=3;
}
 else {
iDestinationPosIndex--;
}
if (stackLevel.getElementByPositionIndex(iDestinationPosIndex).getContainedElementID() == -1) {
SlerpAction slerpAction=new SlerpAction(selectedElement,stackLevel.getElementByPositionIndex(iDestinationPosIndex));
arSlerpActions.add(slerpAction);
}
 else {
SlerpAction slerpActionTransition=new SlerpAction(selectedElement,transitionLevel.getElementByPositionIndex(0));
arSlerpActions.add(slerpActionTransition);
SlerpAction slerpAction=new SlerpAction(stackLevel.getElementByPositionIndex(iDestinationPosIndex),selectedElement);
arSlerpActions.add(slerpAction);
SlerpAction slerpActionTransitionReverse=new SlerpAction(selectedElement.getContainedElementID(),transitionLevel.getElementByPositionIndex(0),stackLevel.getElementByPositionIndex(iDestinationPosIndex));
arSlerpActions.add(slerpActionTransitionReverse);
}
bEnableNavigationOverlay=false;
break;
case MOUSE_OVER:
iNavigationMouseOverViewID_left=-1;
iNavigationMouseOverViewID_right=iExternalID;
iNavigationMouseOverViewID_out=-1;
iNavigationMouseOverViewID_in=-1;
iNavigationMouseOverViewID_lock=-1;
break;
}
pickingManager.flushHits(iUniqueID,EPickingType.BUCKET_MOVE_RIGHT_ICON_SELECTION);
break;
}
}