Declare channel outside try/catch

No StatusRuntimeException can be thrown from this code, so it is not
necessary to include in the try block.
This commit is contained in:
Chris Beams 2020-04-26 19:38:06 +02:00
parent 0a2aac00d3
commit b7fda8de5e
No known key found for this signature in database
GPG Key ID: 3D214F8F5BC5ED73

View File

@ -115,7 +115,6 @@ public class CliMain {
exit(EXIT_FAILURE);
}
try {
var channel = ManagedChannelBuilder.forAddress(host, port).usePlaintext().build();
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
try {
@ -126,6 +125,7 @@ public class CliMain {
}
}));
try {
var credentials = new PasswordCallCredentials(password);
switch (method) {