Program: 45453
Project: 45453
Buggy source:
public void setEnabled(boolean enabled,CameraNode cameraNode){
  if (this.enabled == enabled)   return;
  this.enabled=enabled;
  this.cameraNode=cameraNode;
  if (enabled) {
    if (listener == null) {
      listener=new EventClassFocusListener(){
        @Override public Class[] eventClassesToConsume(){
          return new Class[]{KeyEvent3D.class,MouseEvent3D.class};
        }
        @Override public void commitEvent(        Event event){
          if (event instanceof KeyEvent3D) {
            KeyEvent key=(KeyEvent)((KeyEvent3D)event).getAwtEvent();
            if (key.getKeyCode() == KeyEvent.VK_EQUALS) {
              offset.z+=cameraZoom;
              viewMoved(new CellTransform(viewRot,viewTranslation));
            }
 else             if (key.getKeyCode() == KeyEvent.VK_MINUS) {
              offset.z-=cameraZoom;
              viewMoved(new CellTransform(viewRot,viewTranslation));
            }
          }
 else           if (event instanceof MouseEvent3D) {
            MouseEvent mouse=(MouseEvent)((MouseEvent3D)event).getAwtEvent();
            if (mouse instanceof MouseWheelEvent) {
              int clicks=((MouseWheelEvent)mouse).getWheelRotation();
              offset.z-=cameraZoom * clicks;
              viewMoved(new CellTransform(viewRot,viewTranslation));
            }
 else             if (mouse.isControlDown()) {
              int diffX=mouse.getX() - mouseX;
              int diffY=mouse.getY() - mouseY;
              elevation+=Math.toRadians(diffY) / 4f;
              if (elevation > Math.PI / 2)               elevation=(float)Math.PI / 2;
 else               if (elevation < -Math.PI / 2)               elevation=-(float)Math.PI / 2;
              cameraLook.set(0,(float)Math.sin(elevation),1);
              cameraLook.normalize();
              mouseX=mouse.getX();
              mouseY=mouse.getY();
              update(avatarPos,avatarRot);
            }
 else {
              mouseX=mouse.getX();
              mouseY=mouse.getY();
            }
          }
        }
      }
;
    }
    ClientContextJME.getInputManager().addGlobalEventListener(listener);
  }
 else {
    ClientContextJME.getInputManager().removeGlobalEventListener(listener);
  }
}

Fixed version (ground truth):
public void setEnabled(boolean enabled,CameraNode cameraNode){
  if (this.enabled == enabled)   return;
  this.enabled=enabled;
  this.cameraNode=cameraNode;
  if (enabled) {
    if (listener == null) {
      listener=new EventClassFocusListener(){
        @Override public Class[] eventClassesToConsume(){
          return new Class[]{KeyEvent3D.class,MouseEvent3D.class};
        }
        @Override public void commitEvent(        Event event){
          if (event instanceof KeyEvent3D) {
            KeyEvent key=(KeyEvent)((KeyEvent3D)event).getAwtEvent();
            if (key.getKeyCode() == KeyEvent.VK_EQUALS) {
              offset.z+=cameraZoom;
              viewMoved(new CellTransform(viewRot,viewTranslation));
            }
 else             if (key.getKeyCode() == KeyEvent.VK_MINUS) {
              offset.z-=cameraZoom;
              viewMoved(new CellTransform(viewRot,viewTranslation));
            }
          }
 else           if (event instanceof MouseEvent3D) {
            MouseEvent mouse=(MouseEvent)((MouseEvent3D)event).getAwtEvent();
            if (mouse instanceof MouseWheelEvent) {
              int clicks=((MouseWheelEvent)mouse).getWheelRotation();
              offset.z-=cameraZoom * clicks;
              viewMoved(new CellTransform(viewRot,viewTranslation));
            }
 else             if (mouse.isControlDown()) {
              int diffX=mouse.getX() - mouseX;
              int diffY=mouse.getY() - mouseY;
              float scale=mouse.isShiftDown() ? 4f : 16f;
              elevation+=Math.toRadians(diffY) / scale;
              if (elevation > Math.PI / 2)               elevation=(float)Math.PI / 2;
 else               if (elevation < -Math.PI / 2)               elevation=-(float)Math.PI / 2;
              angle+=Math.toRadians(diffX) / scale;
              if (angle > Math.PI / 2)               angle=(float)Math.PI / 2;
 else               if (angle < -Math.PI / 2)               angle=-(float)Math.PI / 2;
              cameraLook.set((float)Math.sin(angle),(float)Math.sin(elevation),1);
              cameraLook.normalize();
              mouseX=mouse.getX();
              mouseY=mouse.getY();
              update(avatarPos,avatarRot);
            }
 else {
              mouseX=mouse.getX();
              mouseY=mouse.getY();
            }
          }
        }
      }
;
    }
    ClientContextJME.getInputManager().addGlobalEventListener(listener);
  }
 else {
    ClientContextJME.getInputManager().removeGlobalEventListener(listener);
  }
}