From a415256cc798baf286d618a2c9ddd427c26a518d Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Mon, 14 Dec 2009 13:21:39 +0000
Subject: [PATCH] Remove optional P parameter from result handlers as it is hardly ever needed in practice and just pollutes the APIs.

---
 sdk/src/com/sun/opends/sdk/util/ResultChain.java |   25 +++++++++++--------------
 1 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/sdk/src/com/sun/opends/sdk/util/ResultChain.java b/sdk/src/com/sun/opends/sdk/util/ResultChain.java
index b8642d2..4c78eac 100644
--- a/sdk/src/com/sun/opends/sdk/util/ResultChain.java
+++ b/sdk/src/com/sun/opends/sdk/util/ResultChain.java
@@ -51,17 +51,14 @@
  *          The type of the inner result.
  * @param <N>
  *          The type of the outer result.
- * @param <P>
- *          The type of the additional parameter to the handler's
- *          methods.
  */
-public abstract class ResultChain<M, N, P> implements ResultFuture<N>,
-    ResultHandler<M, P>
+public abstract class ResultChain<M, N> implements ResultFuture<N>,
+    ResultHandler<M>
 {
 
   private ErrorResultException errorResult;
 
-  private final ResultHandler<? super N, P> handler;
+  private final ResultHandler<? super N> handler;
 
   private final Object stateLock = new Object();
 
@@ -82,7 +79,7 @@
    * @param handler
    *          The outer result handler.
    */
-  protected ResultChain(ResultHandler<? super N, P> handler)
+  protected ResultChain(ResultHandler<? super N> handler)
   {
     this.handler = handler;
   }
@@ -168,7 +165,7 @@
   /**
    * {@inheritDoc}
    */
-  public void handleErrorResult(P p, ErrorResultException error)
+  public void handleErrorResult(ErrorResultException error)
   {
     synchronized (stateLock)
     {
@@ -181,7 +178,7 @@
         errorResult = e;
         if (handler != null)
         {
-          handler.handleErrorResult(p, errorResult);
+          handler.handleErrorResult(errorResult);
         }
         latch.countDown();
       }
@@ -193,7 +190,7 @@
   /**
    * {@inheritDoc}
    */
-  public void handleResult(P p, M result)
+  public void handleResult(M result)
   {
     synchronized (stateLock)
     {
@@ -206,7 +203,7 @@
         errorResult = e;
         if (handler != null)
         {
-          handler.handleErrorResult(p, errorResult);
+          handler.handleErrorResult(errorResult);
         }
         latch.countDown();
       }
@@ -288,8 +285,8 @@
    *           should terminate.
    */
   protected ResultFuture<N> chainErrorResult(
-      ErrorResultException innerError,
-      ResultHandler<? super N, P> handler) throws ErrorResultException
+      ErrorResultException innerError, ResultHandler<? super N> handler)
+      throws ErrorResultException
   {
     throw innerError;
   }
@@ -310,6 +307,6 @@
    *           should terminate.
    */
   protected abstract ResultFuture<N> chainResult(M innerResult,
-      ResultHandler<? super N, P> handler) throws ErrorResultException;
+      ResultHandler<? super N> handler) throws ErrorResultException;
 
 }

--
Gitblit v1.10.0