6417649: -interval=0 is accepted and jconsole doesn't update window content at all
authoregahlin
Wed, 21 Aug 2013 17:15:44 +0200
changeset 19581 f860aff6ed05
parent 19580 8ef7bdc1bb5a
child 19582 1cab3f8c48c7
6417649: -interval=0 is accepted and jconsole doesn't update window content at all Reviewed-by: alanb, jbachorik
jdk/src/share/classes/sun/tools/jconsole/JConsole.java
--- a/jdk/src/share/classes/sun/tools/jconsole/JConsole.java	Thu Aug 22 15:54:50 2013 -0700
+++ b/jdk/src/share/classes/sun/tools/jconsole/JConsole.java	Wed Aug 21 17:15:44 2013 +0200
@@ -858,6 +858,10 @@
                 try {
                     updateInterval = Integer.parseInt(arg.substring(10)) *
                         1000;
+                    if (updateInterval <= 0) {
+                        usage();
+                        return;
+                    }
                 } catch (NumberFormatException ex) {
                     usage();
                     return;