Author: henning
Date: Sat Sep 16 03:29:10 2006
New Revision: 446845

URL: http://svn.apache.org/viewvc?view=rev&rev=446845
Log:
Fix a theoretical NPE. Suggested by FindBugs.

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

Modified: 
jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/VMProxyArg.java
URL: 
http://svn.apache.org/viewvc/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/VMProxyArg.java?view=diff&rev=446845&r1=446844&r2=446845
==============================================================================
--- 
jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/VMProxyArg.java
 (original)
+++ 
jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/VMProxyArg.java
 Sat Sep 16 03:29:10 2006
@@ -408,23 +408,25 @@
                     /*
                      * sanity check
                      */
-
-                    if ( nodeTree != null && nodeTree.getType() != type )
+                    if ( nodeTree != null)
                     {
-                        log.error("VMProxyArg.setup() : programmer error : 
type doesn't match node type.");
-                    }
+                       if(nodeTree.getType() != type)
+                       {
+                           log.error("VMProxyArg.setup() : programmer error : 
type doesn't match node type.");
+                       }
+
+                       /*
+                        *  init.  be a good citizen and give it an ICA
+                        */
 
-                    /*
-                     *  init.  be a good citizen and give it an ICA
-                     */
+                       InternalContextAdapter ica
+                               = new InternalContextAdapterImpl(new 
VelocityContext());
 
-                    InternalContextAdapter ica
-                            = new InternalContextAdapterImpl(new 
VelocityContext());
+                       ica.pushCurrentTemplateName("VMProxyArg : "
+                               + ParserTreeConstants.jjtNodeName[type]);
 
-                    ica.pushCurrentTemplateName("VMProxyArg : "
-                            + ParserTreeConstants.jjtNodeName[type]);
-
-                    nodeTree.init(ica, rsvc);
+                       nodeTree.init(ica, rsvc);
+                    }
                 } 
                 /**
                  * pass through application level runtime exceptions
@@ -445,14 +447,14 @@
             case ParserTreeConstants.JJTTRUE :
             {
                 constant = true;
-                staticObject = new  Boolean(true);
+                staticObject = Boolean.TRUE;
                 break;
             }
 
             case ParserTreeConstants.JJTFALSE :
             {
                 constant = true;
-                staticObject =  new Boolean(false);
+                staticObject =  Boolean.FALSE;
                 break;
             }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to