fix #6389 Fixed cache loader method
authorPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 27 Feb 2018 13:30:33 +0000 (14:30 +0100)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 27 Feb 2018 13:30:33 +0000 (14:30 +0100)
 - the wrong collection size was used for iteration leaving out the
second half of map entries

eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CacheLoader.java

index 329741968a1c488a2262da2927e549489c7ae7ae..ac773837d17af23be02d5b37929597ed9a99f20a 100644 (file)
@@ -122,7 +122,6 @@ public class CacheLoader {
             return map;
         }
 
-        int originalMapSize = map.size();
         Object[] result = new Object[ map.size() * 2 ];
         Iterator<Map.Entry<T,T>> iter = map.entrySet().iterator();
         int i=0;
@@ -142,7 +141,7 @@ public class CacheLoader {
             }
         }
         map.clear();
-        for(i = 0; i < originalMapSize; i+=2 ) {
+        for(i = 0; i < result.length; i+=2 ) {
             map.put(
                     (T)result[i],
                     (T)result[i+1]