From 6e64c35e6f0404547ff2e3a4009b57916481dc0f Mon Sep 17 00:00:00 2001 From: Mohamed Naufal Date: Sat, 28 May 2016 13:57:30 +0530 Subject: [PATCH] 8158253: Collections: Implement a noop clear() for EmptyList, EmptyMap and EmptySet Reviewed-by: psandoz --- jdk/src/java.base/share/classes/java/util/Collections.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jdk/src/java.base/share/classes/java/util/Collections.java b/jdk/src/java.base/share/classes/java/util/Collections.java index 0eb9da0f644..9f6ab76a723 100644 --- a/jdk/src/java.base/share/classes/java/util/Collections.java +++ b/jdk/src/java.base/share/classes/java/util/Collections.java @@ -4324,6 +4324,7 @@ public class Collections { public int size() {return 0;} public boolean isEmpty() {return true;} + public void clear() {} public boolean contains(Object obj) {return false;} public boolean containsAll(Collection c) { return c.isEmpty(); } @@ -4447,6 +4448,7 @@ public class Collections { public int size() {return 0;} public boolean isEmpty() {return true;} + public void clear() {} public boolean contains(Object obj) {return false;} public boolean containsAll(Collection c) { return c.isEmpty(); } @@ -4582,6 +4584,7 @@ public class Collections { public int size() {return 0;} public boolean isEmpty() {return true;} + public void clear() {} public boolean containsKey(Object key) {return false;} public boolean containsValue(Object value) {return false;} public V get(Object key) {return null;}