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/org/opends/sdk/schema/Schema.java |   30 ++++++++++--------------------
 1 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/sdk/src/org/opends/sdk/schema/Schema.java b/sdk/src/org/opends/sdk/schema/Schema.java
index 1dcc5b7..37b665f 100644
--- a/sdk/src/org/opends/sdk/schema/Schema.java
+++ b/sdk/src/org/opends/sdk/schema/Schema.java
@@ -1640,9 +1640,6 @@
    * Implementations may choose to perform optimizations such as
    * caching.
    *
-   * @param <P>
-   *          The type of the additional parameter to the handler's
-   *          methods.
    * @param connection
    *          A connection to the Directory Server whose schema is to be
    *          read.
@@ -1652,8 +1649,6 @@
    *          A result handler which can be used to asynchronously
    *          process the operation result when it is received, may be
    *          {@code null}.
-   * @param p
-   *          Optional additional handler parameter.
    * @return A future representing the result of the operation.
    * @throws UnsupportedOperationException
    *           If this connection does not support search operations.
@@ -1664,15 +1659,15 @@
    *           If the {@code connection} or {@code name} was {@code
    *           null}.
    */
-  public static <P> ResultFuture<Schema> readSchema(
+  public static ResultFuture<Schema> readSchema(
       AsynchronousConnection connection, DN name,
-      ResultHandler<? super Schema, P> handler, P p)
+      ResultHandler<? super Schema> handler)
       throws UnsupportedOperationException, IllegalStateException,
       NullPointerException
   {
     final SearchRequest request = getReadSchemaSearchRequest(name);
 
-    final ResultTransformer<SearchResultEntry, Schema, P> future = new ResultTransformer<SearchResultEntry, Schema, P>(
+    final ResultTransformer<SearchResultEntry, Schema> future = new ResultTransformer<SearchResultEntry, Schema>(
         handler)
     {
 
@@ -1685,7 +1680,7 @@
     };
 
     ResultFuture<SearchResultEntry> innerFuture = connection
-        .searchSingleEntry(request, future, p);
+        .searchSingleEntry(request, future);
     future.setResultFuture(innerFuture);
     return future;
   }
@@ -1706,9 +1701,6 @@
    * schema. However, implementations may choose to perform other
    * optimizations, such as caching.
    *
-   * @param <P>
-   *          The type of the additional parameter to the handler's
-   *          methods.
    * @param connection
    *          A connection to the Directory Server whose schema is to be
    *          read.
@@ -1719,8 +1711,6 @@
    *          A result handler which can be used to asynchronously
    *          process the operation result when it is received, may be
    *          {@code null}.
-   * @param p
-   *          Optional additional handler parameter.
    * @return A future representing the result of the operation.
    * @throws UnsupportedOperationException
    *           If this connection does not support search operations.
@@ -1731,30 +1721,30 @@
    *           If the {@code connection} or {@code name} was {@code
    *           null}.
    */
-  public static <P> ResultFuture<Schema> readSchemaForEntry(
+  public static ResultFuture<Schema> readSchemaForEntry(
       final AsynchronousConnection connection, final DN name,
-      ResultHandler<Schema, P> handler, final P p)
+      ResultHandler<Schema> handler)
       throws UnsupportedOperationException, IllegalStateException,
       NullPointerException
   {
-    final ResultChain<SearchResultEntry, Schema, P> future = new ResultChain<SearchResultEntry, Schema, P>(
+    final ResultChain<SearchResultEntry, Schema> future = new ResultChain<SearchResultEntry, Schema>(
         handler)
     {
 
       protected ResultFuture<Schema> chainResult(
           SearchResultEntry innerResult,
-          ResultHandler<? super Schema, P> handler)
+          ResultHandler<? super Schema> handler)
           throws ErrorResultException
       {
         final DN subschemaDN = getSubschemaSubentryDN(name, innerResult);
-        return readSchema(connection, subschemaDN, handler, p);
+        return readSchema(connection, subschemaDN, handler);
       }
 
     };
 
     final SearchRequest request = getReadSchemaForEntrySearchRequest(name);
     ResultFuture<SearchResultEntry> innerFuture = connection
-        .searchSingleEntry(request, future, p);
+        .searchSingleEntry(request, future);
     future.setInnerResultFuture(innerFuture);
     return future;
   }

--
Gitblit v1.10.0