google / google/google-java-format
Incorrect formatting of then clause when there is a comment on the line with `if`
Open
- Dominant language
- Java
- Stars
- 6.2k
- Forks
- 937
- Avg merge
- 6m
- Merged PRs (30d)
- 3
Description
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.
Contributor guide
Assessment
This issue has not been assessed yet.