[committed] unnecessary string creation in log statements

This is wrong usage of log statements.

Even if log level is OFF, temporal strings are created.



Index: src/com/jme/scene/state/lwjgl/shader/LWJGLShaderUtil.java
===================================================================
--- src/com/jme/scene/state/lwjgl/shader/LWJGLShaderUtil.java   (revision 4291)
+++ src/com/jme/scene/state/lwjgl/shader/LWJGLShaderUtil.java   (working copy)
@@ -33,6 +33,7 @@
 package com.jme.scene.state.lwjgl.shader;
 
 import java.nio.ByteBuffer;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.lwjgl.opengl.ARBShaderObjects;
@@ -116,8 +117,10 @@
                     .glGetUniformLocationARB(programID, nameBuf);
 
             if (variable.variableID == -1) {
-                logger.severe("Shader uniform [" + variable.name
-                        + "] could not be located in shader");
+                if (logger.isLoggable(Level.SEVERE)) {
+                    logger.severe("Shader uniform [" + variable.name
+                            + "] could not be located in shader");
+                }
             }
         }
     }
@@ -216,8 +219,10 @@
                     .glGetAttribLocationARB(programID, nameBuf);
             
             if (variable.variableID == -1) {
-                logger.severe("Shader attribute [" + variable.name
-                        + "] could not be located in shader");
+                if (logger.isLoggable(Level.SEVERE)) {
+                    logger.severe("Shader attribute [" + variable.name
+                            + "] could not be located in shader");
+                }
             }
         }
     }

Then I suggest that "commit the patch first, and use shell script later".

I hope that such a good automation process would be included in the jme3.

This is in error handling (if variable.variableID == -1 you have an error) , and normally you don't have error in your code so this string creation will not happen.

But it is not right usage.

And this is not critical error.

It even happens in normal situation at ResourceLocatorTool, LWJGLTextureRenderer, LWJGLTextureState.

I added more checking code.



patch code is too long.

patch part1


Index: src/com/jmex/audio/openal/OpenALMemoryAudioPlayer.java
===================================================================
--- src/com/jmex/audio/openal/OpenALMemoryAudioPlayer.java   (revision 4291)
+++ src/com/jmex/audio/openal/OpenALMemoryAudioPlayer.java   (working copy)
@@ -32,6 +32,7 @@
 
 package com.jmex.audio.openal;
 
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.lwjgl.openal.AL10;
@@ -138,7 +139,9 @@
     protected void check() {
         int error = AL10.alGetError();
         if (error != AL10.AL_NO_ERROR) {
-            logger.info("OpenAL error was raised. errorCode=" + error);
+            if (logger.isLoggable(Level.INFO)) {
+                logger.info("OpenAL error was raised. errorCode=" + error);
+            }
         }
     }
 
Index: src/com/jmex/audio/openal/OpenALSystem.java
===================================================================
--- src/com/jmex/audio/openal/OpenALSystem.java   (revision 4291)
+++ src/com/jmex/audio/openal/OpenALSystem.java   (working copy)
@@ -95,7 +95,9 @@
         } catch (OpenALException e) {
             MAX_SOURCES = sourcePool.size();
         }
-        logger.info("max source channels: " + MAX_SOURCES);
+        if (logger.isLoggable(Level.INFO)) {
+            logger.info("max source channels: " + MAX_SOURCES);
+        }
     }
 
     @Override
@@ -210,7 +212,9 @@
     public OpenALAudioTrack createAudioTrack(String resourceStr, boolean stream) {
         URL resource = ResourceLocatorTool.locateResource(ResourceLocatorTool.TYPE_AUDIO, resourceStr);
         if (resource == null) {
-            logger.warning("Could not locate audio file: "+resourceStr);
+            if (logger.isLoggable(Level.WARNING)) {
+                logger.warning("Could not locate audio file: "+resourceStr);
+            }
             return null;
         }
         return createAudioTrack(resource, stream);
Index: src/com/jmex/audio/RangedAudioTracker.java
===================================================================
--- src/com/jmex/audio/RangedAudioTracker.java   (revision 4291)
+++ src/com/jmex/audio/RangedAudioTracker.java   (working copy)
@@ -32,6 +32,7 @@
 
 package com.jmex.audio;
 
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import com.jme.math.FastMath;
@@ -115,15 +116,18 @@
                 q.addTrack(getAudioTrack());
 
                 if (shouldPlay && !(q.isPlaying() && q.getCurrentTrack() == getAudioTrack())) {
-                    logger.info("I should start playing music: "
-                            + getAudioTrack().getResource());
+                    if (logger.isLoggable(Level.INFO)) {
+                        logger.info("I should start playing music: "
+                                + getAudioTrack().getResource());
+                    }
                     q.setCurrentTrack(getAudioTrack());
                 } else if (shouldStop) {
                     // already fading!  Probably coming in or out.  Ignore.
                     if (getAudioTrack().getTargetVolume() != getAudioTrack().getVolume()) break;
-
-                    logger.info("I should stop playing music: "
-                            + getAudioTrack().getResource());
+                    if (logger.isLoggable(Level.INFO)) {
+                        logger.info("I should stop playing music: "
+                                + getAudioTrack().getResource());
+                    }
                     if (q.getCurrentTrack() == getAudioTrack())
                         q.setCurrentTrack(-1);
                     else
Index: src/com/jme/util/stat/StatCollector.java
===================================================================
--- src/com/jme/util/stat/StatCollector.java   (revision 4291)
+++ src/com/jme/util/stat/StatCollector.java   (working copy)
@@ -41,6 +41,7 @@
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Stack;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import com.jme.util.NanoTimer;
@@ -179,7 +180,9 @@
 
             // Pop until we find our stat type
             while (!top.equals(type)) {
-                logger.warning("Mismatched endStat, found "+top+".  Expected '"+type+"'");
+                if (logger.isLoggable(Level.WARNING)) {
+                    logger.warning("Mismatched endStat, found "+top+".  Expected '"+type+"'");
+                }
                 top = timeStatStack.pop();
             }
         }
Index: src/com/jme/util/resource/ResourceLocatorTool.java
===================================================================
--- src/com/jme/util/resource/ResourceLocatorTool.java   (revision 4291)
+++ src/com/jme/util/resource/ResourceLocatorTool.java   (working copy)
@@ -83,7 +83,9 @@
                         "locateResource(String, String)", e.getMessage(), e);
             }
 
