On 11/21/2013 03:56 PM, Remi Forax wrote:
Maybe one of:
interface KoolReusablePair {
default boolean defaultEquals(Object x) { ... }
static int hashCode(KoolReusablePair self) { ... }
...
}
class KoolImpl implements KoolReusablePair {
@Override //manual opt-in:
public boolean equals(Object x) { return
KoolReusablePair.super.defaultEquals(x); }
@Override //manual opt-in:
public int hashCode() { return KoolReusablePair.hashCode(this); }
...
}
— John
The plumber in me think that a static method unlike a default method
will not pollute the itable.
...and static interface method, unlike default, will not pollute the
public API (static interface methods are not inherited).
Regards, Peter
regards,
Rémi