【发布时间】:2019-02-20 09:44:30
【问题描述】:
目前使用 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)); <--
}
目前,每次我自动格式化代码时,它都会将&& 转换为与|| 对齐。但是很明显&&属于第二个子句的小节。
【问题讨论】:
标签: intellij-idea code-standards