-            logger.warning("Unable to locate: "+resourceName);
+            if (logger.isLoggable(Level.WARNING)) {
+                logger.warning("Unable to locate: "+resourceName);
+            }
             return null;
         }
     }
Index: src/com/jme/renderer/lwjgl/LWJGLRenderer.java
===================================================================
--- src/com/jme/renderer/lwjgl/LWJGLRenderer.java   (revision 4291)
+++ src/com/jme/renderer/lwjgl/LWJGLRenderer.java   (working copy)
@@ -40,6 +40,7 @@
 import java.nio.FloatBuffer;
 import java.nio.IntBuffer;
 import java.util.Arrays;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.imageio.ImageIO;
@@ -186,8 +187,10 @@
         this.width = width;
         this.height = height;
 
-        logger.info( "LWJGLRenderer created. W:  " + width + "H: " + height +
-                "tVersion: " + org.lwjgl.Sys.getVersion() );
+        if (logger.isLoggable(Level.INFO)) {
+            logger.info( "LWJGLRenderer created. W:  " + width + "H: " + height +
+                    "tVersion: " + org.lwjgl.Sys.getVersion() );
+        }
 
         capabilities = GLContext.getCapabilities();
 
@@ -628,7 +631,9 @@
             throw new JmeException("Screenshot filename cannot be null");
         }
         File out = new File(filename + ".png");
-        logger.info("Taking screenshot: " + out.getAbsolutePath() );
+        if (logger.isLoggable(Level.INFO)) {
+            logger.info("Taking screenshot: " + out.getAbsolutePath() );
+        }
 
         // Create a pointer to the image info and create a buffered image to
         // hold it.
@@ -997,8 +1002,10 @@
             // cards.
             IntBuffer indices = tris.getIndexBuffer();
             if (indices == null) {
-                logger.severe("missing indices on geometry object: "
-                        + tris.toString());
+                if (logger.isLoggable(Level.SEVERE)) {
+                    logger.severe("missing indices on geometry object: "
+                            + tris.toString());
+                }
             } else {
                 indices.rewind();
                 indices.limit(tris.getMaxIndex());
Index: src/com/jme/renderer/lwjgl/LWJGLTextureRenderer.java
===================================================================
--- src/com/jme/renderer/lwjgl/LWJGLTextureRenderer.java   (revision 4291)
+++ src/com/jme/renderer/lwjgl/LWJGLTextureRenderer.java   (working copy)
@@ -147,14 +147,18 @@
             }
         }
 
-        logger.fine("Creating FBO sized: "+width+" x "+height);
+        if (logger.isLoggable(Level.FINE)) {
+            logger.fine("Creating FBO sized: "+width+" x "+height);
+        }
 
         IntBuffer buffer = BufferUtils.createIntBuffer(1);
         EXTFramebufferObject.glGenFramebuffersEXT(buffer); // generate id
         fboID = buffer.get(0);
 
         if (fboID <= 0) {
-            logger.severe("Invalid FBO id returned! " + fboID);
+            if (logger.isLoggable(Level.SEVERE)) {
+                logger.severe("Invalid FBO id returned! " + fboID);
+            }
             isSupported = false;
             return;
         }
@@ -485,8 +489,10 @@
         LWJGLTextureState.applyFilter(tex, texRecord, 0, record);
         LWJGLTextureState.applyWrap(tex, texRecord, 0, record);
 
-        logger.info("setup fbo tex with id " + tex.getTextureId() + ": " + width
-                + "," + height);
+        if (logger.isLoggable(Level.INFO)) {
+            logger.info("setup fbo tex with id " + tex.getTextureId() + ": " + width
+                    + "," + height);
+        }
     }
 
     /**
Index: src/com/jme/animation/TextureKeyframeController.java
===================================================================
--- src/com/jme/animation/TextureKeyframeController.java   (revision 4291)
+++ src/com/jme/animation/TextureKeyframeController.java   (working copy)
@@ -32,6 +32,7 @@
 package com.jme.animation;
 
 import java.io.IOException;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import com.jme.image.Texture;
@@ -83,9 +84,11 @@
    
    public void addData(float[] times, Matrix4f[] transforms, int[] interp) {
       if(times.length != transforms.length) {
-         logger.warning("Invalid texture keyframe information."
-                    + " Times and transforms are not of same length."
-                    + " [" + times.length + " != " + transforms.length);
+          if (logger.isLoggable(Level.WARNING)) {
+              logger.warning("Invalid texture keyframe information."
+                      + " Times and transforms are not of same length."
+                      + " [" + times.length + " != " + transforms.length);
+          }
          return;
       }
       
Index: src/com/jme/animation/BoneAnimation.java
===================================================================
--- src/com/jme/animation/BoneAnimation.java   (revision 4291)
+++ src/com/jme/animation/BoneAnimation.java   (working copy)
@@ -39,6 +39,7 @@
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Set;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import com.jme.scene.Controller;
@@ -281,9 +282,11 @@
         }
         if (keyframeTime != null) {
             if (frame >= keyframeTime.length + 1 || frame < 0) {
-                logger.severe(name + ": Invalid frame index (" + frame
-                        + "). Intialized to only " + "have: "
-                        + keyframeTime.length + " keyframes.");
+                if (logger.isLoggable(Level.SEVERE)) {
+                    logger.severe(name + ": Invalid frame index (" + frame
+                            + "). Intialized to only " + "have: "
+                            + keyframeTime.length + " keyframes.");
+                }
                 return;
             }
             // because we interpolate we are working towards the current frame.
@@ -708,9 +711,11 @@
      */
     public void setEndFrame(int endFrame) {
         if (endFrame >= keyframeTime.length || endFrame < 0) {
-            logger.severe("Invalid endframe index (" + endFrame
-                    + "). Intialized to only " + "have: " + keyframeTime.length
-                    + " keyframes.");
+            if (logger.isLoggable(Level.SEVERE)) {
+                logger.severe("Invalid endframe index (" + endFrame
+                        + "). Intialized to only " + "have: " + keyframeTime.length
+                        + " keyframes.");
+            }
             return;
         }
         this.endFrame = endFrame;
@@ -740,9 +745,11 @@
      */
     public void setStartFrame(int startFrame) {
         if (startFrame >= keyframeTime.length || startFrame < 0) {
-            logger.severe("Invalid endframe index (" + startFrame
-                    + "). Intialized to only " + "have: " + keyframeTime.length
-                    + " keyframes.");
+            if (logger.isLoggable(Level.SEVERE)) {
+                logger.severe("Invalid endframe index (" + startFrame
+                        + "). Intialized to only " + "have: " + keyframeTime.length
+                        + " keyframes.");
+            }
             return;
         }
         this.startFrame = startFrame;
@@ -1051,9 +1058,11 @@
                 }
             }        
             if (iType != BoneAnimation.LINEAR) {
-                logger.warning("Unsupported interpolation type specified for "
-                        + "at " + "least one frame: " + iType
-                        + ".  Continuing with specified type.");
+                if (logger.isLoggable(Level.WARNING)) {
+                    logger.warning("Unsupported interpolation type specified for "
+                            + "at " + "least one frame: " + iType
+                            + ".  Continuing with specified type.");
+                }
             }
         }
     }

