Program: 96418
Project: 96418
Buggy source:
@Override public Node getSample(){
  if (!onService.get()) {
    cameraTransform=new CameraTransformer();
    camera=new PerspectiveCamera(true);
    camera.setNearClip(0.1);
    camera.setFarClip(100000.0);
    camera.setTranslateZ(-50);
    camera.setVerticalFieldOfView(false);
    camera.setFieldOfView(42);
    cameraTransform.setTranslate(0,0,0);
    cameraTransform.getChildren().add(camera);
    cameraTransform.ry.setAngle(-45.0);
    cameraTransform.rx.setAngle(-10.0);
    PointLight light=new PointLight(Color.GAINSBORO);
    AmbientLight amb=new AmbientLight(Color.WHITE);
    amb.getScope().add(cameraTransform);
    cameraTransform.getChildren().addAll(light);
    light.translateXProperty().bind(camera.translateXProperty());
    light.translateYProperty().bind(camera.translateYProperty());
    light.translateZProperty().bind(camera.translateZProperty());
    sceneLight1=new PointLight();
    sceneLight1.setTranslateX(500);
    sceneLight2=new PointLight();
    sceneLight2.setTranslateX(-500);
    light1Group=new Group(sceneLight1);
    light2Group=new Group(sceneLight2);
    lightingGroup=new Group(light1Group,light2Group);
    root=new Group(lightingGroup);
    sceneLight1.getScope().add(root);
    sceneLight2.getScope().add(root);
    subScene=new SubScene(root,sceneWidth,sceneHeight,true,SceneAntialiasing.BALANCED);
    subScene.setFill(Color.TRANSPARENT);
    subScene.setCamera(camera);
    subScene.setFocusTraversable(false);
    rotateY=new Rotate(0,0,0,0,Rotate.Y_AXIS);
    mainPane=new StackPane();
    mainPane.setPrefSize(sceneWidth,sceneHeight);
    mainPane.setMaxSize(StackPane.USE_COMPUTED_SIZE,StackPane.USE_COMPUTED_SIZE);
    mainPane.setMinSize(sceneWidth,sceneHeight);
    mainPane.getChildren().add(subScene);
    mainPane.setPickOnBounds(false);
    service=new Service<Void>(){
      @Override protected Task<Void> createTask(){
        return new Task<Void>(){
          @Override protected Void call() throws Exception {
            createMesh();
            return null;
          }
        }
;
      }
      @Override protected void failed(){
        super.failed();
        getException().printStackTrace(System.err);
      }
    }
;
    progressBar=new ProgressBar();
    progressBar.prefWidthProperty().bind(mainPane.widthProperty().divide(2d));
    progressBar.setProgress(-1);
    mainPane.getChildren().add(progressBar);
    group=new Group();
    group.getChildren().add(cameraTransform);
    root.getChildren().add(group);
    service.setOnSucceeded(e -> {
      onService.set(false);
      System.out.println("String_Node_Str" + (System.currentTimeMillis() - time));
      addMeshAndListeners();
      mainPane.getChildren().remove(progressBar);
      if (model != null && model instanceof Shape3D) {
        material=(PhongMaterial)((Shape3D)model).getMaterial();
      }
 else {
        if (model != null && model instanceof Group) {
          material=(PhongMaterial)((Shape3D)((Group)model).getChildren().filtered(t -> t instanceof Shape3D).get(0)).getMaterial();
        }
      }
      if (model != null) {
        group.getChildren().add(model);
      }
 else {
        throw new UnsupportedOperationException("String_Node_Str");
      }
      if (controlPanel != null && ((ControlPanel)controlPanel).getPanes().filtered(t -> t.getText().contains("String_Node_Str")).isEmpty()) {
        ((ControlPanel)controlPanel).getPanes().add(0,ControlFactory.buildSceneAndLightCategory(mainPane.visibleProperty(),sceneLight1.lightOnProperty(),sceneLight2.lightOnProperty(),sceneLight1.colorProperty(),sceneLight2.colorProperty(),sceneLight1.translateXProperty(),sceneLight2.translateXProperty(),light1Group.rotateProperty(),light2Group.rotateProperty(),light1Group.rotationAxisProperty(),light1Group.rotationAxisProperty()));
      }
    }
);
    subScene.widthProperty().bind(mainPane.widthProperty());
    subScene.heightProperty().bind(mainPane.heightProperty());
    subScene.setOnKeyPressed(event -> {
      double change=10.0;
      if (event.isShiftDown()) {
        change=50.0;
      }
      KeyCode keycode=event.getCode();
      if (keycode == KeyCode.W) {
        camera.setTranslateZ(camera.getTranslateZ() + change);
      }
      if (keycode == KeyCode.S) {
        camera.setTranslateZ(camera.getTranslateZ() - change);
      }
      if (keycode == KeyCode.A) {
        camera.setTranslateX(camera.getTranslateX() - change);
      }
      if (keycode == KeyCode.D) {
        camera.setTranslateX(camera.getTranslateX() + change);
      }
    }
);
    subScene.setOnMousePressed((    MouseEvent me) -> {
      mousePosX=me.getSceneX();
      mousePosY=me.getSceneY();
      mouseOldX=me.getSceneX();
      mouseOldY=me.getSceneY();
      PickResult pr=me.getPickResult();
      if (pr != null && pr.getIntersectedNode() != null && pr.getIntersectedNode() instanceof Sphere && pr.getIntersectedNode().getId().equals("String_Node_Str")) {
        distance=pr.getIntersectedDistance();
        s=(Sphere)pr.getIntersectedNode();
        isPicking.set(true);
        vecIni=unProjectDirection(mousePosX,mousePosY,subScene.getWidth(),subScene.getHeight());
      }
    }
);
    subScene.setOnMouseDragged((    MouseEvent me) -> {
      mouseOldX=mousePosX;
      mouseOldY=mousePosY;
      mousePosX=me.getSceneX();
      mousePosY=me.getSceneY();
      mouseDeltaX=(mousePosX - mouseOldX);
      mouseDeltaY=(mousePosY - mouseOldY);
      if (isPicking.get()) {
        double modifier=(me.isControlDown() ? 0.01 : me.isAltDown() ? 1.0 : 0.1) * (30d / camera.getFieldOfView());
        modifier*=(30d / camera.getFieldOfView());
        vecPos=unProjectDirection(mousePosX,mousePosY,subScene.getWidth(),subScene.getHeight());
        Point3D p=new Point3D(distance * (vecPos.x - vecIni.x),distance * (vecPos.y - vecIni.y),distance * (vecPos.z - vecIni.z));
        s.getTransforms().add(new Translate(modifier * p.getX(),modifier * p.getY(),modifier * p.getZ()));
        vecIni=vecPos;
      }
 else {
        double modifier=10.0;
        double modifierFactor=0.1;
        if (me.isControlDown()) {
          modifier=0.1;
        }
        if (me.isShiftDown()) {
          modifier=50.0;
        }
        if (me.isPrimaryButtonDown()) {
          cameraTransform.ry.setAngle(((cameraTransform.ry.getAngle() + mouseDeltaX * modifierFactor * modifier* 2.0) % 360 + 540) % 360 - 180);
          cameraTransform.rx.setAngle(((cameraTransform.rx.getAngle() - mouseDeltaY * modifierFactor * modifier* 2.0) % 360 + 540) % 360 - 180);
        }
 else         if (me.isSecondaryButtonDown()) {
          double z=camera.getTranslateZ();
          double newZ=z + mouseDeltaX * modifierFactor * modifier;
          camera.setTranslateZ(newZ);
        }
 else         if (me.isMiddleButtonDown()) {
          cameraTransform.t.setX(cameraTransform.t.getX() + mouseDeltaX * modifierFactor * modifier* 0.3);
          cameraTransform.t.setY(cameraTransform.t.getY() + mouseDeltaY * modifierFactor * modifier* 0.3);
        }
      }
    }
);
    subScene.setOnMouseReleased((    MouseEvent me) -> {
      if (isPicking.get()) {
        isPicking.set(false);
      }
    }
);
    onService.set(true);
    System.out.println("String_Node_Str");
    time=System.currentTimeMillis();
    service.start();
  }
  mainPane.sceneProperty().addListener(i -> {
    if (mainPane.getScene() != null) {
      mainPane.getScene().addEventHandler(MouseEvent.MOUSE_PRESSED,e -> {
        if (e.getPickResult() != null) {
          System.out.println(e.getPickResult().getIntersectedNode() + "String_Node_Str" + e.getPickResult().getIntersectedNode().getTypeSelector());
        }
      }
);
    }
  }
);
  return mainPane;
}

Fixed version (ground truth):
@Override public Node getSample(){
  if (!onService.get()) {
    cameraTransform=new CameraTransformer();
    camera=new PerspectiveCamera(true);
    camera.setNearClip(0.1);
    camera.setFarClip(100000.0);
    camera.setTranslateZ(-50);
    camera.setVerticalFieldOfView(false);
    camera.setFieldOfView(42);
    cameraTransform.setTranslate(0,0,0);
    cameraTransform.getChildren().add(camera);
    cameraTransform.ry.setAngle(-45.0);
    cameraTransform.rx.setAngle(-10.0);
    PointLight light=new PointLight(Color.GAINSBORO);
    AmbientLight amb=new AmbientLight(Color.WHITE);
    amb.getScope().add(cameraTransform);
    cameraTransform.getChildren().addAll(light);
    light.translateXProperty().bind(camera.translateXProperty());
    light.translateYProperty().bind(camera.translateYProperty());
    light.translateZProperty().bind(camera.translateZProperty());
    sceneLight1=new PointLight();
    sceneLight1.setTranslateX(500);
    sceneLight2=new PointLight();
    sceneLight2.setTranslateX(-500);
    light1Group=new Group(sceneLight1);
    light2Group=new Group(sceneLight2);
    lightingGroup=new Group(light1Group,light2Group);
    root=new Group(lightingGroup);
    sceneLight1.getScope().add(root);
    sceneLight2.getScope().add(root);
    subScene=new SubScene(root,sceneWidth,sceneHeight,true,SceneAntialiasing.BALANCED);
    subScene.setFill(Color.TRANSPARENT);
    subScene.setCamera(camera);
    subScene.setFocusTraversable(false);
    rotateY=new Rotate(0,0,0,0,Rotate.Y_AXIS);
    mainPane=new StackPane();
    mainPane.setPrefSize(sceneWidth,sceneHeight);
    mainPane.setMaxSize(StackPane.USE_COMPUTED_SIZE,StackPane.USE_COMPUTED_SIZE);
    mainPane.setMinSize(sceneWidth,sceneHeight);
    mainPane.getChildren().add(subScene);
    mainPane.setPickOnBounds(false);
    service=new Service<Void>(){
      @Override protected Task<Void> createTask(){
        return new Task<Void>(){
          @Override protected Void call() throws Exception {
            createMesh();
            return null;
          }
        }
;
      }
      @Override protected void failed(){
        super.failed();
        getException().printStackTrace(System.err);
      }
    }
;
    progressBar=new ProgressBar();
    progressBar.prefWidthProperty().bind(mainPane.widthProperty().divide(2d));
    progressBar.setProgress(-1);
    mainPane.getChildren().add(progressBar);
    group=new Group();
    group.getChildren().add(cameraTransform);
    root.getChildren().add(group);
    service.setOnSucceeded(e -> {
      onService.set(false);
      System.out.println("String_Node_Str" + (System.currentTimeMillis() - time));
      addMeshAndListeners();
      mainPane.getChildren().remove(progressBar);
      if (model != null && model instanceof Shape3D) {
        material=(PhongMaterial)((Shape3D)model).getMaterial();
      }
 else {
        if (model != null && model instanceof Group) {
          if (!((Group)model).getChildren().filtered(isShape -> isShape instanceof Shape3D).isEmpty()) {
            material=(PhongMaterial)((Shape3D)((Group)model).getChildren().filtered(t -> t instanceof Shape3D).get(0)).getMaterial();
          }
        }
      }
      if (model != null) {
        group.getChildren().add(model);
      }
 else {
        throw new UnsupportedOperationException("String_Node_Str");
      }
      if (controlPanel != null && ((ControlPanel)controlPanel).getPanes().filtered(t -> t.getText().contains("String_Node_Str")).isEmpty()) {
        ((ControlPanel)controlPanel).getPanes().add(0,ControlFactory.buildSceneAndLightCategory(mainPane.visibleProperty(),sceneLight1.lightOnProperty(),sceneLight2.lightOnProperty(),sceneLight1.colorProperty(),sceneLight2.colorProperty(),sceneLight1.translateXProperty(),sceneLight2.translateXProperty(),light1Group.rotateProperty(),light2Group.rotateProperty(),light1Group.rotationAxisProperty(),light1Group.rotationAxisProperty()));
      }
    }
);
    subScene.widthProperty().bind(mainPane.widthProperty());
    subScene.heightProperty().bind(mainPane.heightProperty());
    subScene.setOnKeyPressed(event -> {
      double change=10.0;
      if (event.isShiftDown()) {
        change=50.0;
      }
      KeyCode keycode=event.getCode();
      if (keycode == KeyCode.W) {
        camera.setTranslateZ(camera.getTranslateZ() + change);
      }
      if (keycode == KeyCode.S) {
        camera.setTranslateZ(camera.getTranslateZ() - change);
      }
      if (keycode == KeyCode.A) {
        camera.setTranslateX(camera.getTranslateX() - change);
      }
      if (keycode == KeyCode.D) {
        camera.setTranslateX(camera.getTranslateX() + change);
      }
    }
);
    subScene.setOnMousePressed((    MouseEvent me) -> {
      mousePosX=me.getSceneX();
      mousePosY=me.getSceneY();
      mouseOldX=me.getSceneX();
      mouseOldY=me.getSceneY();
      PickResult pr=me.getPickResult();
      if (pr != null && pr.getIntersectedNode() != null && pr.getIntersectedNode() instanceof Sphere && pr.getIntersectedNode().getId().equals("String_Node_Str")) {
        distance=pr.getIntersectedDistance();
        s=(Sphere)pr.getIntersectedNode();
        isPicking.set(true);
        vecIni=unProjectDirection(mousePosX,mousePosY,subScene.getWidth(),subScene.getHeight());
      }
    }
);
    subScene.setOnMouseDragged((    MouseEvent me) -> {
      mouseOldX=mousePosX;
      mouseOldY=mousePosY;
      mousePosX=me.getSceneX();
      mousePosY=me.getSceneY();
      mouseDeltaX=(mousePosX - mouseOldX);
      mouseDeltaY=(mousePosY - mouseOldY);
      if (isPicking.get()) {
        double modifier=(me.isControlDown() ? 0.01 : me.isAltDown() ? 1.0 : 0.1) * (30d / camera.getFieldOfView());
        modifier*=(30d / camera.getFieldOfView());
        vecPos=unProjectDirection(mousePosX,mousePosY,subScene.getWidth(),subScene.getHeight());
        Point3D p=new Point3D(distance * (vecPos.x - vecIni.x),distance * (vecPos.y - vecIni.y),distance * (vecPos.z - vecIni.z));
        s.getTransforms().add(new Translate(modifier * p.getX(),modifier * p.getY(),modifier * p.getZ()));
        vecIni=vecPos;
      }
 else {
        double modifier=10.0;
        double modifierFactor=0.1;
        if (me.isControlDown()) {
          modifier=0.1;
        }
        if (me.isShiftDown()) {
          modifier=50.0;
        }
        if (me.isPrimaryButtonDown()) {
          cameraTransform.ry.setAngle(((cameraTransform.ry.getAngle() + mouseDeltaX * modifierFactor * modifier* 2.0) % 360 + 540) % 360 - 180);
          cameraTransform.rx.setAngle(((cameraTransform.rx.getAngle() - mouseDeltaY * modifierFactor * modifier* 2.0) % 360 + 540) % 360 - 180);
        }
 else         if (me.isSecondaryButtonDown()) {
          double z=camera.getTranslateZ();
          double newZ=z + mouseDeltaX * modifierFactor * modifier;
          camera.setTranslateZ(newZ);
        }
 else         if (me.isMiddleButtonDown()) {
          cameraTransform.t.setX(cameraTransform.t.getX() + mouseDeltaX * modifierFactor * modifier* 0.3);
          cameraTransform.t.setY(cameraTransform.t.getY() + mouseDeltaY * modifierFactor * modifier* 0.3);
        }
      }
    }
);
    subScene.setOnMouseReleased((    MouseEvent me) -> {
      if (isPicking.get()) {
        isPicking.set(false);
      }
    }
);
    onService.set(true);
    System.out.println("String_Node_Str");
    time=System.currentTimeMillis();
    service.start();
  }
  mainPane.sceneProperty().addListener(i -> {
    if (mainPane.getScene() != null) {
      mainPane.getScene().addEventHandler(MouseEvent.MOUSE_PRESSED,e -> {
        if (e.getPickResult() != null) {
          System.out.println(e.getPickResult().getIntersectedNode() + "String_Node_Str" + e.getPickResult().getIntersectedNode().getTypeSelector());
        }
      }
);
    }
  }
);
  return mainPane;
}