From: Jussi Koskela Date: Wed, 11 Apr 2018 11:14:38 +0000 (+0300) Subject: Test equality of ObjectVariants using Objects.equals X-Git-Tag: v1.43.0~136^2~492 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F09%2F1709%2F3;p=simantics%2Fplatform.git Test equality of ObjectVariants using Objects.equals refs #7865 Change-Id: I331d7696662709cdabaa9808d07071b079fc853e --- diff --git a/bundles/org.simantics.databoard/src/org/simantics/databoard/binding/impl/ObjectVariantBinding.java b/bundles/org.simantics.databoard/src/org/simantics/databoard/binding/impl/ObjectVariantBinding.java index edea4d360..45f3ae8f0 100644 --- a/bundles/org.simantics.databoard/src/org/simantics/databoard/binding/impl/ObjectVariantBinding.java +++ b/bundles/org.simantics.databoard/src/org/simantics/databoard/binding/impl/ObjectVariantBinding.java @@ -11,6 +11,7 @@ *******************************************************************************/ package org.simantics.databoard.binding.impl; +import java.util.Objects; import java.util.Set; import org.simantics.databoard.adapter.AdaptException; @@ -191,4 +192,9 @@ public class ObjectVariantBinding extends VariantBinding { ObjectVariantBinding o = (ObjectVariantBinding)obj; return super.baseEquals( obj ) && o.adapterFactory == adapterFactory && o.bindingFactory == bindingFactory; } + + @Override + public boolean equals(Object o1, Object o2) { + return Objects.equals(o1, o2); + } } diff --git a/bundles/org.simantics.databoard/src/org/simantics/databoard/util/DataValueUtil.java b/bundles/org.simantics.databoard/src/org/simantics/databoard/util/DataValueUtil.java index c4e41c6da..89b167ad9 100644 --- a/bundles/org.simantics.databoard/src/org/simantics/databoard/util/DataValueUtil.java +++ b/bundles/org.simantics.databoard/src/org/simantics/databoard/util/DataValueUtil.java @@ -110,7 +110,7 @@ public class DataValueUtil { // Not implemented yet if (b1 == b2) { try { - return b1.compare(o1, o2) == 0; + return b1.equals(o1, o2); } catch (RuntimeBindingException e) { throw e.getCause(); }