google / google/google-java-format
Incorrect formatting of then clause when there is a comment on the line with `if`
Offen
- Vorherrschende Sprache
- Java
- Sterne
- 6.2k
- Forks
- 937
- Ø Merge
- 6 Min.
- Gemergte PRs (30 T.)
- 3
Beschreibung
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.
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.