]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Test equality of ObjectVariants using Objects.equals 09/1709/3
authorJussi Koskela <jussi.koskela@semantum.fi>
Wed, 11 Apr 2018 11:14:38 +0000 (14:14 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 17 Apr 2018 12:42:16 +0000 (15:42 +0300)
refs #7865

Change-Id: I331d7696662709cdabaa9808d07071b079fc853e

bundles/org.simantics.databoard/src/org/simantics/databoard/binding/impl/ObjectVariantBinding.java
bundles/org.simantics.databoard/src/org/simantics/databoard/util/DataValueUtil.java

index edea4d36008d11519be8515ff491b35b2b4b56c0..45f3ae8f058c8f4a20aa9d7604a15bf0e6f91932 100644 (file)
@@ -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);
+       }
 }
index c4e41c6dab83be32fa73be59288310df80eb967b..89b167ad9e8664f95dcd42a005b73e2397709cbc 100644 (file)
@@ -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();
                }