-
Notifications
You must be signed in to change notification settings - Fork 49
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 google/google-java-format#643 PiperOrigin-RevId: 392966720
- Loading branch information
Showing
4 changed files
with
35 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
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
15 changes: 15 additions & 0 deletions
15
palantir-java-format/src/test/resources/com/palantir/javaformat/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,15 @@ | ||
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; | ||
static final int VERBOSE_WORDY_AND_LENGTHY_FOUR = 5; | ||
|
||
public static int fn(int x) { | ||
switch (x) { | ||
case VERBOSE_WORDY_AND_LENGTHY_ONE | VERBOSE_WORDY_AND_LENGTHY_TWO | VERBOSE_WORDY_AND_LENGTHY_FOUR | VERBOSE_WORDY_AND_LENGTHY_FIVE: | ||
return 0; | ||
default: | ||
return 1; | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
palantir-java-format/src/test/resources/com/palantir/javaformat/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,18 @@ | ||
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; | ||
static final int VERBOSE_WORDY_AND_LENGTHY_FOUR = 5; | ||
|
||
public static int fn(int x) { | ||
switch (x) { | ||
case VERBOSE_WORDY_AND_LENGTHY_ONE | ||
| VERBOSE_WORDY_AND_LENGTHY_TWO | ||
| VERBOSE_WORDY_AND_LENGTHY_FOUR | ||
| VERBOSE_WORDY_AND_LENGTHY_FIVE: | ||
return 0; | ||
default: | ||
return 1; | ||
} | ||
} | ||
} |