From a2cccd5cef824bf8ba5542f55b47bec4dfcd8683 Mon Sep 17 00:00:00 2001 From: Jeroen van Erp Date: Fri, 18 Mar 2016 13:31:25 +0100 Subject: [PATCH] Added javadoc to indicate that close() should always be called on a Command, before inspecting the result(s) (Fixes #114) --- .../net/schmizz/sshj/connection/channel/direct/Session.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/net/schmizz/sshj/connection/channel/direct/Session.java b/src/main/java/net/schmizz/sshj/connection/channel/direct/Session.java index b8488be3..9c480c39 100644 --- a/src/main/java/net/schmizz/sshj/connection/channel/direct/Session.java +++ b/src/main/java/net/schmizz/sshj/connection/channel/direct/Session.java @@ -48,18 +48,24 @@ public interface Session /** * If the command exit violently {@link #getExitSignal() with a signal}, an error message would have been * received and can be retrieved via this method. Otherwise, this method will return {@code null}. + *

+ * NOTE: Always call {@link #close()} first before inspecting the exit error message. */ String getExitErrorMessage(); /** * Returns the {@link Signal signal} if the command exit violently, or {@code null} if this information was not * received. + *

+ * NOTE: Always call {@link #close()} first before inspecting the exit signal. */ Signal getExitSignal(); /** * Returns the exit status of the command if it was received, or {@code null} if this information was not * received. + *

+ * NOTE: Always call {@link #close()} first before inspecting the exit status. */ Integer getExitStatus();