FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix indentation of case statements on JDK 17 by copybara-service[bot] · Pull Request #654 · google/google-java-format · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .input  (1) .java  (1) .output  (1) All 3 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
      • I643.input
      • I643.output
This file contains hidden or 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
Expand Up @@ -251,7 +251,7 @@ public Void visitCase(CaseTree node, Void unused) {
token("default", plusTwo);
} else {
token("case", plusTwo);
builder.open(plusFour);
builder.open(node.getExpressions().size() > 1 ? plusFour : ZERO);
builder.space();
boolean first = true;
for (ExpressionTree expression : node.getExpressions()) {
Expand Down
This file contains hidden or 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;
}
}
}
This file contains hidden or 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;
}
}
}

Back | FazBrowse Home | New Git URL