8274835: Remove unnecessary castings in java.base

Reviewed-by: mullan, naoto, lancea, bpb
This commit is contained in:
Andrey Turbanov 2021-11-12 16:30:56 +00:00 committed by Daniel Fuchs
parent 3b2585c02b
commit 5a2452c80e
15 changed files with 32 additions and 35 deletions

View file

@ -335,7 +335,7 @@ public class HashSet<E>
.checkArray(s, Map.Entry[].class, HashMap.tableSizeFor(capacity));
// Create backing HashMap
map = (((HashSet<?>)this) instanceof LinkedHashSet ?
map = (this instanceof LinkedHashSet ?
new LinkedHashMap<>(capacity, loadFactor) :
new HashMap<>(capacity, loadFactor));