changeset 47996:1fe261257e81

8191846: jstat prints debug message when debugging is disabled Reviewed-by: ehelin, rehn
author pliden
date Mon, 27 Nov 2017 12:38:47 +0100
parents bb957f109a1f
children 37937ce6adf3
files src/jdk.jcmd/share/classes/sun/tools/jstat/ExpressionResolver.java
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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) {