patch part2


Index: src/com/jme/animation/SpatialTransformer.java
===================================================================
--- src/com/jme/animation/SpatialTransformer.java   (revision 4291)
+++ src/com/jme/animation/SpatialTransformer.java   (working copy)
@@ -36,6 +36,7 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.BitSet;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import com.jme.math.Quaternion;
@@ -215,13 +216,17 @@
         if (newBeginTime < 0
                 || newBeginTime > keyframes
                         .get(keyframes.size() - 1).time) {
-            logger.warning("Attempt to set invalid begintime:" + newBeginTime);
+            if (logger.isLoggable(Level.WARNING)) {
+                logger.warning("Attempt to set invalid begintime:" + newBeginTime);
+            }
             return;
         }
         if (newEndTime < 0
                 || newEndTime > keyframes
                         .get(keyframes.size() - 1).time) {
-            logger.warning("Attempt to set invalid endtime:" + newEndTime);
+            if (logger.isLoggable(Level.WARNING)) {
+                logger.warning("Attempt to set invalid endtime:" + newEndTime);
+            }
             return;
         }
         setMinTime(newBeginTime);
Index: src/com/jme/input/InputHandler.java
===================================================================
--- src/com/jme/input/InputHandler.java   (revision 4291)
+++ src/com/jme/input/InputHandler.java   (working copy)
@@ -39,6 +39,7 @@
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import com.jme.input.action.InputAction;
@@ -272,8 +273,10 @@
             if ( device != null ) {
                 InputHandlerDevice oldDevice = devicesMap.put( device.getName(), device );
                 if ( oldDevice != null && oldDevice != device ) {
-                    logger.warning("InputHandlerDevice name '" + device.getName()
-                            + "' used twice!");
+                    if (logger.isLoggable(Level.WARNING)) {
+                        logger.warning("InputHandlerDevice name '" + device.getName()
+                                + "' used twice!");
+                    }
                 }
             }
         }
Index: src/com/jme/input/lwjgl/LWJGLMouseInput.java
===================================================================
--- src/com/jme/input/lwjgl/LWJGLMouseInput.java   (revision 4291)
+++ src/com/jme/input/lwjgl/LWJGLMouseInput.java   (working copy)
@@ -76,7 +76,9 @@
         } catch (URISyntaxException e) {
             // Fall back to using the externalized URL, this will be fine if client
             // code uses the same URL each time but issue a warning anyway.
-            logger.log(Level.WARNING, "URL does not comply with RFC2396 - " + url, e);
+            if (logger.isLoggable(Level.WARNING)) {
+                logger.log(Level.WARNING, "URL does not comply with RFC2396 - " + url, e);
+            }
             return url.toExternalForm();
         }
     }
Index: src/com/jme/scene/state/lwjgl/shader/LWJGLShaderUtil.java
===================================================================
--- src/com/jme/scene/state/lwjgl/shader/LWJGLShaderUtil.java   (revision 4291)
+++ src/com/jme/scene/state/lwjgl/shader/LWJGLShaderUtil.java   (working copy)
@@ -33,6 +33,7 @@
 package com.jme.scene.state.lwjgl.shader;
 
 import java.nio.ByteBuffer;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.lwjgl.opengl.ARBShaderObjects;
@@ -116,8 +117,10 @@
                     .glGetUniformLocationARB(programID, nameBuf);
 
             if (variable.variableID == -1) {
-                logger.severe("Shader uniform [" + variable.name
-                        + "] could not be located in shader");
+                if (logger.isLoggable(Level.SEVERE)) {
+                    logger.severe("Shader uniform [" + variable.name
+                            + "] could not be located in shader");
+                }
             }
         }
     }
@@ -216,8 +219,10 @@
                     .glGetAttribLocationARB(programID, nameBuf);
            
             if (variable.variableID == -1) {
-                logger.severe("Shader attribute [" + variable.name
-                        + "] could not be located in shader");
+                if (logger.isLoggable(Level.SEVERE)) {
+                    logger.severe("Shader attribute [" + variable.name
+                            + "] could not be located in shader");
+                }
             }
         }
     }
Index: src/com/jme/scene/state/lwjgl/LWJGLTextureState.java
===================================================================
--- src/com/jme/scene/state/lwjgl/LWJGLTextureState.java   (revision 4291)
+++ src/com/jme/scene/state/lwjgl/LWJGLTextureState.java   (working copy)
@@ -37,6 +37,7 @@
 import java.nio.IntBuffer;
 import java.util.ArrayList;
 import java.util.Stack;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.lwjgl.opengl.ARBDepthTexture;
