--- old/src/java.base/share/classes/java/util/IdentityHashMap.java 2019-05-13 17:16:13.000000000 -0700 +++ new/src/java.base/share/classes/java/util/IdentityHashMap.java 2019-05-13 17:16:13.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -987,22 +987,6 @@ IdentityHashMap.this.remove(o); return size != oldSize; } - /* - * Must revert from AbstractSet's impl to AbstractCollection's, as - * the former contains an optimization that results in incorrect - * behavior when c is a smaller "normal" (non-identity-based) Set. - */ - public boolean removeAll(Collection c) { - Objects.requireNonNull(c); - boolean modified = false; - for (Iterator i = iterator(); i.hasNext(); ) { - if (c.contains(i.next())) { - i.remove(); - modified = true; - } - } - return modified; - } public void clear() { IdentityHashMap.this.clear(); } @@ -1204,23 +1188,6 @@ public void clear() { IdentityHashMap.this.clear(); } - /* - * Must revert from AbstractSet's impl to AbstractCollection's, as - * the former contains an optimization that results in incorrect - * behavior when c is a smaller "normal" (non-identity-based) Set. - */ - public boolean removeAll(Collection c) { - Objects.requireNonNull(c); - boolean modified = false; - for (Iterator> i = iterator(); i.hasNext(); ) { - if (c.contains(i.next())) { - i.remove(); - modified = true; - } - } - return modified; - } - public Object[] toArray() { return toArray(new Object[0]); }