//
// Nexus Core - a framework for developing distributed applications
// http://github.com/threerings/nexus/blob/master/LICENSE

package com.threerings.nexus.util;

/**
 * Used to communicate asynchronous results.
 */
public interface Callback<T>
{
    /** A callback that chains failure to the supplied delegate callback. */
    public static abstract class Chain<T> implements Callback<T> {
        public Chain (Callback<?> onFailure) {
            _onFailure = onFailure;
        }
        public void onFailure (Throwable cause) {
            _onFailure.onFailure(cause);
        }
        protected Callback<?> _onFailure;
    }

    public static class NoOp<T> implements Callback<T> {
        @Override public void onSuccess (T result) {
            // We're a No-Op - do nothing.
        }

        @Override public void onFailure (Throwable cause) {
            // We're a No-Op - do nothing.
        }
    }

    /**
     * Called when the asynchronous request succeeded, supplying its result.
     */
    void onSuccess (T result);

    /**
     * Called when the asynchronous request failed, supplying a cause for failure.
     */
    void onFailure (Throwable cause);
}

@@ -638,58 +638,234 @@
     
-public static class NoOp%3CT%3E implements Callback%3CT%3E
+/** A callback that does nothing, including nothing in the event of failure. Don't use this if%0A     * doing so will result in the suppression of errors! */%0A    public static final Callback%3CObject%3E NOOP = new Callback%3CObject%3E()
  %7B%0A 
@@ -896,33 +896,38 @@
 void onSuccess (
-T
+Object
  result) %7B%0A     
@@ -924,62 +924,18 @@
 t) %7B
-%0A            // We're a No-Op - do nothing.%0A        %7D%0A
+%7D // noop!
 %0A   
@@ -994,67 +994,25 @@
 e) %7B
-%0A            // We're a No-Op - do nothing.%0A        %7D
+%7D // noop!
 %0A    %7D
+;
 %0A%0A  

Switch to a singleton NOOP. With proper variance, this can be used everywhere.