velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nbu...@apache.org
Subject svn commit: r698376 - in /velocity/engine/trunk/src/java/org/apache/velocity: runtime/ParserPoolImpl.java runtime/VelocimacroManager.java runtime/directive/Define.java util/introspection/ClassMap.java
Date Tue, 23 Sep 2008 22:15:51 GMT
Author: nbubna
Date: Tue Sep 23 15:15:49 2008
New Revision: 698376

URL: http://svn.apache.org/viewvc?rev=698376&view=rev
Log:
misc miniscule performance tweaks (FindBugs)

Modified:
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/ParserPoolImpl.java
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/VelocimacroManager.java
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/Define.java
    velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/ClassMap.java

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/ParserPoolImpl.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/ParserPoolImpl.java?rev=698376&r1=698375&r2=698376&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/ParserPoolImpl.java (original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/ParserPoolImpl.java Tue Sep
23 15:15:49 2008
@@ -33,7 +33,6 @@
  */
 public class ParserPoolImpl implements ParserPool {
 
-    RuntimeServices rsvc = null;
     SimplePool pool = null;
     int max = RuntimeConstants.NUMBER_OF_PARSERS;
 
@@ -43,7 +42,6 @@
      */
     public void initialize(RuntimeServices rsvc)
     {
-        this.rsvc = rsvc;
         max = rsvc.getInt(RuntimeConstants.PARSER_POOL_SIZE, RuntimeConstants.NUMBER_OF_PARSERS);
         pool = new SimplePool(max);
 

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/VelocimacroManager.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/VelocimacroManager.java?rev=698376&r1=698375&r2=698376&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/VelocimacroManager.java (original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/VelocimacroManager.java Tue
Sep 23 15:15:49 2008
@@ -306,18 +306,6 @@
     }
 
     /**
-     *  returns the hash for the specified namespace.  Will not create a new one
-     *  if it doesn't exist
-     *
-     *  @param namespace  name of the namespace :)
-     *  @return namespace Map of VMs or null if doesn't exist
-     */
-    private Map getNamespace(final String namespace)
-    {
-        return getNamespace(namespace, false);
-    }
-
-    /**
      *  returns the hash for the specified namespace, and if it doesn't exist
      *  will create a new one and add it to the namespaces
      *
@@ -453,7 +441,7 @@
     /**
      *  wrapper class for holding VM information
      */
-    private class MacroEntry
+    private static class MacroEntry
     {
         private final String vmName;
         private final String[] argArray;

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/Define.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/Define.java?rev=698376&r1=698375&r2=698376&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/Define.java (original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/Define.java Tue Sep
23 15:15:49 2008
@@ -110,7 +110,7 @@
         /* put a Block instance into the context,
          * using the user-defined key, for later inline rendering.
          */
-        context.put(key, new Block(context, writer, this));
+        context.put(key, new Block(context, this));
         return true;
     }
 
@@ -143,14 +143,12 @@
     public static class Block implements Renderable
     {
         private InternalContextAdapter context;
-        private Writer writer;
         private Define parent;
         private int depth;
         
-        public Block(InternalContextAdapter context, Writer writer, Define parent)
+        public Block(InternalContextAdapter context, Define parent)
         {
             this.context = context;
-            this.writer = writer;
             this.parent = parent;
         }
         

Modified: velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/ClassMap.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/ClassMap.java?rev=698376&r1=698375&r2=698376&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/ClassMap.java (original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/ClassMap.java Tue
Sep 23 15:15:49 2008
@@ -191,7 +191,7 @@
     {
         private static final Object CACHE_MISS = new Object();
 
-        private static final String NULL_ARG = new Object().getClass().getName();
+        private static final String NULL_ARG = Object.class.getName();
 
         private static final Map convertPrimitives = new HashMap();
 



Mime
View raw message