Program: 58329
Project: 58329
Buggy source:
/** 
 * Adds a click selection mechanism for nodes.
 */
private void addClickSelectionForNodes(){
  for (  final GNode node : model.getNodes()) {
    final Region nodeRegion=skinLookup.lookupNode(node).getRoot();
    final EventHandler<MouseEvent> oldNodePressedHandler=nodePressedHandlers.get(node);
    final EventHandler<MouseEvent> oldNodeDraggedHandler=nodeDraggedHandlers.get(node);
    final EventHandler<MouseEvent> oldNodeReleasedHandler=nodeReleasedHandlers.get(node);
    if (oldNodePressedHandler != null) {
      nodeRegion.removeEventHandler(MouseEvent.MOUSE_PRESSED,oldNodePressedHandler);
    }
    if (oldNodeDraggedHandler != null) {
      nodeRegion.removeEventFilter(MouseEvent.MOUSE_DRAGGED,oldNodeDraggedHandler);
    }
    if (oldNodeReleasedHandler != null) {
      nodeRegion.removeEventHandler(MouseEvent.MOUSE_RELEASED,oldNodeReleasedHandler);
    }
    final EventHandler<MouseEvent> newNodePressedHandler=event -> handleNodePressed(event,node);
    final EventHandler<MouseEvent> newNodeDraggedHandler=event -> handleNodeDragged(event,node);
    final EventHandler<MouseEvent> newNodeReleasedHandler=event -> handleNodeReleased(event,node);
    nodeRegion.addEventHandler(MouseEvent.MOUSE_PRESSED,newNodePressedHandler);
    nodeRegion.addEventFilter(MouseEvent.MOUSE_DRAGGED,newNodeDraggedHandler);
    nodeRegion.addEventHandler(MouseEvent.MOUSE_RELEASED,newNodeReleasedHandler);
    nodePressedHandlers.put(node,newNodePressedHandler);
    nodeDraggedHandlers.put(node,newNodeDraggedHandler);
    nodeReleasedHandlers.put(node,newNodeReleasedHandler);
    for (    final GConnector connector : node.getConnectors()) {
      final Node connectorRoot=skinLookup.lookupConnector(connector).getRoot();
      final EventHandler<MouseEvent> oldConnectorPressedHandler=connectorPressedHandlers.get(connector);
      if (oldConnectorPressedHandler != null) {
        connectorRoot.removeEventHandler(MouseEvent.MOUSE_PRESSED,oldConnectorPressedHandler);
      }
      final EventHandler<MouseEvent> newConnectorPressedHandler=event -> handleConnectorPressed(event);
      connectorRoot.addEventHandler(MouseEvent.MOUSE_PRESSED,newConnectorPressedHandler);
      connectorPressedHandlers.put(connector,newConnectorPressedHandler);
    }
  }
}

Fixed version (ground truth):
/** 
 * Adds a click selection mechanism for nodes.
 */
private void addClickSelectionForNodes(){
  for (  final GNode node : model.getNodes()) {
    final Region nodeRegion=skinLookup.lookupNode(node).getRoot();
    final EventHandler<MouseEvent> oldNodePressedHandler=nodePressedHandlers.get(node);
    final EventHandler<MouseEvent> oldNodeReleasedHandler=nodeReleasedHandlers.get(node);
    if (oldNodePressedHandler != null) {
      nodeRegion.removeEventHandler(MouseEvent.MOUSE_PRESSED,oldNodePressedHandler);
    }
    if (oldNodeReleasedHandler != null) {
      nodeRegion.removeEventHandler(MouseEvent.MOUSE_RELEASED,oldNodeReleasedHandler);
    }
    final EventHandler<MouseEvent> newNodePressedHandler=event -> handleNodePressed(event,node);
    final EventHandler<MouseEvent> newNodeReleasedHandler=event -> handleNodeReleased(event,node);
    nodeRegion.addEventHandler(MouseEvent.MOUSE_PRESSED,newNodePressedHandler);
    nodeRegion.addEventHandler(MouseEvent.MOUSE_RELEASED,newNodeReleasedHandler);
    nodePressedHandlers.put(node,newNodePressedHandler);
    nodeReleasedHandlers.put(node,newNodeReleasedHandler);
    for (    final GConnector connector : node.getConnectors()) {
      final Node connectorRoot=skinLookup.lookupConnector(connector).getRoot();
      final EventHandler<MouseEvent> oldConnectorPressedHandler=connectorPressedHandlers.get(connector);
      if (oldConnectorPressedHandler != null) {
        connectorRoot.removeEventHandler(MouseEvent.MOUSE_PRESSED,oldConnectorPressedHandler);
      }
      final EventHandler<MouseEvent> newConnectorPressedHandler=event -> handleConnectorPressed(event);
      connectorRoot.addEventHandler(MouseEvent.MOUSE_PRESSED,newConnectorPressedHandler);
      connectorPressedHandlers.put(connector,newConnectorPressedHandler);
    }
  }
}