RFR: 8269130: Replace usages of Collection.toArray() with Collection.toArray(T[]) to avoid redundant array copying

Andrey Turbanov github.com+741251+turbanoff at openjdk.java.net
Mon Jul 26 11:30:21 UTC 2021


I found few places, where code initially perform `Object[] Colleciton.toArray()` call and then manually copy array into another array with required type.
This PR cleanups such places to more shorter call `T[] Collection.toArray(T[])`.

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

Commit messages:
 - Replace usages of Collection.toArray() with Collection.toArray(T[]) to avoid redundant array copying
 - Replace usages of Collection.toArray() with Collection.toArray(T[]) to avoid redundant array copying
 - Replace usages of Collection.toArray() with Collection.toArray(T[]) to avoid redundant array copying

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

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


More information about the core-libs-dev mailing list