forked from eclipse-jdt/eclipse.jdt.core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Java formatter setting for switch arror opening brace position (eclip…
- Loading branch information
1 parent
3eea946
commit 53aca1d
Showing
8 changed files
with
291 additions
and
8 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
58 changes: 58 additions & 0 deletions
58
org.eclipse.jdt.core.tests.model/workspace/Formatter/testGH1473/A_out.java
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,58 @@ | ||
class Test { | ||
void foo(int i) { | ||
int k = switch (i) { | ||
case 1, 2, 3: | ||
{ | ||
yield 33; | ||
} | ||
case 4: | ||
yield 44; | ||
case 5: | ||
{ | ||
} | ||
yield 55; | ||
default: | ||
{ | ||
throw new RuntimeException(); | ||
} | ||
}; | ||
|
||
switch (k) { | ||
case 1, 2, 3: | ||
{ | ||
k += 4; | ||
} { | ||
k += 55; | ||
break; | ||
} | ||
case 4: | ||
k += 43; | ||
break; | ||
default: | ||
{ | ||
throw new RuntimeException(); | ||
} | ||
} | ||
|
||
int m = switch (i) { | ||
case 1, 2, 3 -> { | ||
k++; | ||
yield 33; | ||
} | ||
case 4 -> 66; | ||
default -> { | ||
throw new RuntimeException(); | ||
} | ||
}; | ||
|
||
switch (m) { | ||
case 1, 2, 3 -> { | ||
k += 4; | ||
} | ||
case 4 -> k += 55; | ||
default -> { | ||
throw new RuntimeException(); | ||
} | ||
} | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
org.eclipse.jdt.core.tests.model/workspace/Formatter/testGH1473/B_out.java
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,57 @@ | ||
class Test { | ||
void foo(int i) { | ||
int k = switch (i) { | ||
case 1, 2, 3: { | ||
yield 33; | ||
} | ||
case 4: | ||
yield 44; | ||
case 5: { | ||
} | ||
yield 55; | ||
default: { | ||
throw new RuntimeException(); | ||
} | ||
}; | ||
|
||
switch (k) { | ||
case 1, 2, 3: { | ||
k += 4; | ||
} { | ||
k += 55; | ||
break; | ||
} | ||
case 4: | ||
k += 43; | ||
break; | ||
default: { | ||
throw new RuntimeException(); | ||
} | ||
} | ||
|
||
int m = switch (i) { | ||
case 1, 2, 3 -> | ||
{ | ||
k++; | ||
yield 33; | ||
} | ||
case 4 -> 66; | ||
default -> | ||
{ | ||
throw new RuntimeException(); | ||
} | ||
}; | ||
|
||
switch (m) { | ||
case 1, 2, 3 -> | ||
{ | ||
k += 4; | ||
} | ||
case 4 -> k += 55; | ||
default -> | ||
{ | ||
throw new RuntimeException(); | ||
} | ||
} | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
org.eclipse.jdt.core.tests.model/workspace/Formatter/testGH1473/C_out.java
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,62 @@ | ||
class Test { | ||
void foo(int i) { | ||
int k = switch (i) { | ||
case 1, 2, 3: | ||
{ | ||
yield 33; | ||
} | ||
case 4: | ||
yield 44; | ||
case 5: | ||
{ | ||
} | ||
yield 55; | ||
default: | ||
{ | ||
throw new RuntimeException(); | ||
} | ||
}; | ||
|
||
switch (k) { | ||
case 1, 2, 3: | ||
{ | ||
k += 4; | ||
} { | ||
k += 55; | ||
break; | ||
} | ||
case 4: | ||
k += 43; | ||
break; | ||
default: | ||
{ | ||
throw new RuntimeException(); | ||
} | ||
} | ||
|
||
int m = switch (i) { | ||
case 1, 2, 3 -> | ||
{ | ||
k++; | ||
yield 33; | ||
} | ||
case 4 -> 66; | ||
default -> | ||
{ | ||
throw new RuntimeException(); | ||
} | ||
}; | ||
|
||
switch (m) { | ||
case 1, 2, 3 -> | ||
{ | ||
k += 4; | ||
} | ||
case 4 -> k += 55; | ||
default -> | ||
{ | ||
throw new RuntimeException(); | ||
} | ||
} | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
org.eclipse.jdt.core.tests.model/workspace/Formatter/testGH1473/in.java
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,53 @@ | ||
class Test { | ||
void foo(int i) { | ||
int k = switch(i) { | ||
case 1,2,3: { | ||
yield 33; | ||
} | ||
case 4: | ||
yield 44; | ||
case 5:{} | ||
yield 55; | ||
default: { | ||
throw new RuntimeException(); | ||
} | ||
}; | ||
|
||
switch(k) { | ||
case 1,2,3: { | ||
k += 4; | ||
} | ||
{ | ||
k += 55; | ||
break; | ||
} | ||
case 4: | ||
k += 43; | ||
break; | ||
default: { | ||
throw new RuntimeException(); | ||
} | ||
} | ||
|
||
int m = switch(i) { | ||
case 1,2,3 -> { | ||
k++; | ||
yield 33; | ||
} | ||
case 4 -> 66; | ||
default -> { | ||
throw new RuntimeException(); | ||
} | ||
}; | ||
|
||
switch (m) { | ||
case 1,2,3 -> { | ||
k += 4; | ||
} | ||
case 4 -> k +=55; | ||
default -> { | ||
throw new RuntimeException(); | ||
} | ||
} | ||
} | ||
} |
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
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