@@ -331,9 +332,11 @@
             if (!supportsNonPowerTwo
                     && (!FastMath.isPowerOfTwo(image.getWidth()) || !FastMath
                             .isPowerOfTwo(image.getHeight()))) {
-                logger
-                        .warning("(card unsupported) Attempted to apply texture with size that is not power of 2: "
-                                + image.getWidth() + " x " + image.getHeight());
+                if (logger.isLoggable(Level.WARNING)) {
+                    logger
+                    .warning("(card unsupported) Attempted to apply texture with size that is not power of 2: "
+                            + image.getWidth() + " x " + image.getHeight());
+                }
 
                 final int maxSize = LWJGLMipMap
                         .glGetIntegerv(GL11.GL_MAX_TEXTURE_SIZE);
@@ -349,7 +352,9 @@
                 if (h > maxSize) {
                     h = maxSize;
                 }
-                logger.warning("Rescaling image to " + w + " x " + h + " !!!");
+                if (logger.isLoggable(Level.WARNING)) {
+                    logger.warning("Rescaling image to " + w + " x " + h + " !!!");
+                }
 
                 // must rescale image to get "top" mipmap texture image
                 int format = TextureStateRecord.getGLPixelFormat(image
Index: src/com/jme/scene/Geometry.java
===================================================================
--- src/com/jme/scene/Geometry.java   (revision 4291)
+++ src/com/jme/scene/Geometry.java   (working copy)
@@ -37,6 +37,7 @@
 import java.nio.FloatBuffer;
 import java.util.ArrayList;
 import java.util.Stack;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import com.jme.bounding.BoundingVolume;
@@ -725,8 +726,10 @@
         if (texBuf != null && texBuf.size() > max) {
             for (int i = max; i < texBuf.size(); i++) {
                 if (texBuf.get(i) != null) {
-                    logger.warning("Texture coordinates set for unit " + i
-                            + ". Only " + max + " units are available.");
+                    if (logger.isLoggable(Level.WARNING)) {
+                        logger.warning("Texture coordinates set for unit " + i
+                                + ". Only " + max + " units are available.");
+                    }
                 }
             }
         }
Index: src/com/jme/image/util/DDSLoader.java
===================================================================
--- src/com/jme/image/util/DDSLoader.java   (revision 4291)
+++ src/com/jme/image/util/DDSLoader.java   (working copy)
@@ -42,6 +42,7 @@
 import com.jme.util.LittleEndien;
 import com.jme.util.geom.BufferUtils;
 import java.util.ArrayList;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 /**
@@ -175,7 +176,9 @@
                 } else if (mipMapCount_ != expectedMipmaps) {
                     // changed to warning- images often do not have the required amount,
                     // or specify that they have mipmaps but include only the top level..
-                    logger.warning("Got " + mipMapCount_ + "mipmaps, expected" + expectedMipmaps);
+                    if (logger.isLoggable(Level.WARNING)) {
+                        logger.warning("Got " + mipMapCount_ + "mipmaps, expected" + expectedMipmaps);
+                    }
                 }
             } else {
                 mipMapCount_ = 1;
@@ -229,7 +232,9 @@
                         logger.warning("Must use linear size with fourcc");
                         pitchOrSize_ = size;
                     } else if (pitchOrSize_ != size) {
-                        logger.warning("Expected size = " + size + ", real = " + pitchOrSize_);
+                        if (logger.isLoggable(Level.WARNING)) {
+                            logger.warning("Expected size = " + size + ", real = " + pitchOrSize_);
+                        }
                 }
             } else {
                     pitchOrSize_ = size;
@@ -281,7 +286,9 @@
                         logger.warning("Linear size said to contain valid value but does not");
                         pitchOrSize_ = size;
                     } else if (pitchOrSize_ != size) {
-                        logger.warning("Expected size = " + size + ", real = " + pitchOrSize_);
+                        if (logger.isLoggable(Level.WARNING)) {
+                            logger.warning("Expected size = " + size + ", real = " + pitchOrSize_);
+                        }
                     }
                 } else {
                     pitchOrSize_ = size;
Index: src/com/jme/system/lwjgl/LWJGLDisplaySystem.java
===================================================================
--- src/com/jme/system/lwjgl/LWJGLDisplaySystem.java   (revision 4291)
+++ src/com/jme/system/lwjgl/LWJGLDisplaySystem.java   (working copy)
@@ -360,21 +360,29 @@
         int match_freq = -1;
         for (int i = 0; i < modes.length; i++) {
             if (modes[i].getWidth() != width) {
-                logger.fine("DisplayMode " + modes[i] + ": Width != " + width);
+                if (logger.isLoggable(Level.FINE)) {
+                    logger.fine("DisplayMode " + modes[i] + ": Width != " + width);
+                }
                 continue;
             }
             if (modes[i].getHeight() != height) {
-                logger.fine("DisplayMode " + modes[i] + ": Height != "
-                                + height);
+                if (logger.isLoggable(Level.FINE)) {
+                    logger.fine("DisplayMode " + modes[i] + ": Height != "
+                            + height);
+                }
                 continue;
             }
             if (bpp != 0 && modes[i].getBitsPerPixel() != bpp) { // should pick based on best match here too
-                logger.fine("DisplayMode " + modes[i] + ": Bits per pixel != "
-                        + bpp);
+                if (logger.isLoggable(Level.FINE)) {
+                    logger.fine("DisplayMode " + modes[i] + ": Bits per pixel != "
+                            + bpp);
+                }
                 continue;
             }
             if (best_match == -1) {
-                logger.fine("DisplayMode " + modes[i] + ": Match! ");
+                if (logger.isLoggable(Level.FINE)) {
+                    logger.fine("DisplayMode " + modes[i] + ": Match! ");
+                }
                 best_match = i;
                 match_freq = modes[i].getFrequency();
             } else {
@@ -383,7 +391,9 @@
                     ( cur_freq == freq ||        // Current is perfect match
                       match_freq < cur_freq ) )  //      or is higher freq
                 {
-                    logger.fine("DisplayMode " + modes[i] + ": Better match!");
+                    if (logger.isLoggable(Level.FINE)) {
+                        logger.fine("DisplayMode " + modes[i] + ": Better match!");
+                    }
                     best_match = i;
                     match_freq = cur_freq;
                 }
@@ -393,7 +403,9 @@
         if (best_match == -1)
             return null; // none found;
         else {
-            logger.info("Selected DisplayMode: " + modes[best_match]);
+            if (logger.isLoggable(Level.INFO)) {
+                logger.info("Selected DisplayMode: " + modes[best_match]);
+            }
             return modes[best_match];
         }
     }

pro: less string creation when logging is not needed.

con: more code bloat



There wont be a noticeable gain, but it wont hurt either i guess.

Core-Dump said:

con: more code bloat

It's just a few lines.  :)
And while making patch, I found this kind of codes are already there in some core classes.
I think it doesn't do no harm.
Thanks for the attention. XD

Why not replacing:


logger.warning("Attempt to set invalid begintime:" + newBeginTime);



with:

logger.log(Level.WARNING, "Attempt to set invalid begintime: {0}", newBeginTime);



Then you are not doing string concatenation unless accessed and it keeps out a bunch of if clauses?  I use this in my own code and it makes quite a performance impact if done frequently.

I like that idea better than the if statements.

How do you handle multiple arguments then, with a new object array?


String one = "one";
String two = "two";
Logger.getLogger(getClass().getName()).log(Level.SEVERE, "test {0} {1}", new Object[]{one,two});



Too bad that there is no vargs method, that way you have to always create a Object Array.
On the other hand, a vargs method probably creates a array anyway internally :)
Core-Dump said:

I like that idea better than the if statements.
How do you handle multiple arguments then, with a new object array?


String one = "one";
String two = "two";
Logger.getLogger(getClass().getName()).log(Level.SEVERE, "test {0} {1}", new Object[]{one,two});


...


Strings are Objects:


Logger.getLogger(getClass().getName()).log(Level.SEVERE, "test {0} {1}", new String[]{"one", "two"});



Hopefully, the logger would be instantiated ahead-of-time, making this more succinct.  Could use "Object[]" instead of "String[]", but in cases where the values are derived, it could be useful to have the compiler validate your expected element types, like "new Float[] { Float.valueOf(3 * 4.2)...}" or expressions generating Strings...  even more important if you rely on auto-boxing.

i know, what i mean is, it seems a bit unnecessary to create a object array.

if we take this example:

old:

 logger.warning("(card unsupported) Attempted to apply texture with size that is not power of 2: " + image.getWidth() + " x " + image.getHeight());



new:

 
logger.log(Level.WARNING, "(card unsupported) Attempted to apply texture with size that is not power of 2: {0} x {1}",
  new Object[]{image.getWidth(), image.getHeight()});



Now we have 2 String concatenation less, but we create a new unneeded object array just to pass the arguments.

I’d say it’s a necessary evil.

I'm sorry, I misspoke, it should be logp instead of log and it does have varargs. :slight_smile:

darkfrog said:

I'm sorry, I misspoke, it should be logp instead of log and it *does* have varargs. :)


Excellent.

alright. Then I'll revise and patch later.

patch without 'if' statement


Index: src/com/jmex/audio/openal/OpenALMemoryAudioPlayer.java
===================================================================
--- src/com/jmex/audio/openal/OpenALMemoryAudioPlayer.java   (revision 4291)
+++ src/com/jmex/audio/openal/OpenALMemoryAudioPlayer.java   (working copy)
@@ -32,6 +32,7 @@
 
 package com.jmex.audio.openal;
 
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.lwjgl.openal.AL10;
@@ -138,7 +139,7 @@
     protected void check() {
         int error = AL10.alGetError();
         if (error != AL10.AL_NO_ERROR) {
-            logger.info("OpenAL error was raised. errorCode=" + error);
+            logger.log(Level.INFO, "OpenAL error was raised. errorCode={0}", error);
         }
     }
 
Index: src/com/jmex/audio/openal/OpenALSystem.java
===================================================================
--- src/com/jmex/audio/openal/OpenALSystem.java   (revision 4291)
+++ src/com/jmex/audio/openal/OpenALSystem.java   (working copy)
@@ -95,7 +95,7 @@
         } catch (OpenALException e) {
             MAX_SOURCES = sourcePool.size();
         }
-        logger.info("max source channels: " + MAX_SOURCES);
+        logger.log(Level.INFO, "max source channels: {0}", MAX_SOURCES);
     }
 
     @Override
@@ -210,7 +210,7 @@
     public OpenALAudioTrack createAudioTrack(String resourceStr, boolean stream) {
         URL resource = ResourceLocatorTool.locateResource(ResourceLocatorTool.TYPE_AUDIO, resourceStr);
         if (resource == null) {
-            logger.warning("Could not locate audio file: "+resourceStr);
+            logger.log(Level.WARNING, "Could not locate audio file: {0}", resourceStr);
             return null;
         }
         return createAudioTrack(resource, stream);
Index: src/com/jmex/audio/RangedAudioTracker.java
===================================================================
--- src/com/jmex/audio/RangedAudioTracker.java   (revision 4291)
+++ src/com/jmex/audio/RangedAudioTracker.java   (working copy)
@@ -32,6 +32,7 @@
 
 package com.jmex.audio;
 
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import com.jme.math.FastMath;
@@ -115,15 +116,15 @@
                 q.addTrack(getAudioTrack());
 
                 if (shouldPlay && !(q.isPlaying() && q.getCurrentTrack() == getAudioTrack())) {
-                    logger.info("I should start playing music: "
-                            + getAudioTrack().getResource());
+                    logger.log(Level.INFO, "I should start playing music: {0}",
+                             getAudioTrack().getResource());
                     q.setCurrentTrack(getAudioTrack());
                 } else if (shouldStop) {
                     // already fading!  Probably coming in or out.  Ignore.
                     if (getAudioTrack().getTargetVolume() != getAudioTrack().getVolume()) break;
 
-                    logger.info("I should stop playing music: "
-                            + getAudioTrack().getResource());
+                    logger.log(Level.INFO, "I should stop playing music: {0}",
+                            getAudioTrack().getResource());
                     if (q.getCurrentTrack() == getAudioTrack())
                         q.setCurrentTrack(-1);
                     else
Index: src/com/jme/renderer/lwjgl/LWJGLRenderer.java
===================================================================
--- src/com/jme/renderer/lwjgl/LWJGLRenderer.java   (revision 4291)
+++ src/com/jme/renderer/lwjgl/LWJGLRenderer.java   (working copy)
@@ -40,6 +40,7 @@
 import java.nio.FloatBuffer;
 import java.nio.IntBuffer;
 import java.util.Arrays;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.imageio.ImageIO;
@@ -186,8 +187,8 @@
         this.width = width;
         this.height = height;
 
-        logger.info( "LWJGLRenderer created. W:  " + width + "H: " + height +
-                "tVersion: " + org.lwjgl.Sys.getVersion() );
+        logger.log(Level.INFO, "LWJGLRenderer created. W: {0} H: {1}tVersion: {2}"
+                , new Object[] {width, height, org.lwjgl.Sys.getVersion()} );
 
         capabilities = GLContext.getCapabilities();
 
@@ -628,7 +629,7 @@
             throw new JmeException("Screenshot filename cannot be null");
         }
         File out = new File(filename + ".png");
-        logger.info("Taking screenshot: " + out.getAbsolutePath() );
+        logger.log(Level.INFO, "Taking screenshot: {0}", out.getAbsolutePath());
 
         // Create a pointer to the image info and create a buffered image to
         // hold it.
@@ -997,8 +998,8 @@
             // cards.
             IntBuffer indices = tris.getIndexBuffer();
             if (indices == null) {
-                logger.severe("missing indices on geometry object: "
-                        + tris.toString());
+                logger.log(Level.SEVERE, "missing indices on geometry object: {0}",
+                 tris.toString());
             } else {
                 indices.rewind();
                 indices.limit(tris.getMaxIndex());
Index: src/com/jme/renderer/lwjgl/LWJGLTextureRenderer.java
===================================================================
--- src/com/jme/renderer/lwjgl/LWJGLTextureRenderer.java   (revision 4291)
+++ src/com/jme/renderer/lwjgl/LWJGLTextureRenderer.java   (working copy)
@@ -147,14 +147,14 @@
             }
         }
 
-        logger.fine("Creating FBO sized: "+width+" x "+height);
+        logger.log(Level.FINE, "Creating FBO sized: {0} x {1}", new Integer[] {width, height});
 
         IntBuffer buffer = BufferUtils.createIntBuffer(1);
         EXTFramebufferObject.glGenFramebuffersEXT(buffer); // generate id
         fboID = buffer.get(0);
 
         if (fboID <= 0) {
-            logger.severe("Invalid FBO id returned! " + fboID);
+            logger.log(Level.SEVERE, "Invalid FBO id returned! {0}", fboID);
             isSupported = false;
             return;
         }
@@ -485,8 +485,8 @@
         LWJGLTextureState.applyFilter(tex, texRecord, 0, record);
         LWJGLTextureState.applyWrap(tex, texRecord, 0, record);
 
-        logger.info("setup fbo tex with id " + tex.getTextureId() + ": " + width
-                + "," + height);
+        logger.log(Level.INFO, "setup fbo tex with id {0}: {1},{2}",
+           new Integer[] {tex.getTextureId(), width, height});
     }
 
     /**
Index: src/com/jme/util/stat/StatCollector.java
===================================================================
--- src/com/jme/util/stat/StatCollector.java   (revision 4291)
+++ src/com/jme/util/stat/StatCollector.java   (working copy)
@@ -41,6 +41,7 @@
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Stack;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import com.jme.util.NanoTimer;
@@ -179,7 +180,7 @@
 
             // Pop until we find our stat type
             while (!top.equals(type)) {
-                logger.warning("Mismatched endStat, found "+top+".  Expected '"+type+"'");
+                logger.log(Level.WARNING, "Mismatched endStat, found {0}.  Expected '{1}'", new StatType[] {top, type});
                 top = timeStatStack.pop();
             }
         }
Index: src/com/jme/util/resource/ResourceLocatorTool.java
===================================================================
--- src/com/jme/util/resource/ResourceLocatorTool.java   (revision 4291)
+++ src/com/jme/util/resource/ResourceLocatorTool.java   (working copy)
@@ -83,7 +83,7 @@
                         "locateResource(String, String)", e.getMessage(), e);
             }
 
-            logger.warning("Unable to locate: "+resourceName);
+            logger.log(Level.WARNING, "Unable to locate: {0}", resourceName);
             return null;
         }
     }
Index: src/com/jme/animation/TextureKeyframeController.java
===================================================================
--- src/com/jme/animation/TextureKeyframeController.java   (revision 4291)
+++ src/com/jme/animation/TextureKeyframeController.java   (working copy)
@@ -32,6 +32,7 @@
 package com.jme.animation;
 
 import java.io.IOException;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import com.jme.image.Texture;
@@ -83,9 +84,9 @@
    
    public void addData(float[] times, Matrix4f[] transforms, int[] interp) {
       if(times.length != transforms.length) {
-         logger.warning("Invalid texture keyframe information."
+         logger.log(Level.WARNING, "Invalid texture keyframe information."
                     + " Times and transforms are not of same length."
-                    + " [" + times.length + " != " + transforms.length);
+                    + " [{0} != {1}", new Integer[] {times.length, transforms.length});
          return;
       }
       
Index: src/com/jme/animation/BoneAnimation.java
===================================================================
--- src/com/jme/animation/BoneAnimation.java   (revision 4291)
+++ src/com/jme/animation/BoneAnimation.java   (working copy)
@@ -39,6 +39,7 @@
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Set;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import com.jme.scene.Controller;
@@ -281,9 +282,9 @@
         }
         if (keyframeTime != null) {
             if (frame >= keyframeTime.length + 1 || frame < 0) {
-                logger.severe(name + ": Invalid frame index (" + frame
-                        + "). Intialized to only " + "have: "
-                        + keyframeTime.length + " keyframes.");
+                logger.log(Level.SEVERE, "{0}: Invalid frame index ({1}). "
+                        + "Intialized to only " + "have: {2}  keyframes."
+                        , new Object[] {name, frame, keyframeTime.length});
                 return;
             }
             // because we interpolate we are working towards the current frame.
@@ -708,9 +709,9 @@
      */
     public void setEndFrame(int endFrame) {
         if (endFrame >= keyframeTime.length || endFrame < 0) {
-            logger.severe("Invalid endframe index (" + endFrame
-                    + "). Intialized to only " + "have: " + keyframeTime.length
-                    + " keyframes.");
+            logger.log(Level.SEVERE, "Invalid endframe index ({0}"  
+                    + "). Intialized to only " + "have: {1}"  
+                    + " keyframes.", new Integer[]{endFrame,keyframeTime.length} );
             return;
         }
         this.endFrame = endFrame;
@@ -740,9 +741,9 @@
      */
     public void setStartFrame(int startFrame) {
         if (startFrame >= keyframeTime.length || startFrame < 0) {
-            logger.severe("Invalid endframe index (" + startFrame
-                    + "). Intialized to only " + "have: " + keyframeTime.length
-                    + " keyframes.");
+            logger.log(Level.SEVERE, "Invalid endframe index ({0}"
+                    + "). Intialized to only " + "have: {1}"
+                    + " keyframes.", new Integer[]{startFrame, keyframeTime.length});
             return;
         }
         this.startFrame = startFrame;
@@ -1051,9 +1052,8 @@
                 }
             }        
             if (iType != BoneAnimation.LINEAR) {
-                logger.warning("Unsupported interpolation type specified for "
-                        + "at " + "least one frame: " + iType
-                        + ".  Continuing with specified type.");
+                logger.log(Level.WARNING, "Unsupported interpolation type specified for "
+                        + "at least one frame: {0}. Continuing with specified type.", iType);
             }
         }
     }

