Author: nbubna
Date: Wed Aug 8 12:25:02 2007
New Revision: 564000
URL: http://svn.apache.org/viewvc?view=rev&rev=564000
Log:
be more guarded with access to static fields
Modified:
velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/generic/log/LogChuteCommonsLog.java
velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/VelocityLayoutServlet.java
velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/jsp/VelocityViewTag.java
Modified:
velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/generic/log/LogChuteCommonsLog.java
URL:
http://svn.apache.org/viewvc/velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/generic/log/LogChuteCommonsLog.java?view=diff&rev=564000&r1=563999&r2=564000
==============================================================================
---
velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/generic/log/LogChuteCommonsLog.java
(original)
+++
velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/generic/log/LogChuteCommonsLog.java
Wed Aug 8 12:25:02 2007
@@ -38,7 +38,15 @@
public class LogChuteCommonsLog implements org.apache.commons.logging.Log
{
- protected static Log target = null;
+ private static Log target = null;
+
+ /**
+ * Allow subclasses to statically access the static target.
+ */
+ protected static Log getVelocityLog()
+ {
+ return target;
+ }
/**
* Set a VelocityEngine to handle all the log messages.
Modified:
velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/VelocityLayoutServlet.java
URL:
http://svn.apache.org/viewvc/velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/VelocityLayoutServlet.java?view=diff&rev=564000&r1=563999&r2=564000
==============================================================================
---
velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/VelocityLayoutServlet.java
(original)
+++
velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/VelocityLayoutServlet.java
Wed Aug 8 12:25:02 2007
@@ -72,50 +72,45 @@
/**
* The default error template's filename.
*/
- public static String DEFAULT_ERROR_TEMPLATE = "Error.vm";
+ public static final String DEFAULT_ERROR_TEMPLATE = "Error.vm";
/**
* The default layout directory
*/
- public static String DEFAULT_LAYOUT_DIR = "layout/";
+ public static final String DEFAULT_LAYOUT_DIR = "layout/";
/**
* The default filename for the servlet's default layout
*/
- public static String DEFAULT_DEFAULT_LAYOUT = "Default.vm";
+ public static final String DEFAULT_DEFAULT_LAYOUT = "Default.vm";
- //TODO? if demand for it exists, these context keys can be
- // made configurable by the velocity.properties
- // until such time, if anyone really needs to change these,
- // they are public and aren't final and can be altered
-
/**
* The context key that will hold the content of the screen.
*
* This key ($screen_content) must be present in the layout
* template for the current screen to be rendered.
*/
- public static String KEY_SCREEN_CONTENT = "screen_content";
+ public static final String KEY_SCREEN_CONTENT = "screen_content";
/**
* The context/parameter key used to specify an alternate
* layout to be used for a request instead of the default layout.
*/
- public static String KEY_LAYOUT = "layout";
+ public static final String KEY_LAYOUT = "layout";
/**
* The context key that holds the [EMAIL PROTECTED] Throwable} that
* broke the rendering of the requested screen.
*/
- public static String KEY_ERROR_CAUSE = "error_cause";
+ public static final String KEY_ERROR_CAUSE = "error_cause";
/**
* The context key that holds the stack trace of the error that
* broke the rendering of the requested screen.
*/
- public static String KEY_ERROR_STACKTRACE = "stack_trace";
+ public static final String KEY_ERROR_STACKTRACE = "stack_trace";
/**
* The context key that holds the [EMAIL PROTECTED]
MethodInvocationException}
@@ -124,7 +119,7 @@
* If this value is placed in the context, then $error_cause
* will hold the error that this invocation exception is wrapping.
*/
- public static String KEY_ERROR_INVOCATION_EXCEPTION =
"invocation_exception";
+ public static final String KEY_ERROR_INVOCATION_EXCEPTION =
"invocation_exception";
protected String errorTemplate;
Modified:
velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/jsp/VelocityViewTag.java
URL:
http://svn.apache.org/viewvc/velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/jsp/VelocityViewTag.java?view=diff&rev=564000&r1=563999&r2=564000
==============================================================================
---
velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/jsp/VelocityViewTag.java
(original)
+++
velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/jsp/VelocityViewTag.java
Wed Aug 8 12:25:02 2007
@@ -44,8 +44,7 @@
public static final String DEFAULT_NAME =
VelocityViewTag.class.getSimpleName();
- protected static int count = 0;
-
+ private static int count = 0;
private static final long serialVersionUID = -3329444102562079189L;
protected VelocityView view;