Integrated: 8258804: Collection.toArray() should use empty array

Xue-Lei Andrew Fan xuelei at openjdk.java.net
Tue Dec 22 18:15:58 UTC 2020


On Mon, 21 Dec 2020 23:58:03 GMT, Xue-Lei Andrew Fan <xuelei at openjdk.org> wrote:

> Comparing to Collection.toArray(new T[size)), the Collection.toArray(new T[0]) seems faster, safer and contractually cleaner.  In the update, the use of Collection.toArray(new T[size)) in the SunJSSE provider implementation is replaced with Collection.toArray(new T[0]).
> 
> Bug: https://bugs.openjdk.java.net/browse/JDK-8258804

This pull request has now been integrated.

Changeset: 39e03a0b
Author:    Xue-Lei Andrew Fan <xuelei at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/39e03a0b
Stats:     3 lines in 2 files changed: 0 ins; 0 del; 3 mod

8258804: Collection.toArray() should use empty array

Reviewed-by: mullan

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

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



More information about the security-dev mailing list