continued


Index: src/com/jme/animation/SpatialTransformer.java
===================================================================
--- src/com/jme/animation/SpatialTransformer.java   (revision 4291)
+++ src/com/jme/animation/SpatialTransformer.java   (working copy)
@@ -36,6 +36,7 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.BitSet;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import com.jme.math.Quaternion;
@@ -215,13 +216,13 @@
         if (newBeginTime < 0
                 || newBeginTime > keyframes
                         .get(keyframes.size() - 1).time) {
-            logger.warning("Attempt to set invalid begintime:" + newBeginTime);
+            logger.log(Level.WARNING, "Attempt to set invalid begintime:{0}", newBeginTime);
             return;
         }
         if (newEndTime < 0
                 || newEndTime > keyframes
                         .get(keyframes.size() - 1).time) {
-            logger.warning("Attempt to set invalid endtime:" + newEndTime);
+            logger.log(Level.WARNING, "Attempt to set invalid endtime:{0}", newEndTime);
             return;
         }
         setMinTime(newBeginTime);
Index: src/com/jme/input/InputHandler.java
===================================================================
--- src/com/jme/input/InputHandler.java   (revision 4291)
+++ src/com/jme/input/InputHandler.java   (working copy)
@@ -39,6 +39,7 @@
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import com.jme.input.action.InputAction;
@@ -272,8 +273,7 @@
             if ( device != null ) {
                 InputHandlerDevice oldDevice = devicesMap.put( device.getName(), device );
                 if ( oldDevice != null && oldDevice != device ) {
-                    logger.warning("InputHandlerDevice name '" + device.getName()
-                            + "' used twice!");
+                    logger.log(Level.WARNING, "InputHandlerDevice name '{0}' used twice!", device.getName());
                 }
             }
         }
