ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [2/3] ant git commit: cosmetics
Date Tue, 29 Mar 2016 12:49:02 GMT
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/1.9.x
Commit: edeb171a781501ed906b2d2bdd38e22b3fe81e02
Parents: 851aa5f
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Tue Mar 29 14:43:06 2016 +0200
Committer: Stefan Bodewig <bodewig@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);


Mime
View raw message