Skip to content

Commit e0d3bef

Browse files
committed
Say that Style.PALANTIR is a deprecated alias of OJF
openjavaformat/open-java-format#200 keeps Style.PALANTIR as a deprecated alias of Style.OJF that formats the same, so code that names it, or looks the style up by name, keeps working after the change of coordinates. Migrate now says so, and that up to 21.0.1 such code does not compile, or fails with NoSuchFieldError when it was built against palantir-java-format. To merge with the release that has the alias: until then the page would promise what the published formatter does not do.
1 parent 8465d5d commit e0d3bef

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎docs/migrate.md‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ The Java packages are unchanged as well. Only the names in your build and your s
8686
| Gradle plugin | `com.palantir.java-format` | `dev.openjavaformat.java-format` |
8787
| Gradle property | `palantir.native.formatter` | `openjavaformat.native.formatter` |
8888
| Command-line style flag | `--palantir` | none: there is one style |
89-
| Style in the API | `PALANTIR` | `OJF` |
89+
| Style in the API | `PALANTIR` | `OJF`, with `PALANTIR` as its deprecated alias |
9090
| IntelliJ plugin | `palantir-java-format` | `open-java-format` |
9191
| Java packages | `com.palantir.javaformat.*` | the same |
9292

@@ -129,6 +129,11 @@ Change the coordinates. The imports stay as they are, because the packages did n
129129

130130
In a `pom.xml` it is the same change of `groupId`, `artifactId` and `version`.
131131

132+
Code that names `Style.PALANTIR` keeps working: it is a deprecated alias of `Style.OJF` and formats
133+
the same, and `Style.valueOf("PALANTIR")` finds it too. Up to 21.0.1 there is no `PALANTIR`: such
134+
code does not compile, and a jar built against palantir-java-format fails with `NoSuchFieldError`.
135+
Change it to `OJF` there.
136+
132137
### Spotless
133138

134139
With Gradle, remove `palantirJavaFormat()` from the `spotless` block and apply our plugin, which adds

0 commit comments

Comments
 (0)