Program: 170484
Project: 170484
Buggy source:
protected void addShapeToParent(){
  Point2D absLoc=WiresUtils.getLocation(m_shape.getGroup());
  if (m_parent == null) {
    m_parent=m_layer;
  }
  if (m_path != null) {
    m_path.removeFromParent();
    m_layer.getLayer().getOverLayer().batch();
  }
  if (m_parentPart == null || m_parentPart.getShapePart() == PickerPart.ShapePart.BODY) {
    if (m_parent.getContainmentAcceptor().acceptContainment(m_parent,m_shape)) {
      if (m_parent instanceof WiresShape) {
        restoreBody();
      }
      if (m_parent == m_layer) {
        m_parent.getLayoutHandler().add(m_shape,m_parent,absLoc);
      }
 else {
        final Point2D trgAbsOffset=WiresUtils.getLocation(m_parent.getGroup());
        final Point2D relativeLoc=new Point2D(absLoc.getX() - trgAbsOffset.getX(),absLoc.getY() - trgAbsOffset.getY());
        m_parent.getLayoutHandler().add(m_shape,m_parent,relativeLoc);
      }
      m_shape.setDockedTo(null);
      m_layer.getLayer().batch();
    }
  }
 else   if (m_parentPart != null && m_parentPart.getShapePart() != PickerPart.ShapePart.BODY && m_parent.getDockingAcceptor().acceptDocking(m_parent,m_shape)) {
    m_shape.removeFromParent();
    Point2D trgAbsOffset=WiresUtils.getLocation(m_parent.getContainer());
    m_shape.getGroup().setX(absLoc.getX() - trgAbsOffset.getX()).setY(absLoc.getY() - trgAbsOffset.getY());
    m_parent.add(m_shape);
    m_shape.setDockedTo(m_parent);
    m_layer.getLayer().batch();
  }
 else {
    throw new IllegalStateException("String_Node_Str");
  }
  m_parent=null;
  m_parentPart=null;
  m_priorFill=null;
  m_priorFillChanged=false;
  m_priorFillGradient=null;
  m_picker=null;
}

Fixed version (ground truth):
protected boolean addShapeToParent(){
  Point2D absLoc=WiresUtils.getLocation(m_shape.getGroup());
  if (m_parent == null) {
    m_parent=m_layer;
  }
  if (m_path != null) {
    m_path.removeFromParent();
    m_layer.getLayer().getOverLayer().batch();
  }
  boolean accepted=true;
  if (m_parentPart == null || m_parentPart.getShapePart() == PickerPart.ShapePart.BODY) {
    if (m_parent.getContainmentAcceptor().acceptContainment(m_parent,m_shape)) {
      if (m_parent instanceof WiresShape) {
        restoreBody();
      }
      if (m_parent == m_layer) {
        m_parent.getLayoutHandler().add(m_shape,m_parent,absLoc);
      }
 else {
        final Point2D trgAbsOffset=WiresUtils.getLocation(m_parent.getGroup());
        final Point2D relativeLoc=new Point2D(absLoc.getX() - trgAbsOffset.getX(),absLoc.getY() - trgAbsOffset.getY());
        m_parent.getLayoutHandler().add(m_shape,m_parent,relativeLoc);
      }
      m_shape.setDockedTo(null);
      m_layer.getLayer().batch();
    }
 else {
      accepted=false;
    }
  }
 else   if (m_parentPart != null && m_parentPart.getShapePart() != PickerPart.ShapePart.BODY && m_parent.getDockingAcceptor().acceptDocking(m_parent,m_shape)) {
    m_shape.removeFromParent();
    Point2D trgAbsOffset=WiresUtils.getLocation(m_parent.getContainer());
    m_shape.getGroup().setX(absLoc.getX() - trgAbsOffset.getX()).setY(absLoc.getY() - trgAbsOffset.getY());
    m_parent.add(m_shape);
    m_shape.setDockedTo(m_parent);
    m_layer.getLayer().batch();
  }
 else {
    throw new IllegalStateException("String_Node_Str");
  }
  m_parent=null;
  m_parentPart=null;
  m_priorFill=null;
  m_priorFillChanged=false;
  m_priorFillGradient=null;
  m_picker=null;
  return accepted;
}