karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject svn commit: r1163928 - in /karaf/cellar/trunk: config/src/main/java/org/apache/karaf/cellar/config/shell/PropSetCommand.java shell/src/main/java/org/apache/karaf/cellar/shell/PingCommand.java
Date Thu, 01 Sep 2011 07:45:24 GMT
Author: jbonofre
Date: Thu Sep  1 07:45:24 2011
New Revision: 1163928

URL: http://svn.apache.org/viewvc?rev=1163928&view=rev
Log:
[KARAF-839] Add style enhancements for clearer code.

Modified:
    karaf/cellar/trunk/config/src/main/java/org/apache/karaf/cellar/config/shell/PropSetCommand.java
    karaf/cellar/trunk/shell/src/main/java/org/apache/karaf/cellar/shell/PingCommand.java

Modified: karaf/cellar/trunk/config/src/main/java/org/apache/karaf/cellar/config/shell/PropSetCommand.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/config/src/main/java/org/apache/karaf/cellar/config/shell/PropSetCommand.java?rev=1163928&r1=1163927&r2=1163928&view=diff
==============================================================================
--- karaf/cellar/trunk/config/src/main/java/org/apache/karaf/cellar/config/shell/PropSetCommand.java
(original)
+++ karaf/cellar/trunk/config/src/main/java/org/apache/karaf/cellar/config/shell/PropSetCommand.java
Thu Sep  1 07:45:24 2011
@@ -50,6 +50,8 @@ public class PropSetCommand extends Conf
             }
             properties.put(key, value);
             configurationTable.put(pid, properties);
+        } else {
+            System.out.println("Group " + groupName + " doesn't exist.");
         }
         return null;
     }

Modified: karaf/cellar/trunk/shell/src/main/java/org/apache/karaf/cellar/shell/PingCommand.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/shell/src/main/java/org/apache/karaf/cellar/shell/PingCommand.java?rev=1163928&r1=1163927&r2=1163928&view=diff
==============================================================================
--- karaf/cellar/trunk/shell/src/main/java/org/apache/karaf/cellar/shell/PingCommand.java
(original)
+++ karaf/cellar/trunk/shell/src/main/java/org/apache/karaf/cellar/shell/PingCommand.java
Thu Sep  1 07:45:24 2011
@@ -41,19 +41,18 @@ public class PingCommand extends Cluster
         Node node = clusterManager.findNodeById(nodeId);
         if (node == null) {
             System.out.println("Node " + nodeId + " is not found.");
+            return null;
         }
-        else {
-            System.out.println("Pinging node :" + node.getId());
-            for (int i = 1; i <= iterations; i++) {
-                Long start = System.currentTimeMillis();
-                Ping ping = new Ping(clusterManager.generateId());
-                ping.setDestination(new HashSet(Arrays.asList(node)));
-                executionContext.execute(ping);
-                Long stop = System.currentTimeMillis();
-                Long delay = stop - start;
-                System.out.println(String.format("PING %s %s %sms", i, node.getId(), delay));
-                Thread.sleep(interval);
-            }
+        System.out.println("Pinging node :" + node.getId());
+        for (int i = 1; i <= iterations; i++) {
+            Long start = System.currentTimeMillis();
+            Ping ping = new Ping(clusterManager.generateId());
+            ping.setDestination(new HashSet(Arrays.asList(node)));
+            executionContext.execute(ping);
+            Long stop = System.currentTimeMillis();
+            Long delay = stop - start;
+            System.out.println(String.format("PING %s %s %sms", i, node.getId(), delay));
+            Thread.sleep(interval);
         }
         return null;
     }



Mime
View raw message