-
Notifications
You must be signed in to change notification settings - Fork 861
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix inconsistency in formatting of comments in switch statements
This was introduced by f7543b2, which only updated the logic for for JDK 17+. Fixes #1127 PiperOrigin-RevId: 659562426
- Loading branch information
Showing
3 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
core/src/test/resources/com/google/googlejavaformat/java/testdata/LegacySwitchComment.input
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class T { | ||
int test(String v) { | ||
switch (v) { | ||
// this is a line comment about "zero" | ||
case "zero": | ||
return 0; | ||
case "one": | ||
// this is a line comment about "one" | ||
return 1; | ||
// this is a line comment about "two" | ||
case "two": | ||
return 2; | ||
default: | ||
return -1; | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
core/src/test/resources/com/google/googlejavaformat/java/testdata/LegacySwitchComment.output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class T { | ||
int test(String v) { | ||
switch (v) { | ||
// this is a line comment about "zero" | ||
case "zero": | ||
return 0; | ||
case "one": | ||
// this is a line comment about "one" | ||
return 1; | ||
// this is a line comment about "two" | ||
case "two": | ||
return 2; | ||
default: | ||
return -1; | ||
} | ||
} | ||
} |