Files
openide/java/java-tests/testData/codeInsight/generateEquals/afterHashCode.java
2013-02-12 10:22:22 +01:00

31 lines
834 B
Java

class Test {
int i;
Test a;
Test b;
double c;
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final Test test = (Test) o;
if (Double.compare(test.c, c) != 0) return false;
if (i != test.i) return false;
if (!a.equals(test.a)) return false;
if (b != null ? !b.equals(test.b) : test.b != null) return false;
return true;
}
public int hashCode() {
int result;
long temp;
result = i;
result = 31 * result + a.hashCode();
result = 31 * result + (b != null ? b.hashCode() : 0);
temp = c != +0.0d ? Double.doubleToLongBits(c) : 0L;
result = 31 * result + (int) (temp ^ (temp >>> 32));
return result;
}
}