RFR: 8258852: Arrays.asList() for single item could be replaced with Collections.singletonList()

Sean Mullan mullan at openjdk.java.net
Thu Dec 24 15:02:56 UTC 2020


On Wed, 23 Dec 2020 00:56:25 GMT, Xue-Lei Andrew Fan <xuelei at openjdk.org> wrote:

> If there is only one item, the call to Arrays.asList() could be replaced with Collections.singletonList() for less memory occupation.  This update also includes some other code cleanup, like redundant variables in the related files.
> 
> Code cleanup only, no new regression test.
> 
> Bug: https://bugs.openjdk.java.net/browse/JDK-8258852

What about using List.of() instead?

-------------

PR: https://git.openjdk.java.net/jdk/pull/1872



More information about the security-dev mailing list