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 13:39:31 UTC

svn commit: r292958 - /jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/VMProxyArg.java

Author: henning
Date: Sat Oct  1 04:39:27 2005
New Revision: 292958

URL: http://svn.apache.org/viewcvs?rev=292958&view=rev
Log:
- make a constant really static
- remove a String(String) C'tor. Strings are immutable so the
  assignment is really ok.

(Both found by Findbugs)


Modified:
    jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/VMProxyArg.java

Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/VMProxyArg.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/VMProxyArg.java?rev=292958&r1=292957&r2=292958&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/VMProxyArg.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/VMProxyArg.java Sat Oct  1 04:39:27 2005
@@ -79,6 +79,9 @@
  */
 public class VMProxyArg
 {
+    /** in the event our type is switched - we don't care really what it is */
+    private static final int GENERALSTATIC = -1;
+
     /**  type of arg I will have */
     private int type = 0;
 
@@ -103,9 +106,6 @@
     /** by default, we are dynamic.  safest */
     private boolean constant = false;
 
-    /** in the event our type is switched - we don't care really what it is */
-    private final int GENERALSTATIC = -1;
-
     private RuntimeServices rsvc = null;
     private Log log = null;
 
@@ -138,7 +138,9 @@
          *  avoid fn call overhead 
          */
         if( nodeTree != null)
+        {
             numTreeChildren = nodeTree.jjtGetNumChildren();
+        }
 
         /*
          *  if we are a reference, and 'scalar' (i.e. $foo )
@@ -465,7 +467,7 @@
                 log.error("Unsupported arg type : " + callerReference +
                           " You most likely intended to call a VM with a string literal, so enclose with ' or \" characters. (VMProxyArg.setup())");
                 constant = true;
-                staticObject = new String( callerReference );
+                staticObject = callerReference;
 
                 break;
             }



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