Source:
public static boolean areEqual(VDomainModelReference left, EObject leftDomainModel, VDomainModelReference right, EObject rightDomainModel) { IObservableValue leftObservableValue; IObservableValue rightObservableValue; try { leftObservableValue = Activator.getDefault().getEMFFormsDatabinding() .getObservableValue(left, leftDomainModel); rightObservableValue = Activator.getDefault().getEMFFormsDatabinding() .getObservableValue(right, rightDomainModel); } catch (final DatabindingFailedException ex) { Activator.getDefault().getReportService().report(new DatabindingFailedReport(ex)); return false; } final EObject leftEObject = (EObject) ((IObserving) leftObservableValue).getObserved(); final EStructuralFeature leftStructuralFeature = (EStructuralFeature) leftObservableValue.getValueType(); final EObject rightEObject = (EObject) ((IObserving) rightObservableValue).getObserved(); final EStructuralFeature rightStructuralFeature = (EStructuralFeature) rightObservableValue.getValueType(); final Object leftValue = leftEObject.eGet(leftStructuralFeature, true); final Object rightValue = rightEObject.eGet(rightStructuralFeature, true); if (leftValue == null && rightValue == null) { return true; } if (leftValue == null && rightValue != null) { return false; } if (leftValue != null && rightValue == null) { return false; } if (leftValue.equals(rightValue)) { return true; } if (EcorePackage.eINSTANCE.getEReference().isInstance(leftStructuralFeature) && !leftStructuralFeature.isMany() || EcorePackage.eINSTANCE.getEReference().isInstance(rightStructuralFeature) && !rightStructuralFeature.isMany()) { return EcoreUtil.equals(EObject.class.cast(leftValue), EObject.class.cast(rightValue)); } if (leftStructuralFeature.isMany() && rightStructuralFeature.isMany()) { return handleLists(leftStructuralFeature, rightStructuralFeature, leftValue, rightValue); } return false; }

Target:
public static boolean areEqual(VDomainModelReference left, EObject leftDomainModel, VDomainModelReference right, EObject rightDomainModel) { IObservableValue leftObservableValue; IObservableValue rightObservableValue; try { leftObservableValue = Activator.getDefault().getEMFFormsDatabinding() .getObservableValue(left, leftDomainModel); rightObservableValue = Activator.getDefault().getEMFFormsDatabinding() .getObservableValue(right, rightDomainModel); } catch (final DatabindingFailedException ex) { Activator.getDefault().getReportService().report(new DatabindingFailedReport(ex)); return false; } final EObject leftEObject = (EObject) ((IObserving) leftObservableValue).getObserved(); final EStructuralFeature leftStructuralFeature = (EStructuralFeature) leftObservableValue.getValueType(); final EObject rightEObject = (EObject) ((IObserving) rightObservableValue).getObserved(); final EStructuralFeature rightStructuralFeature = (EStructuralFeature) rightObservableValue.getValueType(); leftObservableValue.dispose(); rightObservableValue.dispose(); final Object leftValue = leftEObject.eGet(leftStructuralFeature, true); final Object rightValue = rightEObject.eGet(rightStructuralFeature, true); if (leftValue == null && rightValue == null) { return true; } if (leftValue == null && rightValue != null) { return false; } if (leftValue != null && rightValue == null) { return false; } if (leftValue.equals(rightValue)) { return true; } if (EcorePackage.eINSTANCE.getEReference().isInstance(leftStructuralFeature) && !leftStructuralFeature.isMany() || EcorePackage.eINSTANCE.getEReference().isInstance(rightStructuralFeature) && !rightStructuralFeature.isMany()) { return EcoreUtil.equals(EObject.class.cast(leftValue), EObject.class.cast(rightValue)); } if (leftStructuralFeature.isMany() && rightStructuralFeature.isMany()) { return handleLists(leftStructuralFeature, rightStructuralFeature, leftValue, rightValue); } return false; }