< prev index next >
src/java.base/share/classes/java/util/AbstractSet.java
Print this page
rev 48550 : 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
*** 91,103 ****
Collection<?> c = (Collection<?>) o;
if (c.size() != size())
return false;
try {
return containsAll(c);
! } catch (ClassCastException unused) {
! return false;
! } catch (NullPointerException unused) {
return false;
}
}
/**
--- 91,101 ----
Collection<?> c = (Collection<?>) o;
if (c.size() != size())
return false;
try {
return containsAll(c);
! } catch (ClassCastException | NullPointerException unused) {
return false;
}
}
/**
< prev index next >