From e760d181abd20ecb98654af63faec7b2a4d61189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Boskovits?= Date: Mon, 25 Jun 2018 15:02:25 +0200 Subject: [PATCH] Rename removes in maps to fix java8. * src/java/org/apache/commons/collections/MultiHashMap.java: Rename "V MultiHashMap#remove(K, V)" to "boolean MulitHashMap#removeMapping(K, V)". * src/java/org/apache/commons/collections/MultiMap.java: Rename "V MultiMap#remove(K, V)" to "boolean MultiMap#removeMapping(K, V)". * src/java/org/apache/commons/collections/map/MultiKeyMap.java: Rename "V MultiKeyMap#remove(...)" to "V MultiKeyMap#removeMultiKey(...)". * src/java/org/apache/commons/collections/map/MultiValueMap.java: Rename "V MultiValueMap#remove(K, V)" to "boolean MultiValueMap#removeMapping(K, V)". * src/test/org/apache/commons/collections/TestMultiHashMap.java: Adjust accordingly. * src/test/org/apache/commons/collections/map/TestMultiKeyMap.java: Adjust accordingly. * src/test/or
aboutsummaryrefslogtreecommitdiff
path: root/ChangeLog
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2021-01-03 21:02:12 +0200
committerEfraim Flashner <efraim@flashner.co.il>2021-01-03 21:02:12 +0200
commitdfcca5e98c00c958d9f428dac1373b8f8a79b754 (patch)
tree2cec515df1a49374efe8c03e18fcf07139bf7fe2 /ChangeLog
parentc10829a52b1bc80e69d24007f65b637022a2a3b4 (diff)
downloadguix-dfcca5e98c00c958d9f428dac1373b8f8a79b754.tar.gz
guix-dfcca5e98c00c958d9f428dac1373b8f8a79b754.zip
gnu: rust-unicode-segmentation-1: Update to 1.7.1.
* gnu/packages/crates-io.scm (rust-unicode-segmentation-1): Update to 1.7.1.
Diffstat (limited to 'ChangeLog')
0 files changed, 0 insertions, 0 deletions
ultiValueMap.java index f44999b..86eaeb0 100644 --- a/src/java/org/apache/commons/collections/map/MultiValueMap.java +++ b/src/java/org/apache/commons/collections/map/MultiValueMap.java @@ -153,19 +153,19 @@ public class MultiValueMap extends AbstractMapDecorator implements MultiMap { * @param value the value to remove * @return the value removed (which was passed in), null if nothing removed */ - public Object remove(Object key, Object value) { + public boolean removeMapping(Object key, Object value) { Collection valuesForKey = getCollection(key); if (valuesForKey == null) { - return null; + return false; } boolean removed = valuesForKey.remove(value); if (removed == false) { - return null; + return false; } if (valuesForKey.isEmpty()) { remove(key); } - return value; + return true; } /** diff --git a/src/test/org/apache/commons/collections/TestMultiHashMap.java b/src/test/org/apache/commons/collections/TestMultiHashMap.java index eca833a..a1de943 100644 --- a/src/test/org/apache/commons/collections/TestMultiHashMap.java +++ b/src/test/org/apache/commons/collections/TestMultiHashMap.java @@ -217,7 +217,7 @@ public class TestMultiHashMap extends AbstractTestMap { MultiHashMap one = new MultiHashMap(); Integer value = new Integer(1); one.put("One", value); - one.remove("One", value); + one.removeMapping("One", value); MultiHashMap two = new MultiHashMap(); assertEquals(two, one); @@ -269,7 +269,7 @@ public class TestMultiHashMap extends AbstractTestMap { assertEquals(4, map.totalSize()); map.remove("A"); assertEquals(3, map.totalSize()); - map.remove("B", "BC"); + map.removeMapping("B", "BC"); assertEquals(2, map.totalSize()); } @@ -292,7 +292,7 @@ public class TestMultiHashMap extends AbstractTestMap { map.remove("A"); assertEquals(0, map.size("A")); assertEquals(3, map.size("B")); - map.remove("B", "BC"); + map.removeMapping("B", "BC"); assertEquals(0, map.size("A")); assertEquals(2, map.size("B")); } @@ -464,11 +464,11 @@ public class TestMultiHashMap extends AbstractTestMap { map.put("A", "AA"); map.put("A", "AB"); map.put("A", "AC"); - assertEquals(null, map.remove("C", "CA")); - assertEquals(null, map.remove("A", "AD")); - assertEquals("AC", map.remove("A", "AC")); - assertEquals("AB", map.remove("A", "AB")); - assertEquals("AA", map.remove("A", "AA")); + assertEquals(false, map.removeMapping("C", "CA")); + assertEquals(false, map.removeMapping("A", "AD")); + assertEquals(true, map.removeMapping("A", "AC")); + assertEquals(true, map.removeMapping("A", "AB")); + assertEquals(true, map.removeMapping("A", "AA")); assertEquals(new MultiHashMap(), map); } diff --git a/src/test/org/apache/commons/collections/map/TestMultiKeyMap.java b/src/test/org/apache/commons/collections/map/TestMultiKeyMap.java index b1ee3d0..b18f480 100644 --- a/src/test/org/apache/commons/collections/map/TestMultiKeyMap.java +++ b/src/test/org/apache/commons/collections/map/TestMultiKeyMap.java @@ -315,34 +315,34 @@ public class TestMultiKeyMap extends AbstractTestIterableMap { switch (key.size()) { case 2: assertEquals(true, multimap.containsKey(key.getKey(0), key.getKey(1))); - assertEquals(value, multimap.remove(key.getKey(0), key.getKey(1))); + assertEquals(value, multimap.removeMultiKey(key.getKey(0), key.getKey(1))); assertEquals(false, multimap.containsKey(key.getKey(0), key.getKey(1))); assertEquals(size - 1, multimap.size()); - assertEquals(null, multimap.remove(key.getKey(0), key.getKey(1))); + assertEquals(null, multimap.removeMultiKey(key.getKey(0), key.getKey(1))); assertEquals(false, multimap.containsKey(key.getKey(0), key.getKey(1))); break; case 3: assertEquals(true, multimap.containsKey(key.getKey(0), key.getKey(1), key.getKey(2))); - assertEquals(value, multimap.remove(key.getKey(0), key.getKey(1), key.getKey(2))); + assertEquals(value, multimap.removeMultiKey(key.getKey(0), key.getKey(1), key.getKey(2))); assertEquals(false, multimap.containsKey(key.getKey(0), key.getKey(1), key.getKey(2))); assertEquals(size - 1, multimap.size()); - assertEquals(null, multimap.remove(key.getKey(0), key.getKey(1), key.getKey(2))); + assertEquals(null, multimap.removeMultiKey(key.getKey(0), key.getKey(1), key.getKey(2))); assertEquals(false, multimap.containsKey(key.getKey(0), key.getKey(1), key.getKey(2))); break; case 4: assertEquals(true, multimap.containsKey(key.getKey(0), key.getKey(1), key.getKey(2), key.getKey(3))); - assertEquals(value, multimap.remove(key.getKey(0), key.getKey(1), key.getKey(2), key.getKey(3))); + assertEquals(value, multimap.removeMultiKey(key.getKey(0), key.getKey(1), key.getKey(2), key.getKey(3))); assertEquals(false, multimap.containsKey(key.getKey(0), key.getKey(1), key.getKey(2), key.getKey(3))); assertEquals(size - 1, multimap.size()); - assertEquals(null, multimap.remove(key.getKey(0), key.getKey(1), key.getKey(2), key.getKey(3))); + assertEquals(null, multimap.removeMultiKey(key.getKey(0), key.getKey(1), key.getKey(2), key.getKey(3))); assertEquals(false, multimap.containsKey(key.getKey(0), key.getKey(1), key.getKey(2), key.getKey(3))); break; case 5: assertEquals(true, multimap.containsKey(key.getKey(0), key.getKey(1), key.getKey(2), key.getKey(3), key.getKey(4))); - assertEquals(value, multimap.remove(key.getKey(0), key.getKey(1), key.getKey(2), key.getKey(3), key.getKey(4))); + assertEquals(value, multimap.removeMultiKey(key.getKey(0), key.getKey(1), key.getKey(2), key.getKey(3), key.getKey(4))); assertEquals(false, multimap.containsKey(key.getKey(0), key.getKey(1), key.getKey(2), key.getKey(3), key.getKey(4))); assertEquals(size - 1, multimap.size()); - assertEquals(null, multimap.remove(key.getKey(0), key.getKey(1), key.getKey(2), key.getKey(3), key.getKey(4))); + assertEquals(null, multimap.removeMultiKey(key.getKey(0), key.getKey(1), key.getKey(2), key.getKey(3), key.getKey(4))); assertEquals(false, multimap.containsKey(key.getKey(0), key.getKey(1), key.getKey(2), key.getKey(3), key.getKey(4))); break; default: diff --git a/src/test/org/apache/commons/collections/map/TestMultiValueMap.java b/src/test/org/apache/commons/collections/map/TestMultiValueMap.java index b9a5ac8..9ecc269 100644 --- a/src/test/org/apache/commons/collections/map/TestMultiValueMap.java +++ b/src/test/org/apache/commons/collections/map/TestMultiValueMap.java @@ -161,7 +161,7 @@ public class TestMultiValueMap extends TestCase { MultiValueMap one = new MultiValueMap(); Integer value = new Integer(1); one.put("One", value); - one.remove("One", value); + one.removeMapping("One", value); MultiValueMap two = new MultiValueMap(); assertEquals(two, one); @@ -187,7 +187,7 @@ public class TestMultiValueMap extends TestCase { assertEquals(4, map.totalSize()); map.remove("A"); assertEquals(3, map.totalSize()); - map.remove("B", "BC"); + map.removeMapping("B", "BC"); assertEquals(2, map.totalSize()); } @@ -204,7 +204,7 @@ public class TestMultiValueMap extends TestCase { assertEquals(2, map.size()); map.remove("A"); assertEquals(2, map.size()); - map.remove("B", "BC"); + map.removeMapping("B", "BC"); assertEquals(2, map.size()); } @@ -227,7 +227,7 @@ public class TestMultiValueMap extends TestCase { map.remove("A"); assertEquals(0, map.size("A")); assertEquals(3, map.size("B")); - map.remove("B", "BC"); + map.removeMapping("B", "BC"); assertEquals(0, map.size("A")); assertEquals(2, map.size("B")); } @@ -338,11 +338,11 @@ public class TestMultiValueMap extends TestCase { map.put("A", "AA"); map.put("A", "AB"); map.put("A", "AC"); - assertEquals(null, map.remove("C", "CA")); - assertEquals(null, map.remove("A", "AD")); - assertEquals("AC", map.remove("A", "AC")); - assertEquals("AB", map.remove("A", "AB")); - assertEquals("AA", map.remove("A", "AA")); + assertEquals(false, map.removeMapping("C", "CA")); + assertEquals(false, map.removeMapping("A", "AD")); + assertEquals(true, map.removeMapping("A", "AC")); + assertEquals(true, map.removeMapping("A", "AB")); + assertEquals(true, map.removeMapping("A", "AA")); assertEquals(new MultiValueMap(), map); } -- 2.18.0