RFR: 8333364: Minor cleanup could be done in com.sun.crypto.provider [v3]

Valerie Peng valeriep at openjdk.org
Thu Jun 13 21:26:17 UTC 2024


On Thu, 13 Jun 2024 13:18:10 GMT, Mark Powers <mpowers at openjdk.org> wrote:

>> src/java.base/share/classes/com/sun/crypto/provider/TlsKeyMaterialGenerator.java line 109:
>> 
>>> 107:         SecretKey serverMacKey = null;
>>> 108:         SecretKey clientCipherKey;
>>> 109:         SecretKey serverCipherKey;
>> 
>> nit: move them down to line 200, e.g. where these two variables are assigned?
>
> No. The two variables wouldn't be in scope for the `finally` block on line 276.

How about right above the block where they are assigned? The reason that I suggested this is that it's easier to see why no default value needed when they are placed nearer to where they are used.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19535#discussion_r1638966495



More information about the security-dev mailing list