From df44ea16f1c71dabfc08bfd558a0ddcec3944141 Mon Sep 17 00:00:00 2001 From: "Ray J. Greenwell" Date: Wed, 23 Apr 2014 09:42:22 -0700 Subject: [PATCH] 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. --- src/main/java/com/samskivert/util/ResultListener.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/main/java/com/samskivert/util/ResultListener.java b/src/main/java/com/samskivert/util/ResultListener.java index 3e494f19..621307dc 100644 --- a/src/main/java/com/samskivert/util/ResultListener.java +++ b/src/main/java/com/samskivert/util/ResultListener.java @@ -61,10 +61,5 @@ public interface ResultListener /** @deprecated This cannot be type safe so don't use it. */ @Deprecated - public ResultListener NOOP = new ResultListener() { - public void requestCompleted (Object result) { - } - public void requestFailed (Exception cause) { - } - }; + public ResultListener NOOP = new NOOP(); }