On Tue, 15 Jun 2021 16:05:06 GMT, Michael Bien 
<github.com+114367+mb...@openjdk.org> wrote:

>> Usage of thread-safe collection `Vector` is unnecessary. It's recommended to 
>> use `ArrayList` if a thread-safe implementation is not needed.
>> I checked only places where `Vector` was used as local variable.
>
> src/java.base/share/classes/sun/security/pkcs/PKCS7.java line 592:
> 
>> 590: 
>> 591:             SignerInfo[] result = new SignerInfo[intResult.size()];
>> 592:             return intResult.toArray(result);
> 
> could be simplified to
> `return intResult.toArray(new SignerInfo[0]);`
> which would eliminate array zeroing as bonus as I have learned from your 
> other PR ;)

I considered this, when I was preparing the patch. But decided to reduce scope 
of changes.

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

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

Reply via email to