From 6993513f385477de24b7d27c6e88c434d4a7bf4e Mon Sep 17 00:00:00 2001 From: Emmanuel Bigeon Date: Sun, 25 Nov 2018 00:27:30 -0500 Subject: [PATCH] Improve exception mechanics. remove closure of stream. Signed-off-by: Emmanuel Bigeon --- .../java/net/bigeon/gclc/system/ForwardingRunnable.java | 9 +++++---- 1 file changed, 5 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 96fdcdb..fd417e4 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 @@ -80,17 +80,18 @@ public final class ForwardingRunnable implements Runnable { public void run() { try { readToEnd(); - is.close(); } catch (final CommandRunException e) { LOGGER.log(Level.WARNING, "Manager was closed in the meantime...", e); //$NON-NLS-1$ setError(e); - } catch (final IOException e) { - LOGGER.log(Level.WARNING, "Input stream was closed...", e); //$NON-NLS-1$ - setError(e); } } /** Read the input until its end. + *

+ * This method actually perform a loop on the input stream to read the next + * character and then print int on the screen. + *

+ * When the stream returns a negative value, it will exit its loop and return. * * @throws CommandRunException if the manager was closed while writing the * stream */