Skip to content

Commit dff4404

Browse files
committed
List the switch and banner changes among the output differences on Migrate
Two more changes on the formatter's main branch move output away from palantir-java-format 2.98.0, and Migrate lists every such difference. openjavaformat/open-java-format#76 brings over palantir 2.99.0's one change: a switch expression that initializes a variable or a field starts on the declaration's line, 57 declarations in 51 files of the JDK 21 sources. openjavaformat/open-java-format#74 stops counting a comment that opens with /*** as javadoc, so a blank line between such a banner and the declaration after it stays: 70 blank lines in 43 files, all of them in the source. Both join the cast fix as not yet released, and the corpus paragraph gives their numbers.
1 parent 5745416 commit dff4404

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎docs/migrate.md‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,19 @@ produces no formatting diff and needs no reformatting commit.
1111
- Not yet in a release: a cast to a parameterized type at the end of a call chain is no longer split
1212
inside its type, `(PrivilegedAction<` on one line and `String>)` on the next, when the chain is
1313
inlined but the type does not fit behind it. The call breaks its arguments one per line instead.
14+
- Not yet in a release: a switch expression that initializes a variable or a field starts on the line
15+
of the declaration, `int x = switch (y) {`, with its cases eight columns further left, the shape a
16+
plain assignment already had. This is the one change of palantir-java-format 2.99.0, brought over.
17+
- Not yet in a release: a comment that opens with `/***`, such as a banner, no longer counts as
18+
javadoc, so a blank line between it and the declaration after it stays, as after any other block
19+
comment.
1420

1521
Checked on 341 source files, about 24,000 lines: palantir-java-format 2.98.0 and open-java-format
1622
2.98.0.2 give byte-identical output. On the JDK 21 sources, 2.98.0.3 reformats 5 of the files that
17-
2.98.0.2 leaves unchanged when run again, all because of the string fix; the cast fix changes one
18-
statement, in `sun.rmi.transport.tcp.TCPTransport`.
23+
2.98.0.2 leaves unchanged when run again, all because of the string fix. Of the three unreleased
24+
changes, the cast fix changes one statement, in `sun.rmi.transport.tcp.TCPTransport`; the switch
25+
change moves 57 declarations in 51 files; and the banner change keeps 70 blank lines in 43 files,
26+
every one of them present in the source.
1927

2028
The Java packages are unchanged as well. Only the names in your build and your scripts change.
2129

0 commit comments

Comments
 (0)