Makes hashCode and equals in InternalAggregations abstract (#26216)

This simply removes the default identity hashcode and equals methods in InternalAggregation which where only temporarily put there while we implmeneted the methods in the subclasses.
This commit is contained in:
Colin Goodheart-Smithe 2017-08-15 11:14:57 +01:00 committed by GitHub
parent 483086220f
commit f6d14717ed
1 changed files with 2 additions and 7 deletions

View File

@ -202,9 +202,7 @@ public abstract class InternalAggregation implements Aggregation, NamedWriteable
* Opportunity for subclasses to the {@link #hashCode()} for this
* class.
**/
protected int doHashCode() {
return System.identityHashCode(this);
}
protected abstract int doHashCode();
@Override
public boolean equals(Object obj) {
@ -221,7 +219,6 @@ public abstract class InternalAggregation implements Aggregation, NamedWriteable
doEquals(obj);
}
// norelease: make this abstract when all InternalAggregations implement this method
/**
* Opportunity for subclasses to add criteria to the {@link #equals(Object)}
* method for this class.
@ -230,9 +227,7 @@ public abstract class InternalAggregation implements Aggregation, NamedWriteable
* {@link #equals(Object)} method checks that <code>obj</code> is the same
* class as <code>this</code>
*/
protected boolean doEquals(Object obj) {
return this == obj;
}
protected abstract boolean doEquals(Object obj);
@Override
public String toString() {