Commit 49ff83d
Leave a comment that opens with "/***" out of javadoc formatting
With javadoc formatting on, a banner such as
/*************************
* Copyright
*
* Some Company
*************************/
was taken for javadoc because it starts with "/**": the row of
asterisks moved onto a line of its own, and its paragraphs became <p>
tags. The javadoc formatter has nothing to improve in a comment like
that.
This ports upstream commit 37171795 by cushon (google-java-format
1.8): a comment whose fourth character is another asterisk is not
javadoc. That holds with javadoc formatting off as well, where it
decides how blank lines around the comment are treated: a blank line
between such a banner and the declaration after it is now kept, as
after any other block comment, instead of being removed as it would be
after javadoc. The empty() expectation changes accordingly, and a test
pins the banner.
Of the 15,747 files of the JDK 21 sources, 43 format differently, by
70 blank lines more in all and no other change; every one of them is
in the input, after a banner comment. The four of those files that
change again on a second run did so on main already.1 parent 746fb60 commit 49ff83d
2 files changed
Lines changed: 21 additions & 2 deletions
File tree
- open-java-format/src
- main/java/com/palantir/javaformat/java
- test/java/com/palantir/javaformat/java
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
158 | 160 | | |
159 | 161 | | |
160 | 162 | | |
| |||
Lines changed: 18 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
63 | 80 | | |
64 | 81 | | |
65 | 82 | | |
| |||
0 commit comments