RFR: 8254090: Collectors.toUnmodifiableList exposes shared secret [v2]
Stuart Marks
smarks at openjdk.java.net
Fri Oct 9 00:57:38 UTC 2020
On Thu, 8 Oct 2020 22:26:15 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:
>> Stuart Marks has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev
>> excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since
>> the last revision:
>> - Merge branch 'master' into JDK-8254090-Collectors-toUnmodifiableList-SharedSecret
>> - remove unnecessary cast and warnings suppression
>> - update copyright on test
>> - 8254090: Collectors.toUnmodifiableList exposes shared secret
>
> src/java.base/share/classes/java/util/stream/Collectors.java line 303:
>
>> 301: list -> {
>> 302: if (list.getClass() == ArrayList.class) { // ensure it's trusted
>> 303: return (List<T>)SharedSecrets.getJavaUtilCollectionAccess()
>
> While we are in this method i think it should be possible to remove the all casts and the `@SuppressWarnings` (javac's
> type inference got better after this method was added?).
I've updated this PR to clean this up. Not sure where this came from in the first place. It might have been left over
from an intermediate edit.
-------------
PR: https://git.openjdk.java.net/jdk/pull/569
More information about the core-libs-dev
mailing list