Skip to content

Commit 5ce1371

Browse files
committed
Upgrade to spotless 3.0.0 and palantir 2.78.0
1 parent 5e9d4f7 commit 5ce1371

File tree

38 files changed

+177
-268
lines changed

38 files changed

+177
-268
lines changed

api/maven-api-cli/src/main/java/org/apache/maven/api/cli/Logger.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,10 @@ default void error(@Nonnull String message, @Nullable Throwable error) {
148148
* @param message The logging message, never {@code null}.
149149
* @param error The error, if applicable.
150150
*/
151-
record Entry(@Nonnull Level level, @Nonnull String message, @Nullable Throwable error) {}
151+
record Entry(
152+
@Nonnull Level level,
153+
@Nonnull String message,
154+
@Nullable Throwable error) {}
152155

153156
/**
154157
* If this is an accumulating log, it will "drain" this instance. It returns the accumulated log entries, and

api/maven-api-core/src/main/java/org/apache/maven/api/services/RequestTrace.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@
5050
* object being processed or any application-specific state information. May be null if no
5151
* additional data is needed.
5252
*/
53-
public record RequestTrace(@Nullable String context, @Nullable RequestTrace parent, @Nullable Object data) {
53+
public record RequestTrace(
54+
@Nullable String context,
55+
@Nullable RequestTrace parent,
56+
@Nullable Object data) {
5457

5558
public static final String CONTEXT_PLUGIN = "plugin";
5659
public static final String CONTEXT_PROJECT = "project";

compat/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -544,9 +544,10 @@ void logging(CliRequest cliRequest) throws ExitException {
544544
switch (logLevelThreshold.toLowerCase(Locale.ENGLISH)) {
545545
case "warn", "warning" -> LogLevelRecorder.Level.WARN;
546546
case "error" -> LogLevelRecorder.Level.ERROR;
547-
default -> throw new IllegalArgumentException(
548-
logLevelThreshold
549-
+ " is not a valid log severity threshold. Valid severities are WARN/WARNING and ERROR.");
547+
default ->
548+
throw new IllegalArgumentException(
549+
logLevelThreshold
550+
+ " is not a valid log severity threshold. Valid severities are WARN/WARNING and ERROR.");
550551
};
551552
recorder.setMaxLevelAllowed(level);
552553
slf4jLogger.info("Enabled to break the build on log level {}.", logLevelThreshold);

compat/maven-embedder/src/main/java/org/apache/maven/cli/transfer/TransferResourceIdentifier.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@
2929
* making it not very suitable for usage in collections.
3030
*/
3131
@Deprecated
32-
record TransferResourceIdentifier(String repositoryId, String repositoryUrl, String resourceName, @Nullable File file) {
32+
record TransferResourceIdentifier(
33+
String repositoryId,
34+
String repositoryUrl,
35+
String resourceName,
36+
@Nullable File file) {
3337
TransferResourceIdentifier(TransferResource resource) {
3438
this(resource.getRepositoryId(), resource.getRepositoryUrl(), resource.getResourceName(), resource.getFile());
3539
}

compat/maven-embedder/src/test/java/org/apache/maven/cli/props/MavenPropertiesTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ public class MavenPropertiesTest {
5151

5252
private MavenProperties properties;
5353

54-
static final String TEST_PROPERTIES =
55-
"""
54+
static final String TEST_PROPERTIES = """
5655
#
5756
# test.properties
5857
# Used in the PropertiesTest

compat/maven-model-builder/src/main/java/org/apache/maven/utils/Os.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,10 @@ public static boolean isFamily(String family, String actualOsName) {
188188
case FAMILY_DOS -> File.pathSeparatorChar == ';' && !isFamily(FAMILY_NETWARE, actualOsName) && !isWindows;
189189
case FAMILY_MAC -> actualOsName.contains(FAMILY_MAC) || actualOsName.contains(DARWIN);
190190
case FAMILY_TANDEM -> actualOsName.contains("nonstop_kernel");
191-
case FAMILY_UNIX -> File.pathSeparatorChar == ':'
192-
&& !isFamily(FAMILY_OPENVMS, actualOsName)
193-
&& (!isFamily(FAMILY_MAC, actualOsName) || actualOsName.endsWith("x"));
191+
case FAMILY_UNIX ->
192+
File.pathSeparatorChar == ':'
193+
&& !isFamily(FAMILY_OPENVMS, actualOsName)
194+
&& (!isFamily(FAMILY_MAC, actualOsName) || actualOsName.endsWith("x"));
194195
case FAMILY_ZOS -> actualOsName.contains(FAMILY_ZOS) || actualOsName.contains(FAMILY_OS390);
195196
case FAMILY_OS400 -> actualOsName.contains(FAMILY_OS400);
196197
case FAMILY_OPENVMS -> actualOsName.contains(FAMILY_OPENVMS);

compat/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ public static String toRepositoryChecksumPolicy(final String artifactRepositoryP
8686
case RepositoryPolicy.CHECKSUM_POLICY_FAIL -> RepositoryPolicy.CHECKSUM_POLICY_FAIL;
8787
case RepositoryPolicy.CHECKSUM_POLICY_IGNORE -> RepositoryPolicy.CHECKSUM_POLICY_IGNORE;
8888
case RepositoryPolicy.CHECKSUM_POLICY_WARN -> RepositoryPolicy.CHECKSUM_POLICY_WARN;
89-
default -> throw new IllegalArgumentException(
90-
"unknown repository checksum policy: " + artifactRepositoryPolicy);
89+
default ->
90+
throw new IllegalArgumentException("unknown repository checksum policy: " + artifactRepositoryPolicy);
9191
};
9292
}
9393
}

compat/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/relocation/UserPropertiesArtifactRelocationSource.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,9 @@ private static Artifact parseArtifact(String coords) {
202202
case 3 -> new DefaultArtifact(parts[0], parts[1], "*", "*", parts[2]);
203203
case 4 -> new DefaultArtifact(parts[0], parts[1], "*", parts[2], parts[3]);
204204
case 5 -> new DefaultArtifact(parts[0], parts[1], parts[2], parts[3], parts[4]);
205-
default -> throw new IllegalArgumentException("Bad artifact coordinates " + coords
206-
+ ", expected format is <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>");
205+
default ->
206+
throw new IllegalArgumentException("Bad artifact coordinates " + coords
207+
+ ", expected format is <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>");
207208
};
208209
return s;
209210
}

impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupInvoker.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,9 +430,10 @@ protected void activateLogging(C context) throws Exception {
430430
switch (logLevelThreshold.toLowerCase(Locale.ENGLISH)) {
431431
case "warn", "warning" -> LogLevelRecorder.Level.WARN;
432432
case "error" -> LogLevelRecorder.Level.ERROR;
433-
default -> throw new IllegalArgumentException(
434-
logLevelThreshold
435-
+ " is not a valid log severity threshold. Valid severities are WARN/WARNING and ERROR.");
433+
default ->
434+
throw new IllegalArgumentException(
435+
logLevelThreshold
436+
+ " is not a valid log severity threshold. Valid severities are WARN/WARNING and ERROR.");
436437
};
437438
recorder.setMaxLevelAllowed(level);
438439
context.logger.info("Enabled to break the build on log level " + logLevelThreshold + ".");

impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvnsh/ShellInvoker.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ protected int execute(LookupContext context) throws Exception {
8989
DefaultParser parser = new DefaultParser();
9090
parser.setRegexCommand("[:]{0,1}[a-zA-Z!]{1,}\\S*"); // change default regex to support shell commands
9191

92-
String banner =
93-
"""
92+
String banner = """
9493
9594
░▒▓██████████████▓▒░ ░▒▓█▓▒░░▒▓█▓▒░░▒▓███████▓▒░ ░▒▓███████▓▒░░▒▓█▓▒░░▒▓█▓▒░\s
9695
░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░\s

0 commit comments

Comments
 (0)