You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by he...@apache.org on 2005/10/01 14:46:35 UTC

svn commit: r292977 - /jakarta/velocity/core/trunk/src/java/org/apache/velocity/util/introspection/Introspector.java

Author: henning
Date: Sat Oct  1 05:46:32 2005
New Revision: 292977

URL: http://svn.apache.org/viewcvs?rev=292977&view=rev
Log:
Yet another "concat string in loop" occurence, found by findbugs

Modified:
    jakarta/velocity/core/trunk/src/java/org/apache/velocity/util/introspection/Introspector.java

Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/util/introspection/Introspector.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/util/introspection/Introspector.java?rev=292977&r1=292976&r2=292977&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/util/introspection/Introspector.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/util/introspection/Introspector.java Sat Oct  1 05:46:32 2005
@@ -105,23 +105,31 @@
              *  whoops.  Ambiguous.  Make a nice log message and return null...
              */
 
-            String msg = "Introspection Error : Ambiguous method invocation "
-                + name + "( ";
+            StringBuffer msg = new StringBuffer("Introspection Error : Ambiguous method invocation ")
+                    .append(name)
+                    .append("( ");
 
             for (int i = 0; i < params.length; i++)
             {
                 if ( i > 0)
-                    msg = msg + ", ";
+                {
+                    msg.append(", ");
+                }
 
                 if (params[i] == null)
-                    msg = msg + "null";
+                {
+                    msg.append("null");
+                }
                 else
-                    msg = msg + params[i].getClass().getName();                
+                {
+                    msg.append(params[i].getClass().getName());
+                }
             }
             
-            msg = msg + ") for class " + c;
+            msg.append(") for class ")
+                    .append(c);
             
-            log.error( msg );
+            log.error( msg.toString());
         }
 
         return null;



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org