<AWT Dev> RFR: 8269130: Replace usages of Collection.toArray() with Collection.toArray(T) to avoid redundant array copying
github.com+2996845+bokken at openjdk.java.net
Mon Jul 26 19:18:33 UTC 2021
On Mon, 14 Jun 2021 17:00:29 GMT, Andrey Turbanov <github.com+741251+turbanoff at openjdk.org> wrote:
> 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)`.
src/java.base/share/classes/java/security/Security.java line 656:
> 654: return null;
> 656: return candidates.toArray(new Provider);
Is this called often enough to warrant creating a constant of `new Provider` (benefits of this covered in the _Wisdom of the Ancients_ blog linked)?
More information about the awt-dev