commit | 01c93383c0411368b9cfe0e7af0dad7ed1119248 | [log] [tgz] |
---|---|---|
author | Thiago Santos <thiago@waltznetworks.com> | Fri Oct 20 14:22:57 2017 -0700 |
committer | Thomas Vachuska <tom@opennetworking.org> | Fri Feb 16 17:15:28 2018 +0000 |
tree | 5d1f650668414db5827639a94a40f9896af98fed | |
parent | 4a80a57dc114e6ff642c624202f22d9384c9b875 [diff] |
TestConsistentMap: cannot remove while iterating You get concurrent modification exceptions if you do that. Change to collecting all the keys before removing them. Change-Id: Ie2492eaf7d5dcfd8e8261285f7ad530a686a543a
diff --git a/core/api/src/test/java/org/onosproject/store/service/TestConsistentMap.java b/core/api/src/test/java/org/onosproject/store/service/TestConsistentMap.java index 673a531..4e25f4d 100644 --- a/core/api/src/test/java/org/onosproject/store/service/TestConsistentMap.java +++ b/core/api/src/test/java/org/onosproject/store/service/TestConsistentMap.java
@@ -184,7 +184,9 @@ @Override public void clear() { - map.keySet().forEach(this::remove); + for (K key : map.keySet().stream().collect(Collectors.toList())) { + remove(key); + } } @Override