google / google/google-java-format
Incorrect formatting of then clause when there is a comment on the line with `if`
- Linguagem predominante
- Java
- Estrelas
- 6.2k
- Forks
- 937
- Merge médio
- 6min
- PRs com merge (30d)
- 3
Descrição
Consider the following code, which has been formatted with google-java-format:
```java
public class CommentedTest {
public boolean comparableOrSuperclassEitherWay(ProglangType other) {
if (this == other) // ProglangType objects are interned
return true;
if (((this.base == BASE_OBJECT) && other.baseIsObject()) // interned strings
|| ((other.base == BASE_OBJECT) && baseIsObject())) // interned strings
return true;
return false;
}
}
```
The two `return true;` lines ought to be indented, but they are not.
Guia de contribuição
Direção de pesquisa
Nenhum arquivo-fonte ou teste é mencionado na issue. Comece reproduzindo a saída do formatter com o snippet Java fornecido e, em seguida, rastreie o tratamento de comentários nas linhas if e nas cláusulas then que as seguem. Está concluído quando ambas as instruções return estiverem indentadas corretamente e o comportamento estiver coberto por um teste de regressão.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- java
- Domínio
- tooling
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 42/100