[jboss-cvs] JBossAS SVN: r88126 - projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/commands.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sun May 3 17:12:16 EDT 2009


Author: alesj
Date: 2009-05-03 17:12:16 -0400 (Sun, 03 May 2009)
New Revision: 88126

Modified:
   projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/commands/MBeanQueryExe.java
Log:
Fix -s arg.

Modified: projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/commands/MBeanQueryExe.java
===================================================================
--- projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/commands/MBeanQueryExe.java	2009-05-03 18:29:05 UTC (rev 88125)
+++ projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/commands/MBeanQueryExe.java	2009-05-03 21:12:16 UTC (rev 88126)
@@ -1,9 +1,9 @@
 package org.jboss.fresh.shell.commands;
 
-import org.jboss.fresh.io.BufferWriter;
-import org.jboss.fresh.io.PrintWriter2;
-import org.jboss.fresh.shell.AbstractExecutable;
-
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.Set;
 import javax.management.MBeanAttributeInfo;
 import javax.management.MBeanInfo;
 import javax.management.MBeanNotificationInfo;
@@ -12,11 +12,11 @@
 import javax.management.MBeanServer;
 import javax.management.MBeanServerFactory;
 import javax.management.ObjectName;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.Set;
 
+import org.jboss.fresh.io.BufferWriter;
+import org.jboss.fresh.io.PrintWriter2;
+import org.jboss.fresh.shell.AbstractExecutable;
+
 public class MBeanQueryExe extends AbstractExecutable {
 
 	private static transient org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(MBeanQueryExe.class);
@@ -50,7 +50,8 @@
 				alpha = true;
 			} else if (tmp.equals("-s")) {
 				try {
-					srv = Integer.parseInt(tmp);
+					srv = Integer.parseInt(params[i + 1]);
+               i++; // move past server ordinal
 				} catch (Exception ex) {
 					pout.println("-s should be followed by an ordinal number");
 					return;
@@ -61,7 +62,7 @@
 				info = true;
 			} else {
 				pattern = tmp;
-				break;
+				break; // this conditions order :-)
 			}
 		}
 




More information about the jboss-cvs-commits mailing list