added braces (#9972)

This commit is contained in:
majajoksovic 2020-09-07 04:19:12 +02:00 committed by GitHub
parent 74efd2530e
commit 8278cc272a
2 changed files with 5 additions and 3 deletions

View File

@ -32,7 +32,7 @@ public class SshdDemo {
.getSession()) { .getSession()) {
session.addPasswordIdentity(password); session.addPasswordIdentity(password);
session.auth() session.auth()
.verify(5L, TimeUnit.SECONDS); .verify(defaultTimeoutSeconds, TimeUnit.SECONDS);
try (ByteArrayOutputStream responseStream = new ByteArrayOutputStream(); try (ByteArrayOutputStream responseStream = new ByteArrayOutputStream();
ByteArrayOutputStream errorResponseStream = new ByteArrayOutputStream(); ByteArrayOutputStream errorResponseStream = new ByteArrayOutputStream();
ClientChannel channel = session.createChannel(Channel.CHANNEL_SHELL)) { ClientChannel channel = session.createChannel(Channel.CHANNEL_SHELL)) {

View File

@ -42,10 +42,12 @@ public class JschDemo {
throw new Exception(errorResponse); throw new Exception(errorResponse);
} }
} finally { } finally {
if (session != null) if (session != null) {
session.disconnect(); session.disconnect();
if (channel != null) }
if (channel != null) {
channel.disconnect(); channel.disconnect();
}
} }
return response; return response;
} }