You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by el...@apache.org on 2016/12/07 18:51:23 UTC

[4/4] mina git commit: o Added some missing Javadoc o Fixed some SonarLint issues

o Added some missing Javadoc
o Fixed some SonarLint issues

Project: http://git-wip-us.apache.org/repos/asf/mina/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina/commit/7c080890
Tree: http://git-wip-us.apache.org/repos/asf/mina/tree/7c080890
Diff: http://git-wip-us.apache.org/repos/asf/mina/diff/7c080890

Branch: refs/heads/2.0
Commit: 7c080890b86005d743903552a53a51db4ad3ee13
Parents: c87701f
Author: Emmanuel L�charny <el...@symas.com>
Authored: Wed Dec 7 19:28:49 2016 +0100
Committer: Emmanuel L�charny <el...@symas.com>
Committed: Wed Dec 7 19:28:49 2016 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/mina/core/IoUtil.java  | 67 +++++++++++++---
 .../apache/mina/core/RuntimeIoException.java    | 19 +++++
 .../mina/core/write/DefaultWriteRequest.java    | 84 ++++++++++++++++++++
 .../core/write/NothingWrittenException.java     | 56 ++++++++++++-
 .../apache/mina/core/write/WriteException.java  |  4 +-
 .../mina/core/write/WriteRequestWrapper.java    |  5 ++
 .../mina/core/write/WriteTimeoutException.java  | 56 ++++++++++++-
 .../write/WriteToClosedSessionException.java    | 57 ++++++++++++-
 8 files changed, 325 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina/blob/7c080890/mina-core/src/main/java/org/apache/mina/core/IoUtil.java
