Commit af4b138
Accept a type annotation on the qualifier of a method reference
"Supplier<List<?>> a = @A ArrayList::new;" failed with 'did not
generate token "@"'. The printing of a type annotation on a method
reference's qualifier was already in place, but visitMemberReference
first synced to the tree's start position, and javac's start position
for a member reference leaves out the annotation, so the sync reported
the annotation's tokens as never generated.
This ports google/google-java-format#984 by Liam Miller-Cushon:
visitMemberReference no longer syncs to the start position. The golden
B308157568 comes from upstream, with the expected output in this
project's style.
The 15,747 files of the JDK 21 sources format exactly as before.1 parent 746fb60 commit af4b138
3 files changed
Lines changed: 48 additions & 1 deletion
File tree
- open-java-format/src
- main/java/com/palantir/javaformat/java
- test/resources/com/palantir/javaformat/java/testdata
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
928 | 928 | | |
929 | 929 | | |
930 | 930 | | |
931 | | - | |
| 931 | + | |
| 932 | + | |
932 | 933 | | |
933 | 934 | | |
934 | 935 | | |
| |||
Lines changed: 23 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 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
Lines changed: 23 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 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
0 commit comments