You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2016/03/29 14:51:48 UTC
[2/4] ant git commit: cosmetics
cosmetics
Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/edeb171a
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/edeb171a
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/edeb171a
Branch: refs/heads/master
Commit: edeb171a781501ed906b2d2bdd38e22b3fe81e02
Parents: 851aa5f
Author: Stefan Bodewig <bo...@apache.org>
Authored: Tue Mar 29 14:43:06 2016 +0200
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Tue Mar 29 14:43:06 2016 +0200
----------------------------------------------------------------------
.../tools/ant/taskdefs/optional/ssh/SSHBase.java | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ant/blob/edeb171a/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHBase.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHBase.java b/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHBase.java
index df7996a..d6abb95 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHBase.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHBase.java
@@ -111,7 +111,9 @@ public abstract class SSHBase extends Task implements LogListener {
* @since Ant 1.9.7
*/
public void setServerAliveCountMax(final int countMax) {
- if (countMax <= 0) throw new IllegalArgumentException("ssh server alive count max setting cannot be negative or zero");
+ if (countMax <= 0) {
+ throw new BuildException("ssh server alive count max setting cannot be negative or zero");
+ }
this.serverAliveCountMax = countMax;
}
@@ -129,7 +131,9 @@ public abstract class SSHBase extends Task implements LogListener {
* @since Ant 1.9.7
*/
public void setServerAliveIntervalSeconds(final int interval) {
- if (interval < 0) throw new IllegalArgumentException("ssh server alive interval setting cannot be negative");
+ if (interval < 0) {
+ throw new BuildException("ssh server alive interval setting cannot be negative");
+ }
this.serverAliveIntervalSeconds = interval;
}
@@ -260,9 +264,9 @@ public abstract class SSHBase extends Task implements LogListener {
"publickey,keyboard-interactive,password");
session.setUserInfo(userInfo);
- if (serverAliveIntervalSeconds > 0) {
- session.setServerAliveCountMax(serverAliveCountMax);
- session.setServerAliveInterval(serverAliveIntervalSeconds * 1000);
+ if (getServerAliveIntervalSeconds() > 0) {
+ session.setServerAliveCountMax(getServerAliveCountMax());
+ session.setServerAliveInterval(getServerAliveIntervalSeconds() * 1000);
}
log("Connecting to " + host + ":" + port);