google / google/google-java-format

Incorrect comment indentation inside switch statements on case that is not first

Aberta
#1,155 1 comentário 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Java
Estrelas
6.2k
Forks
937
Merge médio
6min
PRs com merge (30d)
3

Descrição

continuation of https://github.com/google/google-java-format/issues/1147

```
$ javac Test.java
$ cat Test.java
public class Test {
public void check1(int x) {
switch (x) {
case 1:
x = x + 1;
/* fall-through*/ case 2:
;
default:
return;
}
}
}

$ java -jar google-java-format-1.23.0-all-deps.jar Test.java > TestUpdated.java
$ diff -u Test.java TestUpdated.java
--- Test.java 2024-09-01 07:31:37.268757862 -0700
+++ TestUpdated.java 2024-09-01 07:31:54.329333795 -0700
@@ -3,7 +3,7 @@
switch (x) {
case 1:
x = x + 1;
- /* fall-through*/ case 2:
+ /* fall-through*/ case 2:
;
default:
return;

$ cat TestUpdated.java
public class Test {
public void check1(int x) {
switch (x) {
case 1:
x = x + 1;
/* fall-through*/ case 2:
;
default:
return;
}
}
}
```

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.