----------------------------------------------------------------------
diff --git a/mina-core/src/main/java/org/apache/mina/core/IoUtil.java b/mina-core/src/main/java/org/apache/mina/core/IoUtil.java
index 98def63..b9711bd 100644
--- a/mina-core/src/main/java/org/apache/mina/core/IoUtil.java
+++ b/mina-core/src/main/java/org/apache/mina/core/IoUtil.java
@@ -39,6 +39,10 @@ import org.apache.mina.core.session.IoSession;
 public final class IoUtil {
     private static final IoSession[] EMPTY_SESSIONS = new IoSession[0];
 
+    private IoUtil() {
+        // Do nothing
+    }
+
     /**
      * Writes the specified {@code message} to the specified {@code sessions}.
      * If the specified {@code message} is an {@link IoBuffer}, the buffer is
@@ -49,7 +53,7 @@ public final class IoUtil {
      * @return The list of WriteFuture created for each broadcasted message
      */
     public static List<WriteFuture> broadcast(Object message, Collection<IoSession> sessions) {
-        List<WriteFuture> answer = new ArrayList<WriteFuture>(sessions.size());
+        List<WriteFuture> answer = new ArrayList<>(sessions.size());
         broadcast(message, sessions.iterator(), answer);
         return answer;
     }
@@ -64,7 +68,7 @@ public final class IoUtil {
      * @return The list of WriteFuture created for each broadcasted message
      */
     public static List<WriteFuture> broadcast(Object message, Iterable<IoSession> sessions) {
-        List<WriteFuture> answer = new ArrayList<WriteFuture>();
+        List<WriteFuture> answer = new ArrayList<>();
         broadcast(message, sessions.iterator(), answer);
         return answer;
     }
@@ -79,7 +83,7 @@ public final class IoUtil {
      * @return The list of {@link WriteFuture} for the written messages
      */
     public static List<WriteFuture> broadcast(Object message, Iterator<IoSession> sessions) {
-        List<WriteFuture> answer = new ArrayList<WriteFuture>();
+        List<WriteFuture> answer = new ArrayList<>();
         broadcast(message, sessions, answer);
         return answer;
     }
@@ -98,7 +102,7 @@ public final class IoUtil {
             sessions = EMPTY_SESSIONS;
         }
 
-        List<WriteFuture> answer = new ArrayList<WriteFuture>(sessions.length);
+        List<WriteFuture> answer = new ArrayList<>(sessions.length);
         if (message instanceof IoBuffer) {
             for (IoSession s : sessions) {
                 answer.add(s.write(((IoBuffer) message).duplicate()));
@@ -125,31 +129,78 @@ public final class IoUtil {
         }
     }
 
+    /**
+     * Wait on all the {@link IoFuture}s we get, or until one of the {@link IoFuture}s is interrupted
+     *  
+     * @param futures The {@link IoFuture}s we are waiting on
+     * @throws InterruptedException If one of the {@link IoFuture} is interrupted
+     */
     public static void await(Iterable<? extends IoFuture> futures) throws InterruptedException {
         for (IoFuture f : futures) {
             f.await();
         }
     }
 
+    /**
+     * Wait on all the {@link IoFuture}s we get. This can't get interrupted.
+     *  
+     * @param futures The {@link IoFuture}s we are waiting on
+     */
     public static void awaitUninterruptably(Iterable<? extends IoFuture> futures) {
         for (IoFuture f : futures) {
             f.awaitUninterruptibly();
         }
     }
 
+    /**
+     * Wait on all the {@link IoFuture}s we get, or until one of the {@link IoFuture}s is interrupted
+     *  
+     * @param futures The {@link IoFuture}s we are waiting on 
+     * @param timeout The maximum time we wait for the {@link IoFuture}s to complete
+     * @param unit The Time unit to use for the timeout
+     * @return <tt>TRUE</TT> if all the {@link IoFuture} have been completed, <tt>FALSE</tt> if
+     * at least one {@link IoFuture} haas been interrupted
+     * @throws InterruptedException If one of the {@link IoFuture} is interrupted
+     */
     public static boolean await(Iterable<? extends IoFuture> futures, long timeout, TimeUnit unit)
             throws InterruptedException {
         return await(futures, unit.toMillis(timeout));
     }
 
+    /**
+     * Wait on all the {@link IoFuture}s we get, or until one of the {@link IoFuture}s is interrupted
+     *  
+     * @param futures The {@link IoFuture}s we are waiting on 
+     * @param timeoutMillis The maximum milliseconds we wait for the {@link IoFuture}s to complete
+     * @return <tt>TRUE</TT> if all the {@link IoFuture} have been completed, <tt>FALSE</tt> if
+     * at least one {@link IoFuture} has been interrupted
+     * @throws InterruptedException If one of the {@link IoFuture} is interrupted
+     */
     public static boolean await(Iterable<? extends IoFuture> futures, long timeoutMillis) throws InterruptedException {
         return await0(futures, timeoutMillis, true);
     }
 
+    /**
+     * Wait on all the {@link IoFuture}s we get.
+     *  
+     * @param futures The {@link IoFuture}s we are waiting on 
+     * @param timeout The maximum time we wait for the {@link IoFuture}s to complete
+     * @param unit The Time unit to use for the timeout
+     * @return <tt>TRUE</TT> if all the {@link IoFuture} have been completed, <tt>FALSE</tt> if
+     * at least one {@link IoFuture} has been interrupted
+     */
     public static boolean awaitUninterruptibly(Iterable<? extends IoFuture> futures, long timeout, TimeUnit unit) {
         return awaitUninterruptibly(futures, unit.toMillis(timeout));
     }
 
+    /**
+     * Wait on all the {@link IoFuture}s we get.
+     *  
+     * @param futures The {@link IoFuture}s we are waiting on 
+     * @param timeoutMillis The maximum milliseconds we wait for the {@link IoFuture}s to complete
+     * @return <tt>TRUE</TT> if all the {@link IoFuture} have been completed, <tt>FALSE</tt> if
+     * at least one {@link IoFuture} has been interrupted
+     */
     public static boolean awaitUninterruptibly(Iterable<? extends IoFuture> futures, long timeoutMillis) {
         try {
             return await0(futures, timeoutMillis, false);
@@ -165,8 +216,10 @@ public final class IoUtil {
 
         boolean lastComplete = true;
         Iterator<? extends IoFuture> i = futures.iterator();
+        
         while (i.hasNext()) {
             IoFuture f = i.next();
+
             do {
                 if (interruptable) {
                     lastComplete = f.await(waitTime);
@@ -176,7 +229,7 @@ public final class IoUtil {
 
                 waitTime = timeoutMillis - (System.currentTimeMillis() - startTime);
 
-                if (lastComplete || waitTime <= 0) {
+                if (waitTime <= 0) {
                     break;
                 }
             } while (!lastComplete);
@@ -188,8 +241,4 @@ public final class IoUtil {
 
         return lastComplete && !i.hasNext();
     }
-
-    private IoUtil() {
-        // Do nothing
-    }
 }

http://git-wip-us.apache.org/repos/asf/mina/blob/7c080890/mina-core/src/main/java/org/apache/mina/core/RuntimeIoException.java
----------------------------------------------------------------------
diff --git a/mina-core/src/main/java/org/apache/mina/core/RuntimeIoException.java b/mina-core/src/main/java/org/apache/mina/core/RuntimeIoException.java
index b014b24..88a4b3d 100644
--- a/mina-core/src/main/java/org/apache/mina/core/RuntimeIoException.java
+++ b/mina-core/src/main/java/org/apache/mina/core/RuntimeIoException.java
@@ -33,18 +33,37 @@ import java.io.IOException;
 public class RuntimeIoException extends RuntimeException {
     private static final long serialVersionUID = 9029092241311939548L;
 
+    /**
+     * Create a new RuntimeIoException instance
+     */
     public RuntimeIoException() {
         super();
     }
 
+    /**
+     * Create a new RuntimeIoException instance
+     * 
+     * @param message The error message
+     */
     public RuntimeIoException(String message) {
         super(message);
     }
 
+    /**
+     * Create a new RuntimeIoException instance
+     * 
+     * @param message The error message
+     * @param cause The original exception
+     */
     public RuntimeIoException(String message, Throwable cause) {
         super(message, cause);
     }
 
+    /**
+     * Create a new RuntimeIoException instance
+     * 
+     * @param cause The original exception
+     */
     public RuntimeIoException(Throwable cause) {
         super(cause);
     }

http://git-wip-us.apache.org/repos/asf/mina/blob/7c080890/mina-core/src/main/java/org/apache/mina/core/write/DefaultWriteRequest.java
----------------------------------------------------------------------
diff --git a/mina-core/src/main/java/org/apache/mina/core/write/DefaultWriteRequest.java b/mina-core/src/main/java/org/apache/mina/core/write/DefaultWriteRequest.java
index f03bbd7..1d1e5fb 100644
--- a/mina-core/src/main/java/org/apache/mina/core/write/DefaultWriteRequest.java
+++ b/mina-core/src/main/java/org/apache/mina/core/write/DefaultWriteRequest.java
@@ -37,66 +37,130 @@ public class DefaultWriteRequest implements WriteRequest {
 
     /** An empty FUTURE */
     private static final WriteFuture UNUSED_FUTURE = new WriteFuture() {
+        /**
+         * {@inheritDoc}
+         */
+        @Override
         public boolean isWritten() {
             return false;
         }
 
+        /**
+         * {@inheritDoc}
+         */
+        @Override
         public void setWritten() {
             // Do nothing
         }
 
+        /**
+         * {@inheritDoc}
+         */
+        @Override
         public IoSession getSession() {
             return null;
         }
 
+        /**
+         * {@inheritDoc}
+         */
+        @Override
         public void join() {
             // Do nothing
         }
 
+        /**
+         * {@inheritDoc}
+         */
+        @Override
         public boolean join(long timeoutInMillis) {
             return true;
         }
 
+        /**
+         * {@inheritDoc}
+         */
+        @Override
         public boolean isDone() {
             return true;
         }
 
+        /**
+         * {@inheritDoc}
+         */
+        @Override
         public WriteFuture addListener(IoFutureListener<?> listener) {
             throw new IllegalStateException("You can't add a listener to a dummy future.");
         }
 
+        /**
+         * {@inheritDoc}
+         */
+        @Override
         public WriteFuture removeListener(IoFutureListener<?> listener) {
             throw new IllegalStateException("You can't add a listener to a dummy future.");
         }
 
+        /**
+         * {@inheritDoc}
+         */
+        @Override
         public WriteFuture await() throws InterruptedException {
             return this;
         }
 
+        /**
+         * {@inheritDoc}
+         */
+        @Override
         public boolean await(long timeout, TimeUnit unit) throws InterruptedException {
             return true;
         }
 
+        /**
+         * {@inheritDoc}
+         */
+        @Override
         public boolean await(long timeoutMillis) throws InterruptedException {
             return true;
         }
 
+        /**
+         * {@inheritDoc}
+         */
+        @Override
         public WriteFuture awaitUninterruptibly() {
             return this;
         }
 
+        /**
+         * {@inheritDoc}
+         */
+        @Override
         public boolean awaitUninterruptibly(long timeout, TimeUnit unit) {
             return true;
         }
 
+        /**
+         * {@inheritDoc}
+         */
+        @Override
         public boolean awaitUninterruptibly(long timeoutMillis) {
             return true;
         }
 
+        /**
+         * {@inheritDoc}
+         */
+        @Override
         public Throwable getException() {
             return null;
         }
 
+        /**
+         * {@inheritDoc}
+         */
+        @Override
         public void setException(Throwable cause) {
             // Do nothing
         }
@@ -151,18 +215,34 @@ public class DefaultWriteRequest implements WriteRequest {
         this.destination = destination;
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
     public WriteFuture getFuture() {
         return future;
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
     public Object getMessage() {
         return message;
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
     public WriteRequest getOriginalRequest() {
         return this;
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
     public SocketAddress getDestination() {
         return destination;
     }
@@ -190,6 +270,10 @@ public class DefaultWriteRequest implements WriteRequest {
         return sb.toString();
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
     public boolean isEncoded() {
         return false;
     }

http://git-wip-us.apache.org/repos/asf/mina/blob/7c080890/mina-core/src/main/java/org/apache/mina/core/write/NothingWrittenException.java
----------------------------------------------------------------------
diff --git a/mina-core/src/main/java/org/apache/mina/core/write/NothingWrittenException.java b/mina-core/src/main/java/org/apache/mina/core/write/NothingWrittenException.java
index 66e228e..6ccf9c7 100644
--- a/mina-core/src/main/java/org/apache/mina/core/write/NothingWrittenException.java
+++ b/mina-core/src/main/java/org/apache/mina/core/write/NothingWrittenException.java
@@ -31,34 +31,82 @@ public class NothingWrittenException extends WriteException {
 
     private static final long serialVersionUID = -6331979307737691005L;
 
+    /**
+     * Create a new NothingWrittenException instance
+     * 
+     * @param requests The {@link WriteRequest}s that haven't been written
+     * @param message The error message
+     * @param cause The original exception
+     */
     public NothingWrittenException(Collection<WriteRequest> requests, String message, Throwable cause) {
         super(requests, message, cause);
     }
 
-    public NothingWrittenException(Collection<WriteRequest> requests, String s) {
-        super(requests, s);
+    /**
+     * Create a new NothingWrittenException instance
+     * 
+     * @param requests The {@link WriteRequest}s that haven't been written
+     * @param message The error message
+     */
+    public NothingWrittenException(Collection<WriteRequest> requests, String message) {
+        super(requests, message);
     }
 
+    /**
+     * Create a new NothingWrittenException instance
+     * 
+     * @param requests The {@link WriteRequest} that haven't been written
+     * @param cause The original exception
+     */
     public NothingWrittenException(Collection<WriteRequest> requests, Throwable cause) {
         super(requests, cause);
     }
 
+    /**
+     * Create a new NothingWrittenException instance
+     * 
+     * @param requests The {@link WriteRequest} that haven't been written
+     */
     public NothingWrittenException(Collection<WriteRequest> requests) {
         super(requests);
     }
 
+    /**
+     * Create a new NothingWrittenException instance
+     * 
+     * @param request The {@link WriteRequest} that hasn't been written
+     * @param message The error message
+     * @param cause The original exception
+     */
     public NothingWrittenException(WriteRequest request, String message, Throwable cause) {
         super(request, message, cause);
     }
 
-    public NothingWrittenException(WriteRequest request, String s) {
-        super(request, s);
+    /**
+     * Create a new NothingWrittenException instance
+     * 
+     * @param request The {@link WriteRequest} that hasn't been written
+     * @param message The error message
+     */
+    public NothingWrittenException(WriteRequest request, String message) {
+        super(request, message);
     }
 
+    /**
+     * Create a new NothingWrittenException instance
+     * 
+     * @param request The {@link WriteRequest} that hasn't been written
+     * @param cause The original exception
+     */
     public NothingWrittenException(WriteRequest request, Throwable cause) {
         super(request, cause);
     }
 
+    /**
+     * Create a new NothingWrittenException instance
+     * 
+     * @param request The {@link WriteRequest} that hasn't been written
+     */
     public NothingWrittenException(WriteRequest request) {
         super(request);
     }

http://git-wip-us.apache.org/repos/asf/mina/blob/7c080890/mina-core/src/main/java/org/apache/mina/core/write/WriteException.java
----------------------------------------------------------------------
diff --git a/mina-core/src/main/java/org/apache/mina/core/write/WriteException.java b/mina-core/src/main/java/org/apache/mina/core/write/WriteException.java
index 193432b..97acbb4 100644
--- a/mina-core/src/main/java/org/apache/mina/core/write/WriteException.java
+++ b/mina-core/src/main/java/org/apache/mina/core/write/WriteException.java
@@ -155,7 +155,7 @@ public class WriteException extends IOException {
         }
 
         // Create a list of requests removing duplicates.
-        Set<WriteRequest> newRequests = new MapBackedSet<WriteRequest>(new LinkedHashMap<WriteRequest, Boolean>());
+        Set<WriteRequest> newRequests = new MapBackedSet<>(new LinkedHashMap<WriteRequest, Boolean>());
         
         for (WriteRequest r : requests) {
             newRequests.add(r.getOriginalRequest());
@@ -169,7 +169,7 @@ public class WriteException extends IOException {
             throw new IllegalArgumentException("request");
         }
 
-        List<WriteRequest> requests = new ArrayList<WriteRequest>(1);
+        List<WriteRequest> requests = new ArrayList<>(1);
         requests.add(request.getOriginalRequest());
         
         return Collections.unmodifiableList(requests);

http://git-wip-us.apache.org/repos/asf/mina/blob/7c080890/mina-core/src/main/java/org/apache/mina/core/write/WriteRequestWrapper.java
----------------------------------------------------------------------
diff --git a/mina-core/src/main/java/org/apache/mina/core/write/WriteRequestWrapper.java b/mina-core/src/main/java/org/apache/mina/core/write/WriteRequestWrapper.java
index 0941d43..0abea69 100644
--- a/mina-core/src/main/java/org/apache/mina/core/write/WriteRequestWrapper.java
+++ b/mina-core/src/main/java/org/apache/mina/core/write/WriteRequestWrapper.java
@@ -47,6 +47,7 @@ public class WriteRequestWrapper implements WriteRequest {
     /**
      * {@inheritDoc}
      */
+    @Override
     public SocketAddress getDestination() {
         return parentRequest.getDestination();
     }
@@ -54,6 +55,7 @@ public class WriteRequestWrapper implements WriteRequest {
     /**
      * {@inheritDoc}
      */
+    @Override
     public WriteFuture getFuture() {
         return parentRequest.getFuture();
     }
@@ -61,6 +63,7 @@ public class WriteRequestWrapper implements WriteRequest {
     /**
      * {@inheritDoc}
      */
+    @Override
     public Object getMessage() {
         return parentRequest.getMessage();
     }
@@ -68,6 +71,7 @@ public class WriteRequestWrapper implements WriteRequest {
     /**
      * {@inheritDoc}
      */
+    @Override
     public WriteRequest getOriginalRequest() {
         return parentRequest.getOriginalRequest();
     }
@@ -90,6 +94,7 @@ public class WriteRequestWrapper implements WriteRequest {
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isEncoded() {
         return false;
     }

http://git-wip-us.apache.org/repos/asf/mina/blob/7c080890/mina-core/src/main/java/org/apache/mina/core/write/WriteTimeoutException.java
----------------------------------------------------------------------
diff --git a/mina-core/src/main/java/org/apache/mina/core/write/WriteTimeoutException.java b/mina-core/src/main/java/org/apache/mina/core/write/WriteTimeoutException.java
index 9ee214c..3fd3e60 100644
--- a/mina-core/src/main/java/org/apache/mina/core/write/WriteTimeoutException.java
+++ b/mina-core/src/main/java/org/apache/mina/core/write/WriteTimeoutException.java
@@ -32,34 +32,82 @@ import org.apache.mina.core.session.IoSessionConfig;
 public class WriteTimeoutException extends WriteException {
     private static final long serialVersionUID = 3906931157944579121L;
 
+    /**
+     * Create a new WriteTimeoutException instance
+     * 
+     * @param requests The {@link WriteRequest}s for which we have had a timeout
+     * @param message The error message
+     * @param cause The original exception
+     */
     public WriteTimeoutException(Collection<WriteRequest> requests, String message, Throwable cause) {
         super(requests, message, cause);
     }
 
-    public WriteTimeoutException(Collection<WriteRequest> requests, String s) {
-        super(requests, s);
+    /**
+     * Create a new WriteTimeoutException instance
+     * 
+     * @param requests The {@link WriteRequest}s for which we have had a timeout
+     * @param message The error message
+     */
+    public WriteTimeoutException(Collection<WriteRequest> requests, String message) {
+        super(requests, message);
     }
 
+    /**
+     * Create a new WriteTimeoutException instance
+     * 
+     * @param requests The {@link WriteRequest}s for which we have had a timeout
+     * @param cause The original exception
+     */
     public WriteTimeoutException(Collection<WriteRequest> requests, Throwable cause) {
         super(requests, cause);
     }
 
+    /**
+     * Create a new WriteTimeoutException instance
+     * 
+     * @param requests The {@link WriteRequest}s for which we have had a timeout
+     */
     public WriteTimeoutException(Collection<WriteRequest> requests) {
         super(requests);
     }
 
+    /**
+     * Create a new WriteTimeoutException instance
+     * 
+     * @param request The {@link WriteRequest} for which we have had a timeout
+     * @param message The error message
+     * @param cause The original exception
+     */
     public WriteTimeoutException(WriteRequest request, String message, Throwable cause) {
         super(request, message, cause);
     }
 
-    public WriteTimeoutException(WriteRequest request, String s) {
-        super(request, s);
+    /**
+     * Create a new WriteTimeoutException instance
+     * 
+     * @param request The {@link WriteRequest} for which we have had a timeout
+     * @param message The error message
+     */
+    public WriteTimeoutException(WriteRequest request, String message) {
+        super(request, message);
     }
 
+    /**
+     * Create a new WriteTimeoutException instance
+     * 
+     * @param request The {@link WriteRequest} for which we have had a timeout
+     * @param cause The original exception
+     */
     public WriteTimeoutException(WriteRequest request, Throwable cause) {
         super(request, cause);
     }
 
+    /**
+     * Create a new WriteTimeoutException instance
+     * 
+     * @param request The {@link WriteRequest} for which we have had a timeout
+     */
     public WriteTimeoutException(WriteRequest request) {
         super(request);
     }

http://git-wip-us.apache.org/repos/asf/mina/blob/7c080890/mina-core/src/main/java/org/apache/mina/core/write/WriteToClosedSessionException.java
----------------------------------------------------------------------
diff --git a/mina-core/src/main/java/org/apache/mina/core/write/WriteToClosedSessionException.java b/mina-core/src/main/java/org/apache/mina/core/write/WriteToClosedSessionException.java
index 620dbe0..13c240c 100644
--- a/mina-core/src/main/java/org/apache/mina/core/write/WriteToClosedSessionException.java
+++ b/mina-core/src/main/java/org/apache/mina/core/write/WriteToClosedSessionException.java
@@ -31,34 +31,83 @@ public class WriteToClosedSessionException extends WriteException {
 
     private static final long serialVersionUID = 5550204573739301393L;
 
+    /**
+     * Create a new WriteToClosedSessionException instance
+     * 
+     * @param requests The {@link WriteRequest}s which have been written on a closed session
+     * @param message The error message
+     * @param cause The original exception
+     */
     public WriteToClosedSessionException(Collection<WriteRequest> requests, String message, Throwable cause) {
         super(requests, message, cause);
     }
 
-    public WriteToClosedSessionException(Collection<WriteRequest> requests, String s) {
-        super(requests, s);
+    /**
+     * Create a new WriteToClosedSessionException instance
+     * 
+     * @param requests The {@link WriteRequest}s which have been written on a closed session
+     * @param message The error message
+     */
+    public WriteToClosedSessionException(Collection<WriteRequest> requests, String message) {
+        super(requests, message);
     }
 
+    /**
+     * Create a new WriteToClosedSessionException instance
+     * 
+     * @param requests The {@link WriteRequest}s which have been written on a closed session
+     * @param cause The original exception
+     */
     public WriteToClosedSessionException(Collection<WriteRequest> requests, Throwable cause) {
         super(requests, cause);
     }
 
+    /**
+     * Create a new WriteToClosedSessionException instance
+     * 
+     * @param requests The {@link WriteRequest}s which have been written on a closed session
+     */
     public WriteToClosedSessionException(Collection<WriteRequest> requests) {
         super(requests);
     }
 
+    /**
+     * Create a new WriteToClosedSessionException instance
+     * 
+     * @param request The {@link WriteRequest} which has been written on a closed session
+     * @param message The error message
+     * @param cause The original exception
+     */
     public WriteToClosedSessionException(WriteRequest request, String message, Throwable cause) {
         super(request, message, cause);
     }
 
-    public WriteToClosedSessionException(WriteRequest request, String s) {
-        super(request, s);
+    /**
+     * Create a new WriteToClosedSessionException instance
+     * 
+     * @param request The {@link WriteRequest} which has been written on a closed session
+     * @param message The error message
+     */
+    public WriteToClosedSessionException(WriteRequest request, String message) {
+        super(request, message);
     }
 
+    /**
+     * Create a new WriteToClosedSessionException instance
+     * 
+     * @param request The {@link WriteRequest} which has been written on a closed session
+     * @param cause The original exception
+     */
     public WriteToClosedSessionException(WriteRequest request, Throwable cause) {
         super(request, cause);
     }
 
+    /**
+     * Create a new WriteToClosedSessionException instance
+     * 
+     * @param request The {@link WriteRequest} which has been written on a closed session
+
+     */
     public WriteToClosedSessionException(WriteRequest request) {
         super(request);
     }