velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nbu...@apache.org
Subject svn commit: r718424 - in /velocity/engine/trunk/src/java/org/apache/velocity/runtime: ./ directive/ log/ parser/
Date Mon, 17 Nov 2008 22:50:43 GMT
Author: nbubna
Date: Mon Nov 17 14:50:43 2008
New Revision: 718424

URL: http://svn.apache.org/viewvc?rev=718424&view=rev
Log:
a few quick 'n easy findbugs fixes

Modified:
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/VelocimacroFactory.java
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/VelocimacroProxy.java
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/CommonsLogLogChute.java
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/Log4JLogChute.java
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/SimpleLog4JLogSystem.java
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/SystemLogChute.java
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParseException.java

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/VelocimacroFactory.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/VelocimacroFactory.java?rev=718424&r1=718423&r2=718424&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/VelocimacroFactory.java (original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/VelocimacroFactory.java Mon
Nov 17 14:50:43 2008
@@ -697,7 +697,7 @@
      *  set the switch for automatic reloading of
      *  global library-based VMs
      */
-    private void setAutoload(boolean b)
+    private synchronized void setAutoload(boolean b)
     {
         autoReloadLibrary = b;
     }
@@ -706,7 +706,7 @@
      *  get the switch for automatic reloading of
      *  global library-based VMs
      */
-    private boolean getAutoload()
+    private synchronized boolean getAutoload()
     {
         return autoReloadLibrary;
     }

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/VelocimacroProxy.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/VelocimacroProxy.java?rev=718424&r1=718423&r2=718424&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/VelocimacroProxy.java
(original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/VelocimacroProxy.java
Mon Nov 17 14:50:43 2008
@@ -176,21 +176,24 @@
             String templateName = vmc.getCurrentTemplateName();
             Object[] stack = vmc.getMacroNameStack();
 
-            String message = "Max calling depth of " + maxCallDepth + " was exceeded in Template:"
-                    + templateName + " and Macro:" + macroName + " with Call Stack:";
+            StringBuffer out = new StringBuffer(100)
+                .append("Max calling depth of ").append(maxCallDepth)
+                .append(" was exceeded in Template:").append(templateName)
+                .append(" and Macro:").append(macroName)
+                .append(" with Call Stack:");
             for (int i = 0; i < stack.length; i++)
             {
                 if (i != 0)
                 {
-                    message += "->";
+                    out.append("->");
                 }
-                message += stack[i];
+                out.append(stack[i]);
             }
-            rsvc.getLog().error(message);
+            rsvc.getLog().error(out.toString());
 
             try
             {
-                throw new MacroOverflowException(message);
+                throw new MacroOverflowException(out.toString());
             }
             finally
             {

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/CommonsLogLogChute.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/CommonsLogLogChute.java?rev=718424&r1=718423&r2=718424&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/CommonsLogLogChute.java
(original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/CommonsLogLogChute.java
Mon Nov 17 14:50:43 2008
@@ -89,15 +89,13 @@
             case LogChute.INFO_ID:
                 log.info(message);
                 break;
-            case LogChute.DEBUG_ID:
-                log.debug(message);
-                break;
             case LogChute.TRACE_ID:
                 log.trace(message);
                 break;
             case LogChute.ERROR_ID:
                 log.error(message);
                 break;
+            case LogChute.DEBUG_ID:
             default:
                 log.debug(message);
                 break;
@@ -117,15 +115,13 @@
             case LogChute.INFO_ID:
                 log.info(message, t);
                 break;
-            case LogChute.DEBUG_ID:
-                log.debug(message, t);
-                break;
             case LogChute.TRACE_ID:
                 log.trace(message, t);
                 break;
             case LogChute.ERROR_ID:
                 log.error(message, t);
                 break;
+            case LogChute.DEBUG_ID:
             default:
                 log.debug(message, t);
                 break;

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/Log4JLogChute.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/Log4JLogChute.java?rev=718424&r1=718423&r2=718424&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/Log4JLogChute.java (original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/Log4JLogChute.java Mon
Nov 17 14:50:43 2008
@@ -150,9 +150,6 @@
             case LogChute.INFO_ID:
                 logger.info(message);
                 break;
-            case LogChute.DEBUG_ID:
-                logger.debug(message);
-                break;
             case LogChute.TRACE_ID:
                 if (hasTrace)
                 {
@@ -166,6 +163,7 @@
             case LogChute.ERROR_ID:
                 logger.error(message);
                 break;
+            case LogChute.DEBUG_ID:
             default:
                 logger.debug(message);
                 break;
@@ -185,9 +183,6 @@
             case LogChute.INFO_ID:
                 logger.info(message, t);
                 break;
-            case LogChute.DEBUG_ID:
-                logger.debug(message, t);
-                break;
             case LogChute.TRACE_ID:
                 if (hasTrace)
                 {
@@ -201,6 +196,7 @@
             case LogChute.ERROR_ID:
                 logger.error(message, t);
                 break;
+            case LogChute.DEBUG_ID:
             default:
                 logger.debug(message, t);
                 break;

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/SimpleLog4JLogSystem.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/SimpleLog4JLogSystem.java?rev=718424&r1=718423&r2=718424&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/SimpleLog4JLogSystem.java
(original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/SimpleLog4JLogSystem.java
Mon Nov 17 14:50:43 2008
@@ -147,12 +147,10 @@
             case LogSystem.INFO_ID:
                 logger.info(message);
                 break;
-            case LogSystem.DEBUG_ID:
-                logger.debug(message);
-                break;
             case LogSystem.ERROR_ID:
                 logger.error(message);
                 break;
+            case LogSystem.DEBUG_ID:
             default:
                 logger.debug(message);
                 break;

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/SystemLogChute.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/SystemLogChute.java?rev=718424&r1=718423&r2=718424&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/SystemLogChute.java (original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/SystemLogChute.java Mon
Nov 17 14:50:43 2008
@@ -87,14 +87,13 @@
         {
             case WARN_ID:
                 return WARN_PREFIX;
-            case INFO_ID:
-                return INFO_PREFIX ;
             case DEBUG_ID:
                 return DEBUG_PREFIX;
             case TRACE_ID:
                 return TRACE_PREFIX;
             case ERROR_ID:
                 return ERROR_PREFIX;
+            case INFO_ID:
             default:
                 return INFO_PREFIX;
         }

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParseException.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParseException.java?rev=718424&r1=718423&r2=718424&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParseException.java
(original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParseException.java
Mon Nov 17 14:50:43 2008
@@ -73,7 +73,7 @@
    * this object has been created due to a parse error, the token
    * followng this token will (therefore) be the first error token.
    */
-  public Token currentToken;
+  public transient Token currentToken;
 
   /**
    * Each entry in this array is an array of integers.  Each array



Mime
View raw message