1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-30 20:35:38 +02:00

Bug 461249 - Avoid exceptions when attributes are not defined.

Change-Id: I7c84e6070c9ce2572efbf74bde4453cee79c5db5
Signed-off-by: Greg Watson <g.watson@computer.org>
This commit is contained in:
Greg Watson 2015-03-05 15:52:50 -05:00
parent d8310d99c0
commit abe2472d2f

View file

@ -556,7 +556,7 @@ public class JSchConnection implements IRemoteConnectionControlService, IRemoteC
@Override
public int getPort() {
String portStr = fRemoteConnection.getAttribute(PORT_ATTR);
return portStr != null ? Integer.parseInt(portStr) : DEFAULT_PORT;
return !portStr.isEmpty() ? Integer.parseInt(portStr) : DEFAULT_PORT;
}
/*
@ -653,7 +653,7 @@ public class JSchConnection implements IRemoteConnectionControlService, IRemoteC
public int getTimeout() {
String str = fRemoteConnection.getAttribute(TIMEOUT_ATTR);
return str != null ? Integer.parseInt(str) : DEFAULT_TIMEOUT;
return !str.isEmpty() ? Integer.parseInt(str) : DEFAULT_TIMEOUT;
}
/*
@ -712,7 +712,7 @@ public class JSchConnection implements IRemoteConnectionControlService, IRemoteC
public boolean isPasswordAuth() {
String str = fRemoteConnection.getAttribute(IS_PASSWORD_ATTR);
return str != null ? Boolean.parseBoolean(str) : DEFAULT_IS_PASSWORD;
return !str.isEmpty() ? Boolean.parseBoolean(str) : DEFAULT_IS_PASSWORD;
}
private void loadEnv(IProgressMonitor monitor) throws RemoteConnectionException {