RFR: 8333364: Minor cleanup could be done in com.sun.crypto.provider [v4]
Mark Powers
mpowers at openjdk.org
Mon Jul 8 19:49:44 UTC 2024
On Tue, 2 Jul 2024 17:23:18 GMT, Kevin Driver <kdriver at openjdk.org> wrote:
>> Mark Powers has updated the pull request incrementally with one additional commit since the last revision:
>>
>> move variables to above try block
>
> src/java.base/share/classes/com/sun/crypto/provider/AESKeyWrap.java line 33:
>
>> 31: import javax.crypto.IllegalBlockSizeException;
>> 32:
>> 33: import static com.sun.crypto.provider.KWUtil.*;
>
> One more wild-card import, as long as you're removing them.
This is a static import which imports static members such as SEMI_BLKSIZE. It's different from the usual import.
> src/java.base/share/classes/com/sun/crypto/provider/AESKeyWrapPadded.java line 34:
>
>> 32: import javax.crypto.IllegalBlockSizeException;
>> 33:
>> 34: import static com.sun.crypto.provider.KWUtil.*;
>
> One more wild-card import, as long as you're removing them.
Same as previous comment.
> src/java.base/share/classes/com/sun/crypto/provider/ChaCha20Cipher.java line 950:
>
>> 948: * set here.
>> 949: *
>> 950: * @throws IllegalArgumentException if the key or nonce are not in
>
> Can `IllegalArgumentException` no longer be thrown? I see that you removed `InvalidKeyException` from the throws in the method signature, but I'm not sure if you meant to remove this one from the javadoc as well?
`IllegalArgumentException` has never been thrown. `InvalidKeyException` was removed from javadoc otherwise it would not be in sync with the code.
> src/java.base/share/classes/com/sun/crypto/provider/DHKEM.java line 30:
>
>> 28: import java.io.IOException;
>> 29: import java.math.BigInteger;
>> 30: import java.security.*;
>
> Wild-card import, as long as you're removing them.
Wild card would expand to five or more lines. Keeping wild card.
> src/java.base/share/classes/com/sun/crypto/provider/DHKEM.java line 38:
>
>> 36: import java.util.Arrays;
>> 37: import java.util.Objects;
>> 38: import javax.crypto.*;
>
> Wild-card import, as long as you're removing them.
Wild card would expand to five or more lines. Five is the IntelliJ default for wild card expansion so I'm keeping the wild card.
> src/java.base/share/classes/com/sun/crypto/provider/DHKEM.java line 43:
>
>> 41: import sun.security.jca.JCAUtil;
>> 42: import sun.security.ssl.HKDF;
>> 43: import sun.security.util.*;
>
> Wild-card import, as long as you're removing them.
Wild card would expand to five or more lines. Keeping wild card.
> src/java.base/share/classes/com/sun/crypto/provider/DHKeyAgreement.java line 29:
>
>> 27:
>> 28: import java.math.BigInteger;
>> 29: import java.security.*;
>
> Wild-card import, as long as you're removing them.
Wild card would expand to five or more lines. Keeping wild card.
> src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java line 32:
>
>> 30: import java.nio.ByteBuffer;
>> 31: import java.nio.ByteOrder;
>> 32: import java.security.*;
>
> Wild-card import, as long as you're removing them.
Wild card would expand to five or more lines. Keeping wild card.
> src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java line 36:
>
>> 34: import java.security.spec.InvalidParameterSpecException;
>> 35: import java.util.Arrays;
>> 36: import javax.crypto.*;
>
> Wild-card import, as long as you're removing them.
Wild card would expand to five or more lines. Keeping wild card.
> src/java.base/share/classes/com/sun/crypto/provider/HmacCore.java line 29:
>
>> 27:
>> 28: import java.nio.ByteBuffer;
>> 29: import java.security.*;
>
> Wild-card import, as long as you're removing them.
Wild card would expand to five or more lines. Keeping wild card.
> src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java line 38:
>
>> 36: import java.util.Objects;
>> 37:
>> 38: import javax.crypto.*;
>
> Wild-card import, as long as you're removing them.
Wild card would expand to five or more lines. Keeping wild card.
> src/java.base/share/classes/com/sun/crypto/provider/SslMacCore.java line 29:
>
>> 27:
>> 28: import java.nio.ByteBuffer;
>> 29: import java.security.*;
>
> Wild-card import, as long as you're removing them.
Wild card would expand to five or more lines. Keeping wild card.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19535#discussion_r1669197397
PR Review Comment: https://git.openjdk.org/jdk/pull/19535#discussion_r1669197573
PR Review Comment: https://git.openjdk.org/jdk/pull/19535#discussion_r1669197683
PR Review Comment: https://git.openjdk.org/jdk/pull/19535#discussion_r1669197884
PR Review Comment: https://git.openjdk.org/jdk/pull/19535#discussion_r1669197784
PR Review Comment: https://git.openjdk.org/jdk/pull/19535#discussion_r1669198007
PR Review Comment: https://git.openjdk.org/jdk/pull/19535#discussion_r1669198096
PR Review Comment: https://git.openjdk.org/jdk/pull/19535#discussion_r1669198179
PR Review Comment: https://git.openjdk.org/jdk/pull/19535#discussion_r1669198288
PR Review Comment: https://git.openjdk.org/jdk/pull/19535#discussion_r1669198370
PR Review Comment: https://git.openjdk.org/jdk/pull/19535#discussion_r1669198448
PR Review Comment: https://git.openjdk.org/jdk/pull/19535#discussion_r1669198549
More information about the security-dev
mailing list