Source:
public static Option<Point> setSourceAnchor(Edge edge, PointList newPoints) { Point referencePointOfChangedAnchor = null; if (edge.getSource() instanceof Node) { Rectangle sourceFigure = GMFHelper.getBounds((Node) edge.getSource(), true); int newXAnchorLocation = newPoints.getPoint(1).x; double newXAnchorPercentage = ((double) (newXAnchorLocation - sourceFigure.x)) / ((double) sourceFigure.width); if (edge.getSourceAnchor() instanceof IdentityAnchor) { IdentityAnchor anchor = (IdentityAnchor) edge.getSourceAnchor(); PrecisionPoint relativeReferencePoint = BaseSlidableAnchor.parseTerminalString(anchor.getId()); if (Math.abs(relativeReferencePoint.preciseX() - newXAnchorPercentage) > 0.0000001) { setIdentityAnchorId(anchor, newXAnchorPercentage, relativeReferencePoint.preciseY()); referencePointOfChangedAnchor = new PrecisionPoint(sourceFigure.getLocation().x + sourceFigure.width * newXAnchorPercentage, sourceFigure.getLocation().y + sourceFigure.height * relativeReferencePoint.preciseY()); } } else if (edge.getSourceAnchor() == null) { IdentityAnchor anchor = NotationFactory.eINSTANCE.createIdentityAnchor(); setIdentityAnchorId(anchor, newXAnchorPercentage, 0.5d); edge.setSourceAnchor(anchor); referencePointOfChangedAnchor = new PrecisionPoint(sourceFigure.getLocation().x + sourceFigure.width * newXAnchorPercentage, sourceFigure.getLocation().y + sourceFigure.height * 0.5d); } } else if (edge.getSource() instanceof Edge) { throw new UnsupportedOperationException(Messages.GMFNotationUtilities_edgeOnEdgeNotManaged); } if (referencePointOfChangedAnchor == null) { return Options.newNone(); } else { return Options.newSome(referencePointOfChangedAnchor); } }

Target:
public static Option<Point> setSourceAnchor(Edge edge, PointList newPoints) { Point referencePointOfChangedAnchor = null; if (edge.getSource() instanceof Node) { Rectangle sourceFigure = GMFHelper.getBounds((Node) edge.getSource(), true); int newXAnchorLocation = newPoints.getPoint(1).x; double newXAnchorPercentage = ((double) (newXAnchorLocation - sourceFigure.x)) / ((double) sourceFigure.width); if (edge.getSourceAnchor() instanceof IdentityAnchor) { IdentityAnchor anchor = (IdentityAnchor) edge.getSourceAnchor(); PrecisionPoint relativeReferencePoint = BaseSlidableAnchor.parseTerminalString(anchor.getId()); if (Math.abs(relativeReferencePoint.preciseX() - newXAnchorPercentage) > FP_TOLERANCE) { setIdentityAnchorId(anchor, newXAnchorPercentage, relativeReferencePoint.preciseY()); referencePointOfChangedAnchor = new PrecisionPoint(sourceFigure.getLocation().x + sourceFigure.width * newXAnchorPercentage, sourceFigure.getLocation().y + sourceFigure.height * relativeReferencePoint.preciseY()); } } else if (edge.getSourceAnchor() == null) { IdentityAnchor anchor = NotationFactory.eINSTANCE.createIdentityAnchor(); setIdentityAnchorId(anchor, newXAnchorPercentage, 0.5d); edge.setSourceAnchor(anchor); referencePointOfChangedAnchor = new PrecisionPoint(sourceFigure.getLocation().x + sourceFigure.width * newXAnchorPercentage, sourceFigure.getLocation().y + sourceFigure.height * 0.5d); } } else if (edge.getSource() instanceof Edge) { throw new UnsupportedOperationException(Messages.GMFNotationUtilities_edgeOnEdgeNotManaged); } if (referencePointOfChangedAnchor == null) { return Options.newNone(); } else { return Options.newSome(referencePointOfChangedAnchor); } }