Program: 7644
Project: 7644
Buggy source:
/** 
 * Internal method. Handles the different global keyboard actions.
 */
@Override public void performInteraction(THEvent event){
  if (!(event instanceof ClickEvent) && !(event instanceof KeyboardEvent))   return;
  Actionable<DLAction> a=null;
  if (event instanceof ClickEvent)   a=((ClickEvent)event).getAction();
  if (event instanceof KeyboardEvent)   a=((KeyboardEvent)event).getAction();
  if (a == null)   return;
  DLAction id=a.action();
  if (!id.is2D() && this.is2D())   return;
  Vec trans;
switch (id) {
case DRAW_AXIS:
    toggleAxisIsDrawn();
  break;
case DRAW_GRID:
toggleGridIsDrawn();
break;
case CAMERA_PROFILE:
break;
case CAMERA_TYPE:
toggleCameraType();
break;
case CAMERA_KIND:
toggleCameraKind();
break;
case ANIMATION:
toggleAnimation();
break;
case GLOBAL_HELP:
displayGlobalHelp();
break;
case CURRENT_CAMERA_PROFILE_HELP:
displayCurrentCameraProfileHelp();
break;
case EDIT_CAMERA_PATH:
toggleCameraPathsAreDrawn();
break;
case FOCUS_INTERACTIVE_FRAME:
break;
case DRAW_FRAME_SELECTION_HINT:
toggleFrameSelectionHintIsDrawn();
break;
case CONSTRAIN_FRAME:
break;
case INTERPOLATE_TO_ZOOM_ON_PIXEL:
if (this.is3D()) {
Camera.WorldPoint wP=camera().interpolateToZoomOnPixel(new Point(cursorX,cursorY));
if (wP.found) {
pupVec=wP.point;
pupFlag=true;
timerFx.runOnce(1000);
}
}
 else {
viewWindow().interpolateToZoomOnPixel(new Point(cursorX,cursorY));
pupVec=viewWindow().unprojectedCoordinatesOf(new Vec((float)cursorX,(float)cursorY,0.5f));
pupFlag=true;
timerFx.runOnce(1000);
}
break;
case INTERPOLATE_TO_FIT_SCENE:
pinhole().interpolateToFitScene();
break;
case SHOW_ALL:
showAll();
break;
case MOVE_CAMERA_LEFT:
trans=new Vec(-10.0f * pinhole().flySpeed(),0.0f,0.0f);
if (this.is3D()) trans.div(camera().frame().magnitude());
pinhole().frame().translate(pinhole().frame().inverseTransformOf(trans));
break;
case MOVE_CAMERA_RIGHT:
trans=new Vec(10.0f * pinhole().flySpeed(),0.0f,0.0f);
if (this.is3D()) trans.div(camera().frame().magnitude());
pinhole().frame().translate(pinhole().frame().inverseTransformOf(trans));
break;
case MOVE_CAMERA_UP:
trans=pinhole().frame().inverseTransformOf(new Vec(0.0f,isRightHanded() ? 10.0f : -10.0f * pinhole().flySpeed(),0.0f));
if (this.is3D()) trans.div(camera().frame().magnitude());
pinhole().frame().translate(trans);
break;
case MOVE_CAMERA_DOWN:
trans=pinhole().frame().inverseTransformOf(new Vec(0.0f,isRightHanded() ? -10.0f : 10.0f * pinhole().flySpeed(),0.0f));
if (this.is3D()) trans.div(camera().frame().magnitude());
pinhole().frame().translate(trans);
break;
case INCREASE_ROTATION_SENSITIVITY:
pinhole().setRotationSensitivity(pinhole().rotationSensitivity() * 1.2f);
break;
case DECREASE_ROTATION_SENSITIVITY:
pinhole().setRotationSensitivity(pinhole().rotationSensitivity() / 1.2f);
break;
case INCREASE_CAMERA_FLY_SPEED:
((Camera)pinhole()).setFlySpeed(((Camera)pinhole()).flySpeed() * 1.2f);
break;
case DECREASE_CAMERA_FLY_SPEED:
((Camera)pinhole()).setFlySpeed(((Camera)pinhole()).flySpeed() / 1.2f);
break;
case INCREASE_AVATAR_FLY_SPEED:
if (avatar() != null) if (avatarIsInteractiveDrivableFrame) ((InteractiveDrivableFrame)avatar()).setFlySpeed(((InteractiveDrivableFrame)avatar()).flySpeed() * 1.2f);
break;
case DECREASE_AVATAR_FLY_SPEED:
if (avatar() != null) if (avatarIsInteractiveDrivableFrame) ((InteractiveDrivableFrame)avatar()).setFlySpeed(((InteractiveDrivableFrame)avatar()).flySpeed() / 1.2f);
break;
case INCREASE_AZYMUTH:
if (avatar() != null) if (avatarIsInteractiveAvatarFrame) ((InteractiveAvatarFrame)avatar()).setAzimuth(((InteractiveAvatarFrame)avatar()).azimuth() + PI / 64);
break;
case DECREASE_AZYMUTH:
if (avatar() != null) if (avatarIsInteractiveAvatarFrame) ((InteractiveAvatarFrame)avatar()).setAzimuth(((InteractiveAvatarFrame)avatar()).azimuth() - PI / 64);
break;
case INCREASE_INCLINATION:
if (avatar() != null) if (avatarIsInteractiveAvatarFrame) ((InteractiveAvatarFrame)avatar()).setInclination(((InteractiveAvatarFrame)avatar()).inclination() + PI / 64);
break;
case DECREASE_INCLINATION:
if (avatar() != null) if (avatarIsInteractiveAvatarFrame) ((InteractiveAvatarFrame)avatar()).setInclination(((InteractiveAvatarFrame)avatar()).inclination() - PI / 64);
break;
case INCREASE_TRACKING_DISTANCE:
if (avatar() != null) if (avatarIsInteractiveAvatarFrame) ((InteractiveAvatarFrame)avatar()).setTrackingDistance(((InteractiveAvatarFrame)avatar()).trackingDistance() + radius() / 50);
break;
case DECREASE_TRACKING_DISTANCE:
if (avatar() != null) if (avatarIsInteractiveAvatarFrame) ((InteractiveAvatarFrame)avatar()).setTrackingDistance(((InteractiveAvatarFrame)avatar()).trackingDistance() - radius() / 50);
break;
case ZOOM_ON_PIXEL:
if (this.is2D()) {
viewWindow().interpolateToZoomOnPixel(new Point(cursorX,cursorY));
pupVec=viewWindow().unprojectedCoordinatesOf(new Vec((float)cursorX,(float)cursorY,0.5f));
pupFlag=true;
timerFx.runOnce(1000);
}
 else {
Camera.WorldPoint wP=camera().interpolateToZoomOnPixel(new Point(cursorX,cursorY));
if (wP.found) {
pupVec=wP.point;
pupFlag=true;
timerFx.runOnce(1000);
}
}
break;
case ZOOM_TO_FIT:
pinhole().interpolateToFitScene();
break;
case ARP_FROM_PIXEL:
if (setArcballReferencePointFromPixel(new Point(cursorX,cursorY))) {
arpFlag=true;
timerFx.runOnce(1000);
}
break;
case RESET_ARP:
pinhole().setArcballReferencePoint(new Vec(0,0,0));
arpFlag=true;
timerFx.runOnce(1000);
break;
case CENTER_FRAME:
break;
case CENTER_SCENE:
pinhole().centerScene();
break;
case ALIGN_FRAME:
break;
case ALIGN_CAMERA:
pinhole().frame().alignWithFrame(null,true);
break;
default :
System.out.println("String_Node_Str");
break;
}
}

