RFR: 8273299: Unnecessary Vector usage in java.security.jgss

Andrey Turbanov github.com+741251+turbanoff at openjdk.java.net
Thu Sep 2 18:58:50 UTC 2021


On Thu, 26 Aug 2021 15:50:42 GMT, Yasser Bazzi <github.com+32601969+YShow at 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.
>
> src/java.security.jgss/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java line 574:
> 
>> 572:             v.add(st.nextToken());
>> 573:         }
>> 574:         final String[] command = new String[v.size()];
> 
> Could probably simplify most of these .toArray to simply `var variable = myarraylist.toArray(new ArrayType[0])`

I think it's better to leave it to separate cleanup issue.

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

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



More information about the security-dev mailing list