mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-17 07:20:53 +07:00
when generating equals() and hashCode() methods using the "java.util.Objects.equals() and hash() (java 7+)" template GitOrigin-RevId: a863b875fa482542bbb9b2efc5e61cfa2bfb787d
19 lines
394 B
Java
19 lines
394 B
Java
import java.util.Arrays;
|
|
import java.util.Objects;
|
|
|
|
class A {
|
|
int[] a1;
|
|
|
|
@Override
|
|
public boolean equals(Object o) {
|
|
if (this == o) return true;
|
|
if (o == null || getClass() != o.getClass()) return false;
|
|
final A a = (A) o;
|
|
return Objects.deepEquals(a1, a.a1);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Arrays.hashCode(a1);
|
|
}
|
|
} |