Program: 170485
Project: 170485
Buggy source:
@Override public boolean dragAdjust(final Point2D dxy){
  int x=0;
  int y=0;
  if (m_startDocked) {
    x=(int)m_shapeStartCenterX;
    y=(int)m_shapeStartCenterY;
  }
 else {
    x=(int)m_mouseStartX;
    y=(int)m_mouseStartY;
  }
  WiresContainer parent=null;
  x=(int)(x + dxy.getX());
  y=(int)(y + dxy.getY());
  PickerPart parentPart=m_picker.findShapeAt(x,y);
  if (parentPart != null) {
    parent=parentPart.getShape();
  }
  if (parent != m_parent || parentPart != m_parentPart) {
    m_picker=makeColorMapBackedPicker(m_layer,parent,m_shape);
    parentPart=m_picker.findShapeAt(x,y);
    parent=null != parentPart ? parentPart.getShape() : null;
    boolean batch=false;
    if (m_parent != null && m_parent instanceof WiresShape) {
      if (m_parentPart != null && m_parentPart.getShapePart() == PickerPart.ShapePart.BODY) {
        restoreBody();
      }
 else       if (m_path != null) {
        m_path.removeFromParent();
        m_path=null;
        m_shape.setDockedTo(null);
        m_startDocked=false;
      }
      batch=true;
    }
    if (parent != null && parent instanceof WiresShape) {
      if (parentPart.getShapePart() == PickerPart.ShapePart.BODY) {
        if (parent.getContainmentAcceptor().containmentAllowed(parent,m_shape)) {
          highlightBody((WiresShape)parent);
        }
      }
 else       if (parent.getDockingAcceptor().dockingAllowed(parent,m_shape)) {
        highlightBorder((WiresShape)parent);
      }
 else {
        parentPart=null;
      }
      batch=true;
    }
    if (batch) {
      m_layer.getLayer().batch();
      m_layer.getLayer().getOverLayer().batch();
    }
  }
  m_parent=parent;
  m_parentPart=parentPart;
  if (m_path != null) {
    Point2D absLoc=WiresUtils.getLocation(m_parent.getGroup());
    Point2D intersection=Geometry.findIntersection((int)(x - absLoc.getX()),(int)(y - absLoc.getY()),((WiresShape)m_parent).getPath());
    if (intersection != null) {
      BoundingBox box=m_shape.getPath().getBoundingBox();
      double newX=absLoc.getX() + intersection.getX() - (box.getWidth() / 2);
      double newY=absLoc.getY() + intersection.getY() - (box.getHeight() / 2);
      dxy.setX(newX - m_shapeStartX).setY(newY - m_shapeStartY);
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean dragAdjust(final Point2D dxy){
  int x=0;
  int y=0;
  if (m_startDocked) {
    x=(int)m_shapeStartCenterX;
    y=(int)m_shapeStartCenterY;
  }
 else {
    x=(int)m_mouseStartX;
    y=(int)m_mouseStartY;
  }
  WiresContainer parent=null;
  x=(int)(x + dxy.getX());
  y=(int)(y + dxy.getY());
  PickerPart parentPart=m_picker.findShapeAt(x,y);
  if (parentPart != null) {
    parent=parentPart.getShape();
  }
  if (parent != m_parent || parentPart != m_parentPart) {
    m_picker=makeColorMapBackedPicker(m_layer,parent,m_shape);
    parentPart=m_picker.findShapeAt(x,y);
    parent=null != parentPart ? parentPart.getShape() : null;
    boolean batch=false;
    if (m_parent != null && m_parent instanceof WiresShape) {
      if (m_parentPart != null && m_parentPart.getShapePart() == PickerPart.ShapePart.BODY) {
        restoreBody();
      }
 else       if (m_path != null) {
        m_path.removeFromParent();
        m_path=null;
        m_shape.setDockedTo(null);
        m_startDocked=false;
      }
      batch=true;
    }
    if (parent != null && parent instanceof WiresShape) {
      if (parentPart.getShapePart() == PickerPart.ShapePart.BODY) {
        if (parent.getContainmentAcceptor().containmentAllowed(parent,m_shape)) {
          highlightBody((WiresShape)parent);
        }
      }
 else       if (parent.getDockingAcceptor().dockingAllowed(parent,m_shape)) {
        highlightBorder((WiresShape)parent);
      }
 else {
        parentPart=null;
      }
      batch=true;
    }
 else {
      m_layer.getContainmentAcceptor().containmentAllowed(m_layer,m_shape);
    }
    if (batch) {
      m_layer.getLayer().batch();
      m_layer.getLayer().getOverLayer().batch();
    }
  }
  m_parent=parent;
  m_parentPart=parentPart;
  if (m_path != null) {
    Point2D absLoc=WiresUtils.getLocation(m_parent.getGroup());
    Point2D intersection=Geometry.findIntersection((int)(x - absLoc.getX()),(int)(y - absLoc.getY()),((WiresShape)m_parent).getPath());
    if (intersection != null) {
      BoundingBox box=m_shape.getPath().getBoundingBox();
      double newX=absLoc.getX() + intersection.getX() - (box.getWidth() / 2);
      double newY=absLoc.getY() + intersection.getY() - (box.getHeight() / 2);
      dxy.setX(newX - m_shapeStartX).setY(newY - m_shapeStartY);
      return true;
    }
  }
  return false;
}