Index: src/com/jme/scene/state/lwjgl/shader/LWJGLShaderUtil.java
===================================================================
--- src/com/jme/scene/state/lwjgl/shader/LWJGLShaderUtil.java   (revision 4291)
+++ src/com/jme/scene/state/lwjgl/shader/LWJGLShaderUtil.java   (working copy)
@@ -33,6 +33,7 @@
 package com.jme.scene.state.lwjgl.shader;
 
 import java.nio.ByteBuffer;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.lwjgl.opengl.ARBShaderObjects;
@@ -116,8 +117,8 @@
                     .glGetUniformLocationARB(programID, nameBuf);
 
             if (variable.variableID == -1) {
-                logger.severe("Shader uniform [" + variable.name
-                        + "] could not be located in shader");
+                logger.log(Level.SEVERE, "Shader uniform [{0}]"
+                        + " could not be located in shader", variable.name);
             }
         }
     }
@@ -216,8 +217,8 @@
                     .glGetAttribLocationARB(programID, nameBuf);
            
             if (variable.variableID == -1) {
-                logger.severe("Shader attribute [" + variable.name
-                        + "] could not be located in shader");
+                logger.log(Level.SEVERE, "Shader attribute [{0}]"
+                        + " could not be located in shader", variable.name);
             }
         }
     }
