Skip to content

Commit 393e890

Browse files
Excavator: Format Java files
1 parent 68fe5e7 commit 393e890

File tree

65 files changed

+183
-177
lines changed

Some content is hidden

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

65 files changed

+183
-177
lines changed

.baseline/checkstyle/checkstyle.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,9 @@
472472
<property name="format" value="^_?[a-z][a-zA-Z0-9]+$"/>
473473
<message key="name.invalidPattern" value="Parameter name ''{0}'' must match pattern ''{1}''."/>
474474
</module>
475+
<module name="SummaryJavadocCheck"> <!-- Java Coding Guidelines: Javadoc -->
476+
<property name="forbiddenSummaryFragments" value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
477+
</module>
475478

476479
<!-- Stricter checks end -->
477480
</module>

build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ buildscript {
55
}
66

77
dependencies {
8+
classpath 'com.palantir.javaformat:gradle-palantir-java-format:0.3.26'
89
classpath 'com.netflix.nebula:gradle-info-plugin:7.1.3'
910
classpath 'com.github.jengelman.gradle.plugins:shadow:5.2.0'
1011
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
@@ -23,6 +24,7 @@ apply plugin: 'com.palantir.baseline'
2324
apply plugin: 'com.palantir.consistent-versions'
2425

2526
allprojects {
27+
apply plugin: 'com.palantir.java-format'
2628
group 'com.palantir.hadoop-crypto2'
2729
version gitVersion()
2830

crypto-core/src/main/java/com/palantir/crypto2/cipher/AesCbcCipher.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,13 @@ public Cipher initCipher(int opmode) {
7272
*/
7373
@Override
7474
public Cipher seek(long pos) {
75-
Preconditions.checkState(currentOpmode == Cipher.DECRYPT_MODE || currentOpmode == Cipher.ENCRYPT_MODE,
76-
"Cipher not initialized");
75+
Preconditions.checkState(
76+
currentOpmode == Cipher.DECRYPT_MODE || currentOpmode == Cipher.ENCRYPT_MODE, "Cipher not initialized");
7777
Preconditions.checkArgument(pos >= 0, "Cannot seek to negative position: %s", pos);
78-
Preconditions.checkArgument(pos % BLOCK_SIZE == 0,
79-
"Can only seek AES/CBC cipher to block offset positions every %s bytes", BLOCK_SIZE);
78+
Preconditions.checkArgument(
79+
pos % BLOCK_SIZE == 0,
80+
"Can only seek AES/CBC cipher to block offset positions every %s bytes",
81+
BLOCK_SIZE);
8082
return initCipher(currentOpmode);
8183
}
8284

@@ -101,5 +103,4 @@ private Cipher getInstance() {
101103
throw Throwables.propagate(e);
102104
}
103105
}
104-
105106
}

crypto-core/src/main/java/com/palantir/crypto2/cipher/AesCtrCipher.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ public Cipher initCipher(int opmode) {
6868

6969
@Override
7070
public Cipher seek(long pos) {
71-
Preconditions.checkState(currentOpmode == Cipher.DECRYPT_MODE || currentOpmode == Cipher.ENCRYPT_MODE,
72-
"Cipher not initialized");
71+
Preconditions.checkState(
72+
currentOpmode == Cipher.DECRYPT_MODE || currentOpmode == Cipher.ENCRYPT_MODE, "Cipher not initialized");
7373
Preconditions.checkArgument(pos >= 0, "Cannot seek to negative position: %s", pos);
7474

7575
// Compute the block that the byte 'pos' is located in
@@ -127,5 +127,4 @@ private Cipher getInstance() {
127127
throw Throwables.propagate(e);
128128
}
129129
}
130-
131130
}

crypto-core/src/main/java/com/palantir/crypto2/cipher/ApacheCiphers.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ private ApacheCiphers() {}
2828
* Properties)} will only try to use the OpenSSL cipher implementation which uses AES-NI.
2929
*/
3030
public static Properties forceOpenSsl(Properties properties) {
31-
properties.setProperty(CryptoCipherFactory.CLASSES_KEY,
32-
CryptoCipherFactory.CipherProvider.OPENSSL.getClassName());
31+
properties.setProperty(
32+
CryptoCipherFactory.CLASSES_KEY, CryptoCipherFactory.CipherProvider.OPENSSL.getClassName());
3333
return properties;
3434
}
35-
3635
}

crypto-core/src/main/java/com/palantir/crypto2/cipher/CipherStreamSupplier.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,4 @@ public interface CipherStreamSupplier {
3737
* encryption.
3838
*/
3939
CipherOutputStream getOutputStream(OutputStream os, Cipher cipher);
40-
4140
}

crypto-core/src/main/java/com/palantir/crypto2/cipher/CipherStreamSupplierImpl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,12 @@
2525
public final class CipherStreamSupplierImpl implements CipherStreamSupplier {
2626

2727
@Override
28-
public CipherInputStream getInputStream(InputStream is, Cipher cipher) {
28+
public CipherInputStream getInputStream(InputStream is, Cipher cipher) {
2929
return new CipherInputStream(is, cipher);
3030
}
3131

3232
@Override
3333
public CipherOutputStream getOutputStream(OutputStream os, Cipher cipher) {
3434
return new CipherOutputStream(os, cipher);
3535
}
36-
3736
}

crypto-core/src/main/java/com/palantir/crypto2/cipher/Ciphers.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,4 @@ static String getProvider(List<String> providers) {
4747
throw new IllegalStateException(
4848
String.format("None of the acceptable JCE providers are available: %s", providers));
4949
}
50-
5150
}

crypto-core/src/main/java/com/palantir/crypto2/cipher/SeekableCipher.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,4 @@ public interface SeekableCipher {
4646
* Returns the underlying {@link Cipher}'s block size.
4747
*/
4848
int getBlockSize();
49-
5049
}

crypto-core/src/main/java/com/palantir/crypto2/cipher/SeekableCipherFactory.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,4 @@ public static SeekableCipher getCipher(String cipherAlgorithm, KeyMaterial keyMa
7373
String.format("No known SeekableCipher with algorithm: %s", cipherAlgorithm));
7474
}
7575
}
76-
7776
}

0 commit comments

Comments
 (0)