2323import com .diffplug .spotless .FormatterFunc ;
2424import com .diffplug .spotless .FormatterStep ;
2525import com .diffplug .spotless .JarState ;
26- import com .diffplug .spotless .Jvm ;
2726import 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}
0 commit comments