8191846: jstat prints debug message when debugging is disabled
authorpliden
Mon, 27 Nov 2017 12:38:47 +0100
changeset 48121 1fe261257e81
parent 48120 bb957f109a1f
child 48122 37937ce6adf3
8191846: jstat prints debug message when debugging is disabled Reviewed-by: ehelin, rehn
src/jdk.jcmd/share/classes/sun/tools/jstat/ExpressionResolver.java
--- a/src/jdk.jcmd/share/classes/sun/tools/jstat/ExpressionResolver.java	Mon Nov 27 03:11:38 2017 -0800
+++ b/src/jdk.jcmd/share/classes/sun/tools/jstat/ExpressionResolver.java	Mon Nov 27 12:38:47 2017 +0100
@@ -69,8 +69,10 @@
             // look it up
             Monitor m = vm.findByName(id.getName());
             if (m == null) {
-                System.err.println("Warning: Unresolved Symbol: "
-                                   + id.getName() + " substituted NaN");
+                if (debug) {
+                    System.err.println("Warning: Unresolved Symbol: "
+                                       + id.getName() + " substituted NaN");
+                }
                 return new Literal(Double.valueOf(Double.NaN));
             }
             if (m.getVariability() == Variability.CONSTANT) {