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/ResultTransformer.java | 21 +++++++++------------
1 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/sdk/src/com/sun/opends/sdk/util/ResultTransformer.java b/sdk/src/com/sun/opends/sdk/util/ResultTransformer.java
index d879c2f..80dc5fa 100644
--- a/sdk/src/com/sun/opends/sdk/util/ResultTransformer.java
+++ b/sdk/src/com/sun/opends/sdk/util/ResultTransformer.java
@@ -47,15 +47,12 @@
* 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 ResultTransformer<M, N, P> implements
- ResultFuture<N>, ResultHandler<M, P>
+public abstract class ResultTransformer<M, N> implements
+ ResultFuture<N>, ResultHandler<M>
{
- private final ResultHandler<? super N, P> handler;
+ private final ResultHandler<? super N> handler;
private volatile ResultFuture<M> future = null;
@@ -98,7 +95,7 @@
* @param handler
* The outer result handler.
*/
- protected ResultTransformer(ResultHandler<? super N, P> handler)
+ protected ResultTransformer(ResultHandler<? super N> handler)
{
this.handler = handler;
}
@@ -108,11 +105,11 @@
/**
* {@inheritDoc}
*/
- public final void handleErrorResult(P p, ErrorResultException error)
+ public final void handleErrorResult(ErrorResultException error)
{
if (handler != null)
{
- handler.handleErrorResult(p, error);
+ handler.handleErrorResult(error);
}
}
@@ -121,17 +118,17 @@
/**
* {@inheritDoc}
*/
- public final void handleResult(P p, M result)
+ public final void handleResult(M result)
{
if (handler != null)
{
try
{
- handler.handleResult(p, transformResult(result));
+ handler.handleResult(transformResult(result));
}
catch (ErrorResultException e)
{
- handler.handleErrorResult(p, e);
+ handler.handleErrorResult(e);
}
}
}
--
Gitblit v1.10.0