Use the NOOP class to implement the NOOP constant.

Really, they should both be deprecated. Log your exceptions.
If there's a special place where you have to hack it to not log
an exception, that special place can damn well create its own no-op
listener. Or be fixed!

Having an abstract class that only implements a blank requestCompleted()
would make sense, as would a sharable singleton instance that does
nothing on success and always logs on failure. Hmm.
This commit is contained in:
Ray J. Greenwell
2014-04-23 09:42:22 -07:00
parent 5fee13709f
commit df44ea16f1
@@ -61,10 +61,5 @@ public interface ResultListener<T>
/** @deprecated This cannot be type safe so don't use it. */
@Deprecated
public ResultListener<Object> NOOP = new ResultListener<Object>() {
public void requestCompleted (Object result) {
}
public void requestFailed (Exception cause) {
}
};
public ResultListener<Object> NOOP = new NOOP<Object>();
}