changeset 10118:3d7eaa4dbdec

8016451: Scary messages emitted by build.tools.generatenimbus.PainterGenerator during build Reviewed-by: alexsch, anthony
author prr
date Wed, 21 May 2014 10:50:14 -0700
parents 62b09e94b2b6
children 823387e2bf42
files make/src/classes/build/tools/generatenimbus/PainterGenerator.java
diffstat 1 files changed, 15 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/make/src/classes/build/tools/generatenimbus/PainterGenerator.java	Wed May 21 16:48:04 2014 +0400
+++ b/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;