Skip to content

Commit 917ed71

Browse files
Excavator: Format Java files
1 parent 9256aaf commit 917ed71

File tree

5 files changed

+9
-13
lines changed

5 files changed

+9
-13
lines changed

.baseline/checkstyle/checkstyle.xml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@
173173
</module>
174174
<module name="IllegalType"> <!-- Java Coding Guide: Limit coupling on concrete classes -->
175175
<property name="illegalClassNames" value="java.util.ArrayList, java.util.HashSet, java.util.HashMap, java.util.LinkedList, java.util.LinkedHashMap, java.util.LinkedHashSet, java.util.TreeSet, java.util.TreeMap, com.google.common.collect.ArrayListMultimap, com.google.common.collect.ForwardingListMultimap, com.google.common.collect.ForwardingMultimap, com.google.common.collect.ForwardingSetMultimap, com.google.common.collect.ForwardingSortedSetMultimap, com.google.common.collect.HashMultimap, com.google.common.collect.LinkedHashMultimap, com.google.common.collect.LinkedListMultimap, com.google.common.collect.TreeMultimap"/>
176+
<message key="illegal.type" value="Usage of type ''{0}'' is not allowed to limit coupling on concrete classes. For example, prefer Multimap over HashMultimap, List over ArrayList, and Set over TreeSet."/>
176177
</module>
177178
<module name="IllegalType">
178179
<property name="id" value="BanGuavaCaches"/>
@@ -292,14 +293,6 @@
292293
<property name="format" value="ImmutableSet\.Builder.*new ImmutableSet\.Builder"/>
293294
<property name="message" value="Use ImmutableSet.builder() for variable assignment."/>
294295
</module>
295-
<module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Check parameters for validity -->
296-
<property name="format" value="Preconditions\.checkNotNull\((?!.*,)([^()]*(\(([^()]*|\(([^()]*|\([^()]*\))*\))*\)[^()]*)*)\)"/>
297-
<property name="message" value="Use Preconditions.checkNotNull(Object, String)."/>
298-
</module>
299-
<module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Check parameters for validity -->
300-
<property name="format" value="Validate\.notNull\((?!.*,)([^()]*(\(([^()]*|\(([^()]*|\([^()]*\))*\))*\)[^()]*)*)\)"/>
301-
<property name="message" value="Use Validate.notNull(Object, String)."/>
302-
</module>
303296
<module name="RegexpSinglelineJava">
304297
<property name="format" value="^\s*super\(\);"/>
305298
<property name="message" value="This is unnecessary; please delete."/>

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ buildscript {
77
dependencies {
88
classpath 'com.palantir.gradle.jdkslatest:gradle-jdks-latest:0.15.0'
99
classpath 'com.palantir.jakartapackagealignment:jakarta-package-alignment:0.6.0'
10-
classpath 'com.palantir.baseline:gradle-baseline-java:6.25.0'
10+
classpath 'com.palantir.baseline:gradle-baseline-java:6.51.0'
1111
classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:2.27.0'
1212
classpath 'com.palantir.gradle.gitversion:gradle-git-version:3.2.0'
13-
classpath 'com.palantir.javaformat:gradle-palantir-java-format:2.62.0'
13+
classpath 'com.palantir.javaformat:gradle-palantir-java-format:2.73.0'
1414
classpath 'com.palantir.suppressible-error-prone:gradle-suppressible-error-prone:2.9.0'
1515
classpath 'gradle.plugin.org.inferred:gradle-processors:3.7.0'
1616
classpath 'com.palantir.gradle.failure-reports:gradle-failure-reports:1.13.0'

lib/src/main/java/com/palantir/computemodules/auth/PipelinesAuth.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.palantir.computemodules.auth;
1818

1919
import com.palantir.logsafe.exceptions.SafeRuntimeException;
20+
import com.palantir.logsafe.exceptions.SafeUncheckedIoException;
2021
import java.io.IOException;
2122
import java.nio.charset.StandardCharsets;
2223
import java.nio.file.Files;
@@ -37,7 +38,7 @@ public static String retrievePipelineToken() {
3738
return Files.readString(Paths.get(tokenFilePath), StandardCharsets.UTF_8)
3839
.trim();
3940
} catch (IOException e) {
40-
throw new SafeRuntimeException("Failed to read pipeline token from file where it is stored.", e);
41+
throw new SafeUncheckedIoException("Failed to read pipeline token from file where it is stored.", e);
4142
}
4243
}
4344
}

lib/src/main/java/com/palantir/computemodules/auth/ThirdPartyAuth.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.fasterxml.jackson.databind.ObjectMapper;
2020
import com.palantir.computemodules.ssl.SslUtils;
2121
import com.palantir.logsafe.exceptions.SafeRuntimeException;
22+
import com.palantir.logsafe.exceptions.SafeUncheckedIoException;
2223
import java.io.IOException;
2324
import java.net.URI;
2425
import java.net.URLEncoder;
@@ -84,7 +85,7 @@ public static String fetchOAuthToken(String hostname, List<String> scope) {
8485
} catch (InterruptedException e) {
8586
throw new SafeRuntimeException("Interrupted while fetching OAuth token", e);
8687
} catch (IOException e) {
87-
throw new SafeRuntimeException("IOException while fetching OAuth token", e);
88+
throw new SafeUncheckedIoException("IOException while fetching OAuth token", e);
8889
}
8990
return "";
9091
}

lib/src/main/java/com/palantir/computemodules/client/config/EnvVars.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package com.palantir.computemodules.client.config;
1717

1818
import java.io.IOException;
19+
import java.io.UncheckedIOException;
1920
import java.nio.file.Files;
2021
import java.nio.file.Path;
2122
import java.util.Optional;
@@ -69,7 +70,7 @@ public String get() {
6970
try {
7071
return Files.readString(Path.of(readAsString(name)));
7172
} catch (IOException e) {
72-
throw new RuntimeException("Failed to read file pointed to by EnvVar: " + name, e);
73+
throw new UncheckedIOException("Failed to read file pointed to by EnvVar: " + name, e);
7374
}
7475
}
7576
}

0 commit comments

Comments
 (0)