Skip to content

Commit 80b7697

Browse files
committed
Whitespace only checkstyle rules around tokens
Whitespace rules are added to enforce spacing surrounding various tokens to provide for a more consistent code style. Signed-off-by: Jason Katonica <katonica@us.ibm.com>
1 parent d9e96ea commit 80b7697

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+113
-104
lines changed

checkstyle.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<!--
33
###############################################################################
44
#
5-
# Copyright IBM Corp. 2023
5+
# Copyright IBM Corp. 2023, 2026
66
#
77
# This code is free software; you can redistribute it and/or modify it
88
# under the terms provided by IBM in the LICENSE file that accompanied
@@ -41,5 +41,8 @@
4141
<module name="UnusedImports"/>
4242
<module name="UnusedLocalVariable"/>
4343
<module name="WhitespaceAfter"/>
44+
<module name="WhitespaceAround">
45+
<property name="allowEmptyConstructors" value="true"/>
46+
</module>
4447
</module>
4548
</module>

src/main/java/com/ibm/crypto/plus/provider/AESCCMCipher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ protected int engineUpdate(ByteBuffer input, ByteBuffer output) throws ShortBuff
770770
}
771771

772772
private Runnable cleanOCKResources(byte[] Key, OCKContext ockContext) {
773-
return() -> {
773+
return () -> {
774774
try {
775775
if (ockContext != null) {
776776
CCMCipher.doCCM_cleanup(ockContext);

src/main/java/com/ibm/crypto/plus/provider/AESGCMCipher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ private void resetVars(boolean afterFailure) {
14451445
}
14461446

14471447
private Runnable cleanOCKResources(PrimitiveWrapper.ByteArray Key) {
1448-
return() -> {
1448+
return () -> {
14491449
try {
14501450
//JS00684 - Leave cleanup of internal variables to GCMCipher that caches them
14511451
if (Key.getValue() != null) {

src/main/java/com/ibm/crypto/plus/provider/AESKey.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright IBM Corp. 2023, 2025
2+
* Copyright IBM Corp. 2023, 2026
33
*
44
* This code is free software; you can redistribute it and/or modify it
55
* under the terms provided by IBM in the LICENSE file that accompanied
@@ -157,12 +157,12 @@ private void checkDestroyed() {
157157
}
158158

159159
private Runnable cleanOCKResources(byte[] key) {
160-
return() -> {
160+
return () -> {
161161
try {
162162
if (key != null) {
163163
Arrays.fill(key, (byte) 0x00);
164164
}
165-
} catch (Exception e){
165+
} catch (Exception e) {
166166
if (OpenJCEPlusProvider.getDebug() != null) {
167167
OpenJCEPlusProvider.getDebug().println("An error occurred while cleaning : " + e.getMessage());
168168
e.printStackTrace();

src/main/java/com/ibm/crypto/plus/provider/AESKeyWrapCipher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ protected int engineGetOutputSize(int inputLen) {
187187
} else {
188188
result = Math.addExact(inputLen, 16);
189189
}
190-
return (result < 0? 0:result);
190+
return (result < 0 ? 0 : result);
191191
}
192192

193193
@Override

src/main/java/com/ibm/crypto/plus/provider/ChaCha20Key.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright IBM Corp. 2023, 2025
2+
* Copyright IBM Corp. 2023, 2026
33
*
44
* This code is free software; you can redistribute it and/or modify it
55
* under the terms provided by IBM in the LICENSE file that accompanied
@@ -160,12 +160,12 @@ private void checkDestroyed() {
160160
}
161161

162162
private Runnable cleanOCKResources(byte[] key) {
163-
return() -> {
163+
return () -> {
164164
try {
165165
if (key != null) {
166166
Arrays.fill(key, (byte) 0x00);
167167
}
168-
} catch (Exception e){
168+
} catch (Exception e) {
169169
if (OpenJCEPlusProvider.getDebug() != null) {
170170
OpenJCEPlusProvider.getDebug().println("An error occurred while cleaning : " + e.getMessage());
171171
e.printStackTrace();

src/main/java/com/ibm/crypto/plus/provider/DESedeKey.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright IBM Corp. 2023, 2025
2+
* Copyright IBM Corp. 2023, 2026
33
*
44
* This code is free software; you can redistribute it and/or modify it
55
* under the terms provided by IBM in the LICENSE file that accompanied
@@ -161,12 +161,12 @@ private void checkDestroyed() {
161161
}
162162

163163
private Runnable cleanOCKResources(byte[] key) {
164-
return() -> {
164+
return () -> {
165165
try {
166166
if (key != null) {
167167
Arrays.fill(key, (byte) 0x00);
168168
}
169-
} catch (Exception e){
169+
} catch (Exception e) {
170170
if (OpenJCEPlusProvider.getDebug() != null) {
171171
OpenJCEPlusProvider.getDebug().println("An error occurred while cleaning : " + e.getMessage());
172172
e.printStackTrace();

src/main/java/com/ibm/crypto/plus/provider/ECDSASignature.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ protected void engineSetParameter(AlgorithmParameterSpec params)
130130
}
131131
if (params instanceof ECParameterSpec) {
132132
ECParameterSpec ecparams = (ECParameterSpec) params;
133-
java.security.interfaces.ECKey key = (this.privateKey == null? this.publicKey : this.privateKey);
133+
java.security.interfaces.ECKey key = (this.privateKey == null ? this.publicKey : this.privateKey);
134134
if ((key != null) && !ECUtil.equals(ecparams, key.getParams())) {
135135
throw new InvalidAlgorithmParameterException(
136136
"Signature params does not match key params");

src/main/java/com/ibm/crypto/plus/provider/MessageDigest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected void engineUpdate(byte[] input, int offset, int length) {
3838
throw new IllegalArgumentException("No input buffer given");
3939
}
4040
if ((offset < 0) || (length < 0) || (offset > input.length - length)) {
41-
throw new ArrayIndexOutOfBoundsException("Range out of bounds for buffer of length " + input.length +" using offset: " + offset + ", input length: " + length);
41+
throw new ArrayIndexOutOfBoundsException("Range out of bounds for buffer of length " + input.length + " using offset: " + offset + ", input length: " + length);
4242
}
4343
try {
4444
this.digest.update(input, offset, length);

src/main/java/com/ibm/crypto/plus/provider/OpenJCEPlusProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public abstract class OpenJCEPlusProvider extends java.security.Provider {
5656
super(name, PROVIDER_VER, info);
5757

5858
numCleaners = Integer.getInteger("openjceplus.cleaners.num", DEFAULT_NUM_CLEANERS);
59-
if (numCleaners < 1){
59+
if (numCleaners < 1) {
6060
throw new IllegalArgumentException(numCleaners + " is an invalid number of cleaner threads, must be at least 1.");
6161
}
6262

0 commit comments

Comments
 (0)