Skip to content

Commit ffb7c59

Browse files
authored
Get rid of Java-specific default Palantir version (#2686 fixes #2685)
2 parents 68c1254 + 564353e commit ffb7c59

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ This document is intended for Spotless developers.
1010
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `1.27.0`).
1111

1212
## [Unreleased]
13+
### Fixed
14+
- palantirJavaFormat is no longer arbitrarily set to outdated versions on Java 17, latest available version is always used ([#2686](https://github.com/diffplug/spotless/pull/2686) fixes [#2685](https://github.com/diffplug/spotless/issues/2685))
1315

1416
## [4.0.0] - 2025-09-24
1517
### Changes

lib/src/main/java/com/diffplug/spotless/java/PalantirJavaFormatStep.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import com.diffplug.spotless.FormatterFunc;
2424
import com.diffplug.spotless.FormatterStep;
2525
import com.diffplug.spotless.JarState;
26-
import com.diffplug.spotless.Jvm;
2726
import com.diffplug.spotless.Provisioner;
2827

2928
/** Wraps up <a href="https://github.com/palantir/palantir-java-format">palantir-java-format</a> fork of
@@ -35,7 +34,7 @@ public final class PalantirJavaFormatStep implements Serializable {
3534
private static final String DEFAULT_STYLE = "PALANTIR";
3635
private static final String NAME = "palantir-java-format";
3736
public static final String MAVEN_COORDINATE = "com.palantir.javaformat:palantir-java-format:";
38-
private static final Jvm.Support<String> JVM_SUPPORT = Jvm.<String> support(NAME).add(8, "1.1.0").add(11, "2.28.0").add(21, "2.71.0");
37+
public static final String DEFAULT_VERSION = "2.80.0"; // compatible with Java 11+
3938

4039
/** The jar that contains the formatter. */
4140
private final JarState.Promised jarState;
@@ -90,7 +89,7 @@ public static FormatterStep create(String version, String style, boolean formatJ
9089

9190
/** Get default formatter version */
9291
public static String defaultVersion() {
93-
return JVM_SUPPORT.getRecommendedFormatterVersion();
92+
return DEFAULT_VERSION;
9493
}
9594

9695
/** Get default style */
@@ -129,7 +128,7 @@ FormatterFunc createFormat() throws Exception {
129128
final Class<?> formatterFunc = classLoader.loadClass("com.diffplug.spotless.glue.pjf.PalantirJavaFormatFormatterFunc");
130129
// 1st arg is "style", 2nd arg is "formatJavadoc"
131130
final Constructor<?> constructor = formatterFunc.getConstructor(String.class, boolean.class);
132-
return JVM_SUPPORT.suggestLaterVersionOnError(formatterVersion, (FormatterFunc) constructor.newInstance(style, formatJavadoc));
131+
return (FormatterFunc) constructor.newInstance(style, formatJavadoc);
133132
}
134133
}
135134
}

plugin-gradle/CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `3.27.0`).
44

55
## [Unreleased]
6+
### Fixed
7+
- palantirJavaFormat is no longer arbitrarily set to outdated versions on Java 17, latest available version is always used ([#2686](https://github.com/diffplug/spotless/pull/2686) fixes [#2685](https://github.com/diffplug/spotless/issues/2685))
68

79
## [8.0.0] - 2025-09-24
810
### Changed

plugin-maven/CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `1.27.0`).
44

55
## [Unreleased]
6+
### Fixed
7+
- palantirJavaFormat is no longer arbitrarily set to outdated versions on Java 17, latest available version is always used ([#2686](https://github.com/diffplug/spotless/pull/2686) fixes [#2685](https://github.com/diffplug/spotless/issues/2685))
68

79
## [3.0.0] - 2025-09-24
810
### Changes

0 commit comments

Comments
 (0)