Commit 075e025
Prepare to changes to
After https://bugs.openjdk.org/browse/JDK-8268850, `VariableTree#getType` returns a new AST node `VarTypeTree` for variables declared with `var`.
The new node could be handled in the visitor by implementing `visitVarType`, but that API is only available on the latest JDK versions using var, which would require creating a new version-specific visitor implementation. To defer doing that, this fix re-orders the logic that handles variable types to check if the next token is `var` first, to avoid needing to handle the new AST node.
PiperOrigin-RevId: 876244813var in AST1 parent b0ef30a commit 075e025
File tree
1 file changed
+3
-3
lines changed- core/src/main/java/com/google/googlejavaformat/java
1 file changed
+3
-3
lines changedLines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3686 | 3686 | | |
3687 | 3687 | | |
3688 | 3688 | | |
3689 | | - | |
| 3689 | + | |
| 3690 | + | |
| 3691 | + | |
3690 | 3692 | | |
3691 | 3693 | | |
3692 | 3694 | | |
3693 | 3695 | | |
3694 | 3696 | | |
3695 | 3697 | | |
3696 | | - | |
3697 | | - | |
3698 | 3698 | | |
3699 | 3699 | | |
3700 | 3700 | | |
| |||
0 commit comments