Index: src/com/jme/scene/state/lwjgl/LWJGLTextureState.java
===================================================================
--- src/com/jme/scene/state/lwjgl/LWJGLTextureState.java   (revision 4291)
+++ src/com/jme/scene/state/lwjgl/LWJGLTextureState.java   (working copy)
@@ -37,6 +37,7 @@
 import java.nio.IntBuffer;
 import java.util.ArrayList;
 import java.util.Stack;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.lwjgl.opengl.ARBDepthTexture;
@@ -331,9 +332,8 @@
             if (!supportsNonPowerTwo
                     && (!FastMath.isPowerOfTwo(image.getWidth()) || !FastMath
                             .isPowerOfTwo(image.getHeight()))) {
-                logger
-                        .warning("(card unsupported) Attempted to apply texture with size that is not power of 2: "
-                                + image.getWidth() + " x " + image.getHeight());
+                logger.log(Level.WARNING, "(card unsupported) Attempted to apply texture with size that is not power of 2: "
+                                + "{0}x{1}", new Integer[] {image.getWidth(), image.getHeight()});
 
                 final int maxSize = LWJGLMipMap
                         .glGetIntegerv(GL11.GL_MAX_TEXTURE_SIZE);
@@ -349,7 +349,7 @@
                 if (h > maxSize) {
                     h = maxSize;
                 }
-                logger.warning("Rescaling image to " + w + " x " + h + " !!!");
+                logger.log(Level.WARNING, "Rescaling image to {0} x {1} !!!", new Integer[]{w, h});
 
                 // must rescale image to get "top" mipmap texture image
                 int format = TextureStateRecord.getGLPixelFormat(image
Index: src/com/jme/scene/Geometry.java
===================================================================
--- src/com/jme/scene/Geometry.java   (revision 4291)
+++ src/com/jme/scene/Geometry.java   (working copy)
@@ -37,6 +37,7 @@
 import java.nio.FloatBuffer;
 import java.util.ArrayList;
 import java.util.Stack;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import com.jme.bounding.BoundingVolume;
@@ -725,8 +726,8 @@
         if (texBuf != null && texBuf.size() > max) {
             for (int i = max; i < texBuf.size(); i++) {
                 if (texBuf.get(i) != null) {
-                    logger.warning("Texture coordinates set for unit " + i
-                            + ". Only " + max + " units are available.");
+                    logger.log(Level.WARNING, "Texture coordinates set for unit {0}."
+                            + " Only {1} units are available.", new Integer[]{i, max});
                 }
             }
         }
Index: src/com/jme/image/util/DDSLoader.java
===================================================================
--- src/com/jme/image/util/DDSLoader.java   (revision 4291)
+++ src/com/jme/image/util/DDSLoader.java   (working copy)
@@ -42,6 +42,7 @@
 import com.jme.util.LittleEndien;
 import com.jme.util.geom.BufferUtils;
 import java.util.ArrayList;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 /**
@@ -175,7 +176,7 @@
                 } else if (mipMapCount_ != expectedMipmaps) {
                     // changed to warning- images often do not have the required amount,
                     // or specify that they have mipmaps but include only the top level..
-                    logger.warning("Got " + mipMapCount_ + "mipmaps, expected" + expectedMipmaps);
+                    logger.log(Level.WARNING, "Got {0} mipmaps, expected {1}", new Integer[]{ mipMapCount_, expectedMipmaps});
                 }
             } else {
                 mipMapCount_ = 1;
@@ -229,7 +230,7 @@
                         logger.warning("Must use linear size with fourcc");
                         pitchOrSize_ = size;
                     } else if (pitchOrSize_ != size) {
-                        logger.warning("Expected size = " + size + ", real = " + pitchOrSize_);
+                        logger.log(Level.WARNING, "Expected size = {0}, real = {1}", new Integer[] {size, pitchOrSize_});
                 }
             } else {
                     pitchOrSize_ = size;
@@ -281,7 +282,7 @@
                         logger.warning("Linear size said to contain valid value but does not");
                         pitchOrSize_ = size;
                     } else if (pitchOrSize_ != size) {
-                        logger.warning("Expected size = " + size + ", real = " + pitchOrSize_);
+                        logger.log(Level.WARNING, "Expected size = {0}, real = {1}", new Integer[] {size, pitchOrSize_});
                     }
                 } else {
                     pitchOrSize_ = size;
Index: src/com/jme/system/lwjgl/LWJGLDisplaySystem.java
===================================================================
--- src/com/jme/system/lwjgl/LWJGLDisplaySystem.java   (revision 4291)
+++ src/com/jme/system/lwjgl/LWJGLDisplaySystem.java   (working copy)
@@ -360,21 +360,19 @@
         int match_freq = -1;
         for (int i = 0; i < modes.length; i++) {
             if (modes[i].getWidth() != width) {
-                logger.fine("DisplayMode " + modes[i] + ": Width != " + width);
+                logger.log(Level.FINE, "DisplayMode {0}: Width != {1}", new Object[] {modes[i], width});
                 continue;
             }
             if (modes[i].getHeight() != height) {
-                logger.fine("DisplayMode " + modes[i] + ": Height != "
-                                + height);
+                logger.log(Level.FINE, "DisplayMode {0}: Height != {1}", new Object[] {modes[i], height});
                 continue;
             }
             if (bpp != 0 && modes[i].getBitsPerPixel() != bpp) { // should pick based on best match here too
-                logger.fine("DisplayMode " + modes[i] + ": Bits per pixel != "
-                        + bpp);
+                logger.log(Level.FINE, "DisplayMode {0}: Bits per pixel != {1}", new Object[] {modes[i], bpp});
                 continue;
             }
             if (best_match == -1) {
-                logger.fine("DisplayMode " + modes[i] + ": Match! ");
+                logger.log(Level.FINE, "DisplayMode {0}: Match! ", modes[i]);
                 best_match = i;
                 match_freq = modes[i].getFrequency();
             } else {
@@ -383,7 +381,7 @@
                     ( cur_freq == freq ||        // Current is perfect match
                       match_freq < cur_freq ) )  //      or is higher freq
                 {
-                    logger.fine("DisplayMode " + modes[i] + ": Better match!");
+                    logger.log(Level.FINE, "DisplayMode {0}: Better match!", modes[i]);
                     best_match = i;
                     match_freq = cur_freq;
                 }
@@ -393,7 +391,7 @@
         if (best_match == -1)
             return null; // none found;
         else {
-            logger.info("Selected DisplayMode: " + modes[best_match]);
+            logger.log(Level.INFO, "Selected DisplayMode: {0}", modes[best_match]);
             return modes[best_match];
         }
     }


why not do it everywhere, otherwise it will just be inconsistent again: e.g. I cannot find the change for this in the Node class (and this one gets called hundreds of times)  ;):



                if (logger.isLoggable(Level.INFO)) {
                    logger.info("Child (" + child.getName()
                            + ") attached to this" + " node (" + getName()
                            + ")");
                }

dhdd said:

why not do it everywhere, otherwise it will just be inconsistent again: e.g. I cannot find the change for this in the Node class (and this one gets called hundreds of times)  ;):


                if (logger.isLoggable(Level.INFO)) {
                    logger.info("Child (" + child.getName()
                            + ") attached to this" + " node (" + getName()
                            + ")");
                }



Okay, I'll add patch for Node class. But I don't have enough time to find these logs. please inform me when you find codes like this.

you can search all source files (e.g. with Eclipse) for the string

" +

  :wink: