Program: 133362
Project: 133362
Buggy source:
/** 
 * The function called whenever the mouse is dragged in Edit Mode.
 * @param event The event which prompted the invocation of this function.
 */
private void handleEditModeDrag(MouseEvent event){
  mouseOldX=mousePosX;
  mouseOldY=mousePosY;
  mousePosX=event.getX();
  mousePosY=event.getY();
  PickResult pickResult=event.getPickResult();
  Node intersectedNode=pickResult.getIntersectedNode();
  if (intersectedNode instanceof Shape3D || dragStarted) {
    dragStarted=true;
    Group nodeParent=(Group)intersectedNode.getParent();
    AbstractController modelShape=(AbstractController)nodeParent.getProperties().get(AbstractController.class);
    if (selectedVertices.contains(modelShape) || dragStarted) {
      if (vertexMarkers.isEmpty()) {
        double[] cursorLocation=((VertexController)modelShape).getTranslation();
        for (        AbstractController vertex : selectedVertices) {
          Sphere marker=new Sphere(1);
          double[] position=((VertexController)vertex).getTranslation();
          marker.setTranslateX(position[0]);
          marker.setTranslateY(position[1]);
          vertexMarkers.add(marker);
          relativeXCords.add(position[0] - cursorLocation[0]);
          relativeYCords.add(position[1] - cursorLocation[1]);
          ((FXAttachment)attachmentManager.getAttachments().get(1)).getFxNode().getChildren().add(marker);
        }
      }
      for (int i=0; i < vertexMarkers.size(); i++) {
        Sphere marker=vertexMarkers.get(i);
        marker.setTranslateX(relativeXCords.get(i) + mousePosX);
        marker.setTranslateY(relativeYCords.get(i) + mousePosY);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * The function called whenever the mouse is dragged in Edit Mode.
 * @param event The event which prompted the invocation of this function.
 */
private void handleEditModeDrag(MouseEvent event){
  mouseOldX=mousePosX;
  mouseOldY=mousePosY;
  mousePosX=event.getX();
  mousePosY=event.getY();
  PickResult pickResult=event.getPickResult();
  Node intersectedNode=pickResult.getIntersectedNode();
  dragStarted=true;
  Group nodeParent=(Group)intersectedNode.getParent();
  AbstractController modelShape=(AbstractController)nodeParent.getProperties().get(AbstractController.class);
  if (selectedVertices.contains(modelShape) || dragStarted) {
    if (vertexMarkers.isEmpty()) {
      double[] cursorLocation=((VertexController)modelShape).getTranslation();
      for (      AbstractController vertex : selectedVertices) {
        Sphere marker=new Sphere(1);
        double[] position=((VertexController)vertex).getTranslation();
        marker.setTranslateX(position[0]);
        marker.setTranslateY(position[1]);
        vertexMarkers.add(marker);
        relativeXCords.add(position[0] - cursorLocation[0]);
        relativeYCords.add(position[1] - cursorLocation[1]);
        ((FXAttachment)attachmentManager.getAttachments().get(1)).getFxNode().getChildren().add(marker);
      }
    }
    for (int i=0; i < vertexMarkers.size(); i++) {
      Sphere marker=vertexMarkers.get(i);
      double xAdjust=0;
      double yAdjust=0;
      for (      Double x : relativeXCords) {
        if (x + mousePosX + xAdjust < -16d * SCALE) {
          xAdjust=-16d * SCALE - x - mousePosX;
        }
 else         if (x + mousePosX + xAdjust > 16d * SCALE) {
          xAdjust=16d * SCALE - x - mousePosX;
        }
      }
      for (      Double y : relativeYCords) {
        if (y + mousePosY + yAdjust < -8d * SCALE) {
          yAdjust=-8d * SCALE - y - mousePosY;
        }
 else         if (y + mousePosY + yAdjust > 8d * SCALE) {
          yAdjust=8d * SCALE - y - mousePosY;
        }
      }
      marker.setTranslateX(relativeXCords.get(i) + mousePosX + xAdjust);
      marker.setTranslateY(relativeYCords.get(i) + mousePosY + yAdjust);
    }
  }
}