두 메소드를 비교하는 메소드가 같음을 알았고이를 단순화하려고합니다.Java 부울 비교 단순화
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Move other = (Move) obj;
return !(this.initialBalls != other.initialBalls &&
(this.initialBalls == null || !this.initialBalls.equals(other.initialBalls)))
&& this.direction == other.direction && this.color == other.color;
}
누군가가 아이디어를 가지고 있습니까?
아마 코드 검토의 사람이 당신을 도울 수 : http://codereview.stackexchange.com/ –
즉, return 문은 불필요하게 복잡하다. CR로 가서 더 기쁜 마음으로 뭔가를 제공 할 것입니다. –
이 질문은 codereview에 관한 것이므로 해당 주제에 속하지 않는 것으로 보입니다. –