From: Tuukka Lehtonen Date: Thu, 2 Nov 2017 12:56:16 +0000 (+0200) Subject: Fixed databoard set binding getAll indexing bug X-Git-Tag: v1.31.0~66 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F82%2F1182%2F1;p=simantics%2Fplatform.git Fixed databoard set binding getAll indexing bug All *SetBindings were missing a simple i++ increment which caused serialization of a TreeSet<..> structure to fail with NPE when the set contained more than 1 elements. refs #7592 Change-Id: Ic0f10324dfbfbafe527c624d7d092928a2f10bb7 --- diff --git a/bundles/org.simantics.databoard/src/org/simantics/databoard/binding/impl/DefaultSetBinding.java b/bundles/org.simantics.databoard/src/org/simantics/databoard/binding/impl/DefaultSetBinding.java index 1e8a56e02..6c0328801 100644 --- a/bundles/org.simantics.databoard/src/org/simantics/databoard/binding/impl/DefaultSetBinding.java +++ b/bundles/org.simantics.databoard/src/org/simantics/databoard/binding/impl/DefaultSetBinding.java @@ -116,7 +116,8 @@ public class DefaultSetBinding extends MapBinding { for (Object k : _setFrom) { keys[i] = k; values[i] = null; - } + i++; + } } @Override diff --git a/bundles/org.simantics.databoard/src/org/simantics/databoard/binding/impl/HashSetBinding.java b/bundles/org.simantics.databoard/src/org/simantics/databoard/binding/impl/HashSetBinding.java index 7a6230b2d..ce245d187 100644 --- a/bundles/org.simantics.databoard/src/org/simantics/databoard/binding/impl/HashSetBinding.java +++ b/bundles/org.simantics.databoard/src/org/simantics/databoard/binding/impl/HashSetBinding.java @@ -121,7 +121,8 @@ public class HashSetBinding extends MapBinding { for (Object k : _setFrom) { keys[i] = k; values[i] = null; - } + i++; + } } @Override diff --git a/bundles/org.simantics.databoard/src/org/simantics/databoard/binding/impl/TreeSetBinding.java b/bundles/org.simantics.databoard/src/org/simantics/databoard/binding/impl/TreeSetBinding.java index b030b9c5a..b36e016aa 100644 --- a/bundles/org.simantics.databoard/src/org/simantics/databoard/binding/impl/TreeSetBinding.java +++ b/bundles/org.simantics.databoard/src/org/simantics/databoard/binding/impl/TreeSetBinding.java @@ -118,7 +118,8 @@ public class TreeSetBinding extends MapBinding { for (Object k : _setFrom) { keys[i] = k; values[i] = null; - } + i++; + } } @Override