8193128: Reduce number of implementation classes returned by List/Set/Map.of()

8191418: List.of().indexOf(null) doesn't throw NullPointerException

Reviewed-by: smarks, jrose, martin, plevart
This commit is contained in:
Claes Redestad 2017-12-09 03:33:39 +01:00
parent a2ea38d2c9
commit 9aff9cb645
9 changed files with 510 additions and 274 deletions

View file

@ -93,9 +93,7 @@ public abstract class AbstractSet<E> extends AbstractCollection<E> implements Se
return false;
try {
return containsAll(c);
} catch (ClassCastException unused) {
return false;
} catch (NullPointerException unused) {
} catch (ClassCastException | NullPointerException unused) {
return false;
}
}