From b9a7142c5c7a8cfbc85f9f48068bec2fa9092c01 Mon Sep 17 00:00:00 2001 From: Emmanuel Bigeon Date: Sat, 24 Nov 2018 23:37:27 -0500 Subject: [PATCH] Added comments Signed-off-by: Emmanuel Bigeon --- .../bigeon/gclc/system/ForwardingRunnable.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/gclc.system/src/main/java/net/bigeon/gclc/system/ForwardingRunnable.java b/gclc.system/src/main/java/net/bigeon/gclc/system/ForwardingRunnable.java index 595047d..96fdcdb 100644 --- a/gclc.system/src/main/java/net/bigeon/gclc/system/ForwardingRunnable.java +++ b/gclc.system/src/main/java/net/bigeon/gclc/system/ForwardingRunnable.java @@ -94,8 +94,7 @@ public final class ForwardingRunnable implements Runnable { * * @throws CommandRunException if the manager was closed while writing the * stream */ - private void readToEnd() - throws CommandRunException { + private void readToEnd() throws CommandRunException { int c; try { while ((c = is.read()) >= 0) { @@ -145,12 +144,20 @@ public final class ForwardingRunnable implements Runnable { return connect(stream, output, "Forwarding"); } - /** @return the error */ + /** Get the error in this runnable execution if any. + *

+ * In the current implementation, this error can be an {@link IOException} if + * the input stream failed or a {@link CommandRunException} if the output was + * closed. + * + * @return the error */ public synchronized Exception getError() { return error; } - /** @param error the error to set */ + /** Set the error that caused this runnable to stop executing. + * + * @param error the error to set */ private synchronized void setError(final Exception error) { this.error = error; }