ソースを参照

fix issue 1672 (inefficient logging in Node.java) (#1673)

* #1672 Logging statements should be guarded

* #1672 Fix performance penalty of logger without guard

Co-authored-by: Cédric de Launois <>
vxel 3 年 前
コミット
662c8fe0c1
1 ファイル変更2 行追加2 行削除
  1. 2 2
      jme3-core/src/main/java/com/jme3/scene/Node.java

+ 2 - 2
jme3-core/src/main/java/com/jme3/scene/Node.java

@@ -431,7 +431,7 @@ public class Node extends Spatial {
         Spatial child = children.remove(index);
         if (child != null) {
             child.setParent(null);
-            logger.log(Level.FINE, "{0}: Child removed.", this.toString());
+            logger.log(Level.FINE, "{0}: Child removed.", this);
 
             // since a child with a bound was detached;
             // our own bound will probably change.
@@ -461,7 +461,7 @@ public class Node extends Spatial {
         for (int i = children.size() - 1; i >= 0; i--) {
             detachChildAt(i);
         }
-        logger.log(Level.FINE, "{0}: All children removed.", this.toString());
+        logger.log(Level.FINE, "{0}: All children removed.", this);
     }
 
     /**