Program: 7649
Project: 7649
Buggy source:
protected void execAction3D(MotionEvent<?> e){
  DLAction a=e.getAction();
  DOF2Event event;
  float delta=0;
switch (a) {
case ZOOM:
{
      if (e instanceof DOF1Event) {
        delta=((DOF1Event)e).getX() * wheelSensitivity();
      }
 else {
        event=(DOF2Event)e;
        delta=event.getDY();
        ;
      }
      if (delta >= 0)       scale(1 + Math.abs(delta) / (float)scene.height());
 else       inverseScale(1 + Math.abs(delta) / (float)scene.height());
      break;
    }
case ROTATE:
{
    event=(DOF2Event)e;
    DLVector trans=scene.camera().projectedCoordinatesOf(position());
    Quaternion rot=deformedBallQuaternion(event,trans.x(),trans.y(),scene.camera());
    rot=iFrameQuaternion(rot,scene.camera());
    setSpinningQuaternion(rot);
    startSpinning(event);
    break;
  }
case TRANSLATE:
{
  event=(DOF2Event)e;
  DLVector trans=new DLVector(event.getDX(),scene.isRightHanded() ? -event.getDY() : event.getDY(),0.0f);
switch (scene.camera().type()) {
case PERSPECTIVE:
    trans.mult(2.0f * (float)Math.tan(scene.camera().fieldOfView() / 2.0f) * Math.abs((scene.camera().frame().coordinatesOf(position())).vec[2] * magnitude().z()) / scene.camera().screenHeight());
  break;
case ORTHOGRAPHIC:
{
  float[] wh=scene.camera().getOrthoWidthHeight();
  trans.vec[0]*=2.0 * wh[0] / scene.camera().screenWidth();
  trans.vec[1]*=2.0 * wh[1] / scene.camera().screenHeight();
  break;
}
}
trans=scene.camera().frame().orientation().rotate(DLVector.mult(trans,translationSensitivity()));
if (referenceFrame() != null) trans=referenceFrame().transformOf(trans);
translate(trans);
break;
}
case NATURAL:
{
DOF6Event event6=(DOF6Event)e;
DLVector t=new DLVector();
Quaternion q=new Quaternion();
t=scene.camera().frame().inverseTransformOf(new DLVector(event6.getX(),event6.getY(),-event6.getZ()),false);
if (referenceFrame() != null) t=referenceFrame().transformOf(t,false);
translate(t);
t=scene.camera().projectedCoordinatesOf(position());
q.fromEulerAngles(event6.roll(),event6.pitch(),-event6.yaw());
t.set(-q.x(),-q.y(),-q.z());
t=scene.camera().frame().orientation().rotate(t);
t=transformOf(t,false);
q.x(t.x());
q.y(t.y());
q.z(t.z());
rotate(q);
break;
}
default :
break;
}
}

Fixed version (ground truth):
protected void execAction3D(MotionEvent<?> e){
  DLAction a=e.getAction();
  DOF2Event event;
  float delta=0;
switch (a) {
case ZOOM:
{
      if (e instanceof DOF1Event) {
        delta=((DOF1Event)e).getX() * wheelSensitivity();
      }
 else {
        event=(DOF2Event)e;
        delta=event.getDY();
        ;
      }
      if (delta >= 0)       scale(1 + Math.abs(delta) / (float)scene.height());
 else       inverseScale(1 + Math.abs(delta) / (float)scene.height());
      break;
    }
case ROTATE:
{
    event=(DOF2Event)e;
    DLVector trans=scene.camera().projectedCoordinatesOf(position());
    Quaternion rot=deformedBallQuaternion(event,trans.x(),trans.y(),scene.camera());
    rot=iFrameQuaternion(rot,scene.camera());
    setSpinningQuaternion(rot);
    startSpinning(event);
    break;
  }
case TRANSLATE:
{
  event=(DOF2Event)e;
  DLVector trans=new DLVector(event.getDX(),scene.isRightHanded() ? -event.getDY() : event.getDY(),0.0f);
switch (scene.camera().type()) {
case PERSPECTIVE:
    trans.mult(2.0f * (float)Math.tan(scene.camera().fieldOfView() / 2.0f) * Math.abs((scene.camera().frame().coordinatesOf(position())).vec[2] * scene.camera().frame().magnitude().z()) / scene.camera().screenHeight());
  break;
case ORTHOGRAPHIC:
{
  float[] wh=scene.camera().getOrthoWidthHeight();
  trans.vec[0]*=2.0 * wh[0] / scene.camera().screenWidth();
  trans.vec[1]*=2.0 * wh[1] / scene.camera().screenHeight();
  break;
}
}
trans=scene.camera().frame().orientation().rotate(DLVector.mult(trans,translationSensitivity()));
if (referenceFrame() != null) trans=referenceFrame().transformOf(trans);
translate(trans);
break;
}
case NATURAL:
{
DOF6Event event6=(DOF6Event)e;
DLVector t=new DLVector();
Quaternion q=new Quaternion();
t=scene.camera().frame().inverseTransformOf(new DLVector(event6.getX(),event6.getY(),-event6.getZ()),false);
if (referenceFrame() != null) t=referenceFrame().transformOf(t,false);
translate(t);
t=scene.camera().projectedCoordinatesOf(position());
q.fromEulerAngles(event6.roll(),event6.pitch(),-event6.yaw());
t.set(-q.x(),-q.y(),-q.z());
t=scene.camera().frame().orientation().rotate(t);
t=transformOf(t,false);
q.x(t.x());
q.y(t.y());
q.z(t.z());
rotate(q);
break;
}
default :
break;
}
}