mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-10 01:35:39 +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:
parent
d8310d99c0
commit
abe2472d2f
1 changed files with 3 additions and 3 deletions
|
@ -556,7 +556,7 @@ public class JSchConnection implements IRemoteConnectionControlService, IRemoteC
|
||||||
@Override
|
@Override
|
||||||
public int getPort() {
|
public int getPort() {
|
||||||
String portStr = fRemoteConnection.getAttribute(PORT_ATTR);
|
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() {
|
public int getTimeout() {
|
||||||
String str = fRemoteConnection.getAttribute(TIMEOUT_ATTR);
|
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() {
|
public boolean isPasswordAuth() {
|
||||||
String str = fRemoteConnection.getAttribute(IS_PASSWORD_ATTR);
|
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 {
|
private void loadEnv(IProgressMonitor monitor) throws RemoteConnectionException {
|
||||||
|
|
Loading…
Add table
Reference in a new issue