]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Some minor fixes for pretty printing TG
authorjsimomaa <jani.simomaa@gmail.com>
Mon, 12 Jun 2017 09:59:48 +0000 (12:59 +0300)
committerjsimomaa <jani.simomaa@gmail.com>
Thu, 15 Jun 2017 07:06:36 +0000 (10:06 +0300)
#7276

Change-Id: I838c99e0151c68e8efc9c54189cc1c94e26f55c2

bundles/org.simantics.graph/src/org/simantics/graph/representation/PrettyPrintTG.java

index bb776d5df649eaa08ac455942e453718c9d2a721..0640f42f495ccc646f4770435ccf300bb834afef 100644 (file)
@@ -43,6 +43,8 @@ public class PrettyPrintTG {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(PrettyPrintTG.class);
     
+    private static final boolean DEBUG = false;
+    
        int blankCounter = 0;
        MessageDigest m;
 
@@ -137,8 +139,7 @@ public class PrettyPrintTG {
        }
 
        void discoverOwners(TransferableGraph1 graph, ResourceInfo info) {
-           if (LOGGER.isDebugEnabled())
-               LOGGER.debug("Discovering owners for " + info);
+           log("Discovering owners for " + info);
                int resource = info.resource;
                TIntArrayList statements = TransferableGraphUtils.getStatements(graph, resource);
                for(int i=0;i<statements.size();i+=2) {
@@ -664,4 +665,9 @@ public class PrettyPrintTG {
                }
        }
 
+    private static void log(String string) {
+        if (LOGGER.isDebugEnabled() && DEBUG)
+            LOGGER.debug(string);
+    }
+
 }