0

当前使用IntelliJ 2018.2.3

应选中/取消选中代码样式(或其他任何地方)中的哪些选项以实现以下行为?

预期行为:

@Override
public boolean equals(Object other) {
    return other == this // short circuit if same object
            || (other instanceof UniquePersonList // instanceof handles nulls
               && this.internalList.equals(((UniquePersonList) other).internalList)); <--
}

当前行为

@Override
public boolean equals(Object other) {
    return other == this // short circuit if same object
            || (other instanceof UniquePersonList // instanceof handles nulls
            && this.internalList.equals(((UniquePersonList) other).internalList)); <--
}

目前,每次我自动格式化代码时,它&&都会将||. 但很明显,&&属于第二条的小节。

4

1 回答 1

1

尝试代码风格 | 爪哇 | 包装和大括号 | 二进制表达式 | 多行时对齐

于 2018-09-16T16:13:31.810 回答