Commit dc50f40
committed
Cover how a long generic field type wraps
A field whose parameterized type fits in the line keeps the type whole
and moves the name and the initializer to the next line. A type that
does not fit breaks right after "<" and puts its arguments one level
deeper: on one line when they fit there, one per line when they do
not. That is google-java-format's layout, kept as it is. At 120
columns it shows only on a type that is over the limit by itself: in
the 15,747 files of the JDK 21 sources, once on a field
(LocaleProviderAdapter) and once inside a cast (TCPTransport).
The golden pins the three shapes, so that an upstream sync or a change
to visitParameterizedType has to say so.1 parent 86cdc74 commit dc50f40
2 files changed
Lines changed: 23 additions & 0 deletions
File tree
- open-java-format/src/test/resources/com/palantir/javaformat/java/testdata
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
0 commit comments