Fixed version (ground truth):
/** 
 * Internal method. Handles the different global keyboard actions.
 */
@Override public void performInteraction(THEvent event){
  if (!(event instanceof GenericClickEvent) && !(event instanceof GenericKeyboardEvent))   return;
  Actionable<DLAction> a=null;
  if (event instanceof GenericClickEvent<?>)   a=(DOF_0Action)((GenericClickEvent<?>)event).getAction();
  if (event instanceof GenericKeyboardEvent<?>)   a=(DOF_0Action)((GenericKeyboardEvent<?>)event).getAction();
  if (a == null)   return;
  DLAction id=a.action();
  if (!id.is2D() && this.is2D())   return;
  Vec trans;
switch (id) {
case DRAW_AXIS:
    toggleAxisIsDrawn();
  break;
case DRAW_GRID:
toggleGridIsDrawn();
break;
case CAMERA_PROFILE:
break;
case CAMERA_TYPE:
toggleCameraType();
break;
case CAMERA_KIND:
toggleCameraKind();
break;
case ANIMATION:
toggleAnimation();
break;
case GLOBAL_HELP:
displayGlobalHelp();
break;
case CURRENT_CAMERA_PROFILE_HELP:
displayCurrentCameraProfileHelp();
break;
case EDIT_CAMERA_PATH:
toggleCameraPathsAreDrawn();
break;
case FOCUS_INTERACTIVE_FRAME:
break;
case DRAW_FRAME_SELECTION_HINT:
toggleFrameSelectionHintIsDrawn();
break;
case CONSTRAIN_FRAME:
break;
case INTERPOLATE_TO_ZOOM_ON_PIXEL:
if (this.is3D()) {
Camera.WorldPoint wP=camera().interpolateToZoomOnPixel(new Point(cursorX,cursorY));
if (wP.found) {
pupVec=wP.point;
pupFlag=true;
timerFx.runOnce(1000);
}
}
 else {
viewWindow().interpolateToZoomOnPixel(new Point(cursorX,cursorY));
pupVec=viewWindow().unprojectedCoordinatesOf(new Vec((float)cursorX,(float)cursorY,0.5f));
pupFlag=true;
timerFx.runOnce(1000);
}
break;
case INTERPOLATE_TO_FIT_SCENE:
pinhole().interpolateToFitScene();
break;
case SHOW_ALL:
showAll();
break;
case MOVE_CAMERA_LEFT:
trans=new Vec(-10.0f * pinhole().flySpeed(),0.0f,0.0f);
if (this.is3D()) trans.div(camera().frame().magnitude());
pinhole().frame().translate(pinhole().frame().inverseTransformOf(trans));
break;
case MOVE_CAMERA_RIGHT:
trans=new Vec(10.0f * pinhole().flySpeed(),0.0f,0.0f);
if (this.is3D()) trans.div(camera().frame().magnitude());
pinhole().frame().translate(pinhole().frame().inverseTransformOf(trans));
break;
case MOVE_CAMERA_UP:
trans=pinhole().frame().inverseTransformOf(new Vec(0.0f,isRightHanded() ? 10.0f : -10.0f * pinhole().flySpeed(),0.0f));
if (this.is3D()) trans.div(camera().frame().magnitude());
pinhole().frame().translate(trans);
break;
case MOVE_CAMERA_DOWN:
trans=pinhole().frame().inverseTransformOf(new Vec(0.0f,isRightHanded() ? -10.0f : 10.0f * pinhole().flySpeed(),0.0f));
if (this.is3D()) trans.div(camera().frame().magnitude());
pinhole().frame().translate(trans);
break;
case INCREASE_ROTATION_SENSITIVITY:
pinhole().setRotationSensitivity(pinhole().rotationSensitivity() * 1.2f);
break;
case DECREASE_ROTATION_SENSITIVITY:
pinhole().setRotationSensitivity(pinhole().rotationSensitivity() / 1.2f);
break;
case INCREASE_CAMERA_FLY_SPEED:
((Camera)pinhole()).setFlySpeed(((Camera)pinhole()).flySpeed() * 1.2f);
break;
case DECREASE_CAMERA_FLY_SPEED:
((Camera)pinhole()).setFlySpeed(((Camera)pinhole()).flySpeed() / 1.2f);
break;
case INCREASE_AVATAR_FLY_SPEED:
if (avatar() != null) if (avatarIsInteractiveDrivableFrame) ((InteractiveDrivableFrame)avatar()).setFlySpeed(((InteractiveDrivableFrame)avatar()).flySpeed() * 1.2f);
break;
case DECREASE_AVATAR_FLY_SPEED:
if (avatar() != null) if (avatarIsInteractiveDrivableFrame) ((InteractiveDrivableFrame)avatar()).setFlySpeed(((InteractiveDrivableFrame)avatar()).flySpeed() / 1.2f);
break;
case INCREASE_AZYMUTH:
if (avatar() != null) if (avatarIsInteractiveAvatarFrame) ((InteractiveAvatarFrame)avatar()).setAzimuth(((InteractiveAvatarFrame)avatar()).azimuth() + PI / 64);
break;
case DECREASE_AZYMUTH:
if (avatar() != null) if (avatarIsInteractiveAvatarFrame) ((InteractiveAvatarFrame)avatar()).setAzimuth(((InteractiveAvatarFrame)avatar()).azimuth() - PI / 64);
break;
case INCREASE_INCLINATION:
if (avatar() != null) if (avatarIsInteractiveAvatarFrame) ((InteractiveAvatarFrame)avatar()).setInclination(((InteractiveAvatarFrame)avatar()).inclination() + PI / 64);
break;
case DECREASE_INCLINATION:
if (avatar() != null) if (avatarIsInteractiveAvatarFrame) ((InteractiveAvatarFrame)avatar()).setInclination(((InteractiveAvatarFrame)avatar()).inclination() - PI / 64);
break;
case INCREASE_TRACKING_DISTANCE:
if (avatar() != null) if (avatarIsInteractiveAvatarFrame) ((InteractiveAvatarFrame)avatar()).setTrackingDistance(((InteractiveAvatarFrame)avatar()).trackingDistance() + radius() / 50);
break;
case DECREASE_TRACKING_DISTANCE:
if (avatar() != null) if (avatarIsInteractiveAvatarFrame) ((InteractiveAvatarFrame)avatar()).setTrackingDistance(((InteractiveAvatarFrame)avatar()).trackingDistance() - radius() / 50);
break;
case ZOOM_ON_PIXEL:
if (this.is2D()) {
viewWindow().interpolateToZoomOnPixel(new Point(cursorX,cursorY));
pupVec=viewWindow().unprojectedCoordinatesOf(new Vec((float)cursorX,(float)cursorY,0.5f));
pupFlag=true;
timerFx.runOnce(1000);
}
 else {
Camera.WorldPoint wP=camera().interpolateToZoomOnPixel(new Point(cursorX,cursorY));
if (wP.found) {
pupVec=wP.point;
pupFlag=true;
timerFx.runOnce(1000);
}
}
break;
case ZOOM_TO_FIT:
pinhole().interpolateToFitScene();
break;
case ARP_FROM_PIXEL:
if (setArcballReferencePointFromPixel(new Point(cursorX,cursorY))) {
arpFlag=true;
timerFx.runOnce(1000);
}
break;
case RESET_ARP:
pinhole().setArcballReferencePoint(new Vec(0,0,0));
arpFlag=true;
timerFx.runOnce(1000);
break;
case CENTER_FRAME:
break;
case CENTER_SCENE:
pinhole().centerScene();
break;
case ALIGN_FRAME:
break;
case ALIGN_CAMERA:
pinhole().frame().alignWithFrame(null,true);
break;
default :
System.out.println("String_Node_Str");
break;
}
}