On Tue, 10 Oct 2023 04:17:47 GMT, Valerie Peng <valer...@openjdk.org> wrote:

>> A few classes in `com.sun.crypto.provider` package have non-final fields 
>> which could easily be marked `final`.
>
> src/java.base/share/classes/com/sun/crypto/provider/EncryptedPrivateKeyInfo.java
>  line 1:
> 
>> 1: /*
> 
> Hmm, there is also sun/security/pkcs/EncryptedPrivateKeyInfo.java which seems 
> to have the same API and provide the exact same functionality. Maybe we can 
> remove this file and update the users of this class to use 
> sun.security.pkcs.EncryptedPrivateKeyInfo instead.

Looks similar, yes. I think it's worth to create a separate improvement for it.

> src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java 
> line 109:
> 
>> 107:     int tagLenBytes = DEFAULT_TAG_LEN;
>> 108:     // Key size if the value is passed, in bytes.
>> 109:     private final int keySize;
> 
> Why not also mark the `blockCipher` as private final?

Good catch!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15412#discussion_r1354352969
PR Review Comment: https://git.openjdk.org/jdk/pull/15412#discussion_r1354354214

Reply via email to