eclipse-jdt / eclipse-jdt/eclipse.jdt.core
[dom ast] case statement rewrite formatting
- Dominant language
- Java
- Stars
- 237
- Forks
- 195
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 47
Description
Consider the following code:
```
public class X {
static int foo(int i) {
int tw = 0;
switch (i) {
case 1 : {
int z = 100;
break;
}
default : {
break;
}
}
return tw;
}
public static void main(String[] args) {
System.out.print(foo(1));
}
}
```
Now add case 100: with a block having a singleton break;
The resulting code looks like:
```
public class X {
static int foo(int i) {
int tw = 0;
switch (i) {
case 1 : {
int z = 100;
break;
}
case 100:
{
break;
}
default : {
break;
}
}
return tw;
}
public static void main(String[] args) {
System.out.print(foo(1));
}
}
```
The case 100: block format is different.
Ref: https://bugs.eclipse.org/bugs/show_bug.cgi?id=545439
Contributor guide
Assessment
This issue has not been assessed yet.