Skip to content

Commit

Permalink
Strictly enforce import order using checkstyle (#179)
Browse files Browse the repository at this point in the history
This update enforces that imports remain in a very strict alphabetic
order using the checktyle ImportOrder rule. This is a quick and easy
way to ensure that imports stay organized without a deep review of such
changes in the future.

Signed-off-by: Jason Katonica <[email protected]>
  • Loading branch information
jasonkatonica authored Aug 23, 2024
1 parent 03f8b9e commit bcef918
Show file tree
Hide file tree
Showing 119 changed files with 190 additions and 265 deletions.
1 change: 1 addition & 0 deletions checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
</module>
<module name="UnusedLocalVariable"/>
<module name="EmptyBlock"/>
<module name="ImportOrder"/>
</module>
<module name="RegexpHeader">
<property name="fileExtensions" value="java"/>
Expand Down
10 changes: 4 additions & 6 deletions src/main/java/com/ibm/crypto/plus/provider/AESCCMCipher.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

package com.ibm.crypto.plus.provider;

import com.ibm.crypto.plus.provider.ock.CCMCipher;
import com.ibm.crypto.plus.provider.ock.OCKContext;
import com.ibm.misc.Debug;
import ibm.security.internal.spec.CCMParameterSpec;
import java.math.BigInteger;
import java.nio.ByteBuffer;
import java.security.AlgorithmParameters;
Expand All @@ -27,12 +31,6 @@
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.ShortBufferException;
import com.ibm.crypto.plus.provider.ock.CCMCipher;
import com.ibm.crypto.plus.provider.ock.OCKContext;
import com.ibm.misc.Debug;
import ibm.security.internal.spec.CCMParameterSpec;



public final class AESCCMCipher extends CipherSpi implements AESConstants, CCMConstants {

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/ibm/crypto/plus/provider/AESCipher.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

package com.ibm.crypto.plus.provider;

import com.ibm.crypto.plus.provider.ock.Padding;
import com.ibm.crypto.plus.provider.ock.SymmetricCipher;
import java.security.AlgorithmParameters;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
Expand All @@ -25,8 +27,6 @@
import javax.crypto.NoSuchPaddingException;
import javax.crypto.ShortBufferException;
import javax.crypto.spec.IvParameterSpec;
import com.ibm.crypto.plus.provider.ock.Padding;
import com.ibm.crypto.plus.provider.ock.SymmetricCipher;

public final class AESCipher extends CipherSpi implements AESConstants {

Expand Down
7 changes: 3 additions & 4 deletions src/main/java/com/ibm/crypto/plus/provider/AESGCMCipher.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

package com.ibm.crypto.plus.provider;

import com.ibm.crypto.plus.provider.ock.GCMCipher;
import com.ibm.crypto.plus.provider.ock.OCKContext;
import com.ibm.crypto.plus.provider.ock.OCKException;
import java.math.BigInteger;
import java.nio.ByteBuffer;
import java.security.AlgorithmParameters;
Expand All @@ -28,10 +31,6 @@
import javax.crypto.NoSuchPaddingException;
import javax.crypto.ShortBufferException;
import javax.crypto.spec.GCMParameterSpec;
import com.ibm.crypto.plus.provider.ock.GCMCipher;
import com.ibm.crypto.plus.provider.ock.OCKContext;
import com.ibm.crypto.plus.provider.ock.OCKException;


public final class AESGCMCipher extends CipherSpi implements AESConstants, GCMConstants {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package com.ibm.crypto.plus.provider;

import ibm.security.internal.spec.CCMParameterSpec;
import java.security.AlgorithmParameterGeneratorSpi;
import java.security.AlgorithmParameters;
import java.security.InvalidAlgorithmParameterException;
Expand All @@ -16,7 +17,6 @@
import java.security.SecureRandom;
import java.security.spec.AlgorithmParameterSpec;
import java.security.spec.InvalidParameterSpecException;
import ibm.security.internal.spec.CCMParameterSpec;

public final class CCMParameterGenerator extends AlgorithmParameterGeneratorSpi
implements AESConstants, CCMConstants {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@

package com.ibm.crypto.plus.provider;

import ibm.security.internal.spec.CCMParameterSpec;
import java.io.IOException;
import java.security.AlgorithmParametersSpi;
import java.security.InvalidParameterException;
import java.security.spec.AlgorithmParameterSpec;
import java.security.spec.InvalidParameterSpecException;
import ibm.security.internal.spec.CCMParameterSpec;
import sun.security.util.DerOutputStream;
import sun.security.util.DerValue;
import sun.security.util.HexDumpEncoder;


/**
*
* This class implements the encoding and decoding of CCM parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

package com.ibm.crypto.plus.provider;

import com.ibm.crypto.plus.provider.ock.Padding;
import com.ibm.crypto.plus.provider.ock.SymmetricCipher;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.security.AlgorithmParameters;
Expand All @@ -25,8 +27,6 @@
import javax.crypto.NoSuchPaddingException;
import javax.crypto.ShortBufferException;
import javax.crypto.spec.ChaCha20ParameterSpec;
import com.ibm.crypto.plus.provider.ock.Padding;
import com.ibm.crypto.plus.provider.ock.SymmetricCipher;

public final class ChaCha20Cipher extends CipherSpi implements ChaCha20Constants {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

package com.ibm.crypto.plus.provider;

import com.ibm.crypto.plus.provider.ock.OCKException;
import com.ibm.crypto.plus.provider.ock.Padding;
import com.ibm.crypto.plus.provider.ock.Poly1305Cipher;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.security.AlgorithmParameters;
Expand All @@ -28,9 +31,6 @@
import javax.crypto.NoSuchPaddingException;
import javax.crypto.ShortBufferException;
import javax.crypto.spec.IvParameterSpec;
import com.ibm.crypto.plus.provider.ock.OCKException;
import com.ibm.crypto.plus.provider.ock.Padding;
import com.ibm.crypto.plus.provider.ock.Poly1305Cipher;
import sun.security.util.DerValue;

public final class ChaCha20Poly1305Cipher extends CipherSpi
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/ibm/crypto/plus/provider/DESedeCipher.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

package com.ibm.crypto.plus.provider;

import com.ibm.crypto.plus.provider.ock.Padding;
import com.ibm.crypto.plus.provider.ock.SymmetricCipher;
import java.security.AlgorithmParameters;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
Expand All @@ -25,8 +27,6 @@
import javax.crypto.NoSuchPaddingException;
import javax.crypto.ShortBufferException;
import javax.crypto.spec.IvParameterSpec;
import com.ibm.crypto.plus.provider.ock.Padding;
import com.ibm.crypto.plus.provider.ock.SymmetricCipher;

public final class DESedeCipher extends CipherSpi implements DESConstants {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

package com.ibm.crypto.plus.provider;

import com.ibm.crypto.plus.provider.ock.DHKey;
import com.ibm.crypto.plus.provider.ock.OCKException;
import java.io.IOException;
import java.math.BigInteger;
import java.security.InvalidAlgorithmParameterException;
Expand All @@ -21,8 +23,6 @@
import javax.crypto.ShortBufferException;
import javax.crypto.spec.DHParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import com.ibm.crypto.plus.provider.ock.DHKey;
import com.ibm.crypto.plus.provider.ock.OCKException;
import sun.security.util.KeyUtil;

public final class DHKeyAgreement extends KeyAgreementSpi {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package com.ibm.crypto.plus.provider;

import com.ibm.crypto.plus.provider.ock.DHKey;
import java.security.AlgorithmParameterGenerator;
import java.security.AlgorithmParameters;
import java.security.InvalidAlgorithmParameterException;
Expand All @@ -17,7 +18,6 @@
import java.security.SecureRandom;
import java.security.spec.AlgorithmParameterSpec;
import javax.crypto.spec.DHParameterSpec;
import com.ibm.crypto.plus.provider.ock.DHKey;

public final class DHKeyPairGenerator extends KeyPairGeneratorSpi {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package com.ibm.crypto.plus.provider;

import com.ibm.crypto.plus.provider.ock.DHKey;
import java.math.BigInteger;
import java.security.AlgorithmParameterGeneratorSpi;
import java.security.AlgorithmParameters;
Expand All @@ -18,7 +19,6 @@
import java.security.spec.AlgorithmParameterSpec;
import javax.crypto.spec.DHGenParameterSpec;
import javax.crypto.spec.DHParameterSpec;
import com.ibm.crypto.plus.provider.ock.DHKey;

public final class DHParameterGenerator extends AlgorithmParameterGeneratorSpi {

Expand Down
5 changes: 2 additions & 3 deletions src/main/java/com/ibm/crypto/plus/provider/DHPrivateKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

package com.ibm.crypto.plus.provider;

import com.ibm.crypto.plus.provider.ock.DHKey;
import com.ibm.crypto.plus.provider.ock.OCKException;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
Expand All @@ -17,9 +19,6 @@
import java.util.Arrays;
import javax.crypto.spec.DHParameterSpec;
import javax.security.auth.DestroyFailedException;
import com.ibm.crypto.plus.provider.ock.DHKey;
import com.ibm.crypto.plus.provider.ock.OCKException;

import sun.security.pkcs.PKCS8Key;
import sun.security.util.DerInputStream;
import sun.security.util.DerOutputStream;
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/com/ibm/crypto/plus/provider/DHPublicKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,17 @@

package com.ibm.crypto.plus.provider;

import com.ibm.crypto.plus.provider.ock.DHKey;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigInteger;
import java.security.InvalidKeyException;
import java.security.KeyRep;
import java.security.spec.InvalidParameterSpecException;

import javax.crypto.spec.DHParameterSpec;
import javax.security.auth.DestroyFailedException;
import javax.security.auth.Destroyable;

import com.ibm.crypto.plus.provider.ock.DHKey;

import sun.security.util.BitArray;
import sun.security.util.DerInputStream;
import sun.security.util.DerOutputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package com.ibm.crypto.plus.provider;

import com.ibm.crypto.plus.provider.ock.DSAKey;
import java.security.AlgorithmParameterGenerator;
import java.security.AlgorithmParameters;
import java.security.InvalidAlgorithmParameterException;
Expand All @@ -19,7 +20,6 @@
import java.security.interfaces.DSAParams;
import java.security.spec.AlgorithmParameterSpec;
import java.security.spec.DSAParameterSpec;
import com.ibm.crypto.plus.provider.ock.DSAKey;

/**
* This class is a concrete implementation for the generation of a pair of DSA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package com.ibm.crypto.plus.provider;

import com.ibm.crypto.plus.provider.ock.DSAKey;
import java.math.BigInteger;
import java.security.AlgorithmParameterGeneratorSpi;
import java.security.AlgorithmParameters;
Expand All @@ -19,7 +20,6 @@
import java.security.spec.AlgorithmParameterSpec;
import java.security.spec.DSAGenParameterSpec;
import java.security.spec.DSAParameterSpec;
import com.ibm.crypto.plus.provider.ock.DSAKey;

public final class DSAParameterGenerator extends AlgorithmParameterGeneratorSpi {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package com.ibm.crypto.plus.provider;

import com.ibm.crypto.plus.provider.ock.DSAKey;
import java.io.IOException;
import java.io.Serializable;
import java.math.BigInteger;
Expand All @@ -20,8 +21,6 @@
import java.util.Arrays;
import javax.security.auth.DestroyFailedException;
import javax.security.auth.Destroyable;
import com.ibm.crypto.plus.provider.ock.DSAKey;

import sun.security.pkcs.PKCS8Key;
import sun.security.util.DerInputStream;
import sun.security.util.DerOutputStream;
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/ibm/crypto/plus/provider/DSAPublicKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package com.ibm.crypto.plus.provider;

import com.ibm.crypto.plus.provider.ock.DSAKey;
import java.io.IOException;
import java.io.Serializable;
import java.math.BigInteger;
Expand All @@ -17,10 +18,8 @@
import java.security.interfaces.DSAParams;
import java.security.spec.DSAParameterSpec;
import java.security.spec.InvalidParameterSpecException;

import javax.security.auth.DestroyFailedException;
import javax.security.auth.Destroyable;
import com.ibm.crypto.plus.provider.ock.DSAKey;
import sun.security.util.BitArray;
import sun.security.util.DerInputStream;
import sun.security.util.DerOutputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package com.ibm.crypto.plus.provider;

import com.ibm.crypto.plus.provider.ock.Signature;
import java.security.AlgorithmParameters;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
Expand All @@ -17,7 +18,6 @@
import java.security.SignatureException;
import java.security.SignatureSpi;
import java.security.spec.AlgorithmParameterSpec;
import com.ibm.crypto.plus.provider.ock.Signature;

abstract class DSASignature extends SignatureSpi {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

package com.ibm.crypto.plus.provider;

import com.ibm.crypto.plus.provider.ock.SignatureDSANONE;
import java.security.InvalidKeyException;
import java.security.InvalidParameterException;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.SignatureException;
import java.security.SignatureSpi;
import com.ibm.crypto.plus.provider.ock.SignatureDSANONE;

public final class DSASignatureNONE extends SignatureSpi {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package com.ibm.crypto.plus.provider;

import com.ibm.crypto.plus.provider.ock.ECKey;
import java.io.IOException;
import java.math.BigInteger;
import java.security.InvalidKeyException;
Expand All @@ -19,7 +20,6 @@
import java.security.SignatureException;
import java.security.SignatureSpi;
import java.security.spec.ECParameterSpec;
import com.ibm.crypto.plus.provider.ock.ECKey;
import sun.security.util.DerInputStream;
import sun.security.util.DerOutputStream;
import sun.security.util.DerValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

package com.ibm.crypto.plus.provider;

import com.ibm.crypto.plus.provider.ock.ECKey;
import com.ibm.crypto.plus.provider.ock.OCKException;
import java.math.BigInteger;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
Expand All @@ -24,8 +26,6 @@
import javax.crypto.SecretKey;
import javax.crypto.ShortBufferException;
import javax.crypto.spec.SecretKeySpec;
import com.ibm.crypto.plus.provider.ock.ECKey;
import com.ibm.crypto.plus.provider.ock.OCKException;

public final class ECDHKeyAgreement extends KeyAgreementSpi { // implements
// AlgorithmStatus
Expand Down
Loading

0 comments on commit bcef918

Please sign in to comment.