]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.databoard/src/org/simantics/databoard/util/ObjectUtils.java
Merge "Revert "Default property editing restores assertions""
[simantics/platform.git] / bundles / org.simantics.databoard / src / org / simantics / databoard / util / ObjectUtils.java
index 8293f0232b06df41ccec386019c77c50fccf53ef..85b8af1539521e17b69f9e9fc2e541348742afb6 100644 (file)
@@ -1,24 +1,25 @@
-/*******************************************************************************\r
- *  Copyright (c) 2010 Association for Decentralized Information Management in\r
- *  Industry THTH ry.\r
- *  All rights reserved. This program and the accompanying materials\r
- *  are made available under the terms of the Eclipse Public License v1.0\r
- *  which accompanies this distribution, and is available at\r
- *  http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- *  Contributors:\r
- *      VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
+/*******************************************************************************
+ *  Copyright (c) 2010 Association for Decentralized Information Management in
+ *  Industry THTH ry.
+ *  All rights reserved. This program and the accompanying materials
+ *  are made available under the terms of the Eclipse Public License v1.0
+ *  which accompanies this distribution, and is available at
+ *  http://www.eclipse.org/legal/epl-v10.html
+ *
+ *  Contributors:
+ *      VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
 
 package org.simantics.databoard.util;
 
-import java.lang.reflect.Array;\r
-import java.lang.reflect.Field;\r
-import java.util.Arrays;\r
-import java.util.Collection;\r
-import java.util.HashSet;\r
-import java.util.Iterator;\r
-import java.util.Set;\r
+import java.lang.reflect.Array;
+import java.lang.reflect.Field;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Objects;
+import java.util.Set;
 
 /**
  * ObjectUtils
@@ -38,6 +39,8 @@ public class ObjectUtils {
         if (o1==o2) return true;
         if (o1==null && o2==null) return true;
         if (o1==null || o2==null) return false;
+        if (o1.getClass().isArray() && o2.getClass().isArray())
+            return Objects.deepEquals(o1, o2);
         return o1.equals(o2);
     }