]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Fixed databoard set binding getAll indexing bug 82/1182/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 2 Nov 2017 12:56:16 +0000 (14:56 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 2 Nov 2017 12:56:16 +0000 (14:56 +0200)
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

bundles/org.simantics.databoard/src/org/simantics/databoard/binding/impl/DefaultSetBinding.java
bundles/org.simantics.databoard/src/org/simantics/databoard/binding/impl/HashSetBinding.java
bundles/org.simantics.databoard/src/org/simantics/databoard/binding/impl/TreeSetBinding.java

index 1e8a56e0282ed211c3e14e8add31c4e4bb51996f..6c03288012c4a8b9c12e3bfe8f1731528bd45f76 100644 (file)
@@ -116,7 +116,8 @@ public class DefaultSetBinding extends MapBinding {
                for (Object k : _setFrom) {
                        keys[i] = k;
                        values[i] = null;
-               }               
+                       i++;
+               }
        }
 
        @Override
index 7a6230b2d8f1b8fb2f6ce9a9ce89668ba555cb1b..ce245d187a0fe9372abc4aaaa1e3c3952101aa58 100644 (file)
@@ -121,7 +121,8 @@ public class HashSetBinding extends MapBinding {
                for (Object k : _setFrom) {
                        keys[i] = k;
                        values[i] = null;
-               }               
+                       i++;
+               }
        }
 
        @Override
index b030b9c5a26a7db2542da31958cf67b8ce58fb1e..b36e016aa5d1b234024baabaf393cd09290d4b4d 100644 (file)
@@ -118,7 +118,8 @@ public class TreeSetBinding extends MapBinding {
                for (Object k : _setFrom) {
                        keys[i] = k;
                        values[i] = null;
-               }               
+                       i++;
+               }
        }
 
        @Override