Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix indentation of case statements on JDK 17
Fixes #643 PiperOrigin-RevId: 392966720
- Loading branch information
Showing
3 changed files
with
31 additions
and
1 deletion.
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
14 changes: 14 additions & 0 deletions
14
core/src/test/resources/com/google/googlejavaformat/java/testdata/I643.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,14 @@ | ||
public class Foo { | ||
static final int VERBOSE_WORDY_AND_LENGTHY_ONE = 1; | ||
static final int VERBOSE_WORDY_AND_LENGTHY_TWO = 2; | ||
static final int VERBOSE_WORDY_AND_LENGTHY_FOUR = 4; | ||
|
||
public static int fn(int x) { | ||
switch (x) { | ||
case VERBOSE_WORDY_AND_LENGTHY_ONE | VERBOSE_WORDY_AND_LENGTHY_TWO | VERBOSE_WORDY_AND_LENGTHY_FOUR: | ||
return 0; | ||
default: | ||
return 1; | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
core/src/test/resources/com/google/googlejavaformat/java/testdata/I643.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,16 @@ | ||
public class Foo { | ||
static final int VERBOSE_WORDY_AND_LENGTHY_ONE = 1; | ||
static final int VERBOSE_WORDY_AND_LENGTHY_TWO = 2; | ||
static final int VERBOSE_WORDY_AND_LENGTHY_FOUR = 4; | ||
|
||
public static int fn(int x) { | ||
switch (x) { | ||
case VERBOSE_WORDY_AND_LENGTHY_ONE | ||
| VERBOSE_WORDY_AND_LENGTHY_TWO | ||
| VERBOSE_WORDY_AND_LENGTHY_FOUR: | ||
return 0; | ||
default: | ||
return 1; | ||
} | ||
} | ||
} |