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

Xue-Lei Andrew Fan xuelei at openjdk.java.net
Wed Dec 23 01:01:06 UTC 2020


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

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

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

Changes: https://git.openjdk.java.net/jdk/pull/1872/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1872&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8258852
  Stats: 16 lines in 3 files changed: 0 ins; 5 del; 11 mod
  Patch: https://git.openjdk.java.net/jdk/pull/1872.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/1872/head:pull/1872

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



More information about the security-dev mailing list