8016451: Scary messages emitted by build.tools.generatenimbus.PainterGenerator during build
authorprr
Wed, 21 May 2014 10:50:14 -0700
changeset 25097 147ac5785a84
parent 25096 6aff20f916b2
child 25098 bbff0ad63272
8016451: Scary messages emitted by build.tools.generatenimbus.PainterGenerator during build Reviewed-by: alexsch, anthony
jdk/make/src/classes/build/tools/generatenimbus/PainterGenerator.java
--- a/jdk/make/src/classes/build/tools/generatenimbus/PainterGenerator.java	Wed May 21 16:48:04 2014 +0400
+++ b/jdk/make/src/classes/build/tools/generatenimbus/PainterGenerator.java	Wed May 21 10:50:14 2014 -0700
@@ -57,6 +57,9 @@
  * @author  Jasper Potts
  */
 public class PainterGenerator {
+
+    private static final boolean debug = false;
+
     //a handful of counters, incremented whenever the associated object type is encounted.
     //These counters form the basis of the field and method suffixes.
     //These are all 1 based, because I felt like it :-)
@@ -384,16 +387,24 @@
         }
 
         if (Float.isNaN(r)) {
-            System.err.println("[Error] Encountered NaN: encode(" + x + ", " + a + ", " + b + ", " + w + ")");
+            if (debug) {
+                System.err.println("[Error] Encountered NaN: encode(" + x + ", " + a + ", " + b + ", " + w + ")");
+            }
             return 0;
         } else if (Float.isInfinite(r)) {
-            System.err.println("[Error] Encountered Infinity: encode(" + x + ", " + a + ", " + b + ", " + w + ")");
+            if (debug) {
+                System.err.println("[Error] Encountered Infinity: encode(" + x + ", " + a + ", " + b + ", " + w + ")");
+            }
             return 0;
         } else if (r < 0) {
-            System.err.println("[Error] encoded value was less than 0: encode(" + x + ", " + a + ", " + b + ", " + w + ")");
+            if (debug) {
+                System.err.println("[Error] encoded value was less than 0: encode(" + x + ", " + a + ", " + b + ", " + w + ")");
+            }
             return 0;
         } else if (r > 3) {
-            System.err.println("[Error] encoded value was greater than 3: encode(" + x + ", " + a + ", " + b + ", " + w + ")");
+            if (debug) {
+                System.err.println("[Error] encoded value was greater than 3: encode(" + x + ", " + a + ", " + b + ", " + w + ")");
+            }
             return 3;
         } else {
             return r;