jvanzyl 00/12/19 09:31:40
Modified: src/java/org/apache/velocity/runtime Runtime.java
Log:
- Fixed an initialization problem with the:
Runtime.setProperties();
Runtime.setProperty() | Runtime.setSourceProperty()
Runtime.init()
sequence. Just testing turbine and ran across this.
Revision Changes Path
1.75 +18 -1
jakarta-velocity/src/java/org/apache/velocity/runtime/Runtime.java
Index: Runtime.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/Runtime.java,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -r1.74 -r1.75
--- Runtime.java 2000/12/19 16:24:18 1.74
+++ Runtime.java 2000/12/19 17:31:39 1.75
@@ -180,6 +180,10 @@
* specified by the client app is laid down on top of that
* overriding any of the defaults, then any calls to setProperty()
* or setSourceProperty() will override those.
+ *
+ * Turbine uses this method with its TurbineVelocityService. If
+ * you would like to see an example of this method of initialization
+ * look at org.apache.turbine.services.velocity.TurbineVelocityService.
* -----------------------------------------------------------------------
* Runtime.setDefaultProperties()
* [ Runtime.setProperty || Runtime.setSourceProperty() ]
@@ -197,7 +201,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jeff Bowden</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Geir Magusson Jr.</a>
- * @version $Id: Runtime.java,v 1.74 2000/12/19 16:24:18 jvanzyl Exp $
+ * @version $Id: Runtime.java,v 1.75 2000/12/19 17:31:39 jvanzyl Exp $
*/
public class Runtime implements RuntimeConstants
{
@@ -318,6 +322,19 @@
public synchronized static void setProperties(String propertiesFileName)
throws Exception
{
+ /*
+ * Set the default properties because client apps are
+ * using the:
+ *
+ * 1) Runtime.setProperties();
+ * 2) Runtime.setProperty() | Runtime.setSourceProperty()
+ * 3) Runtime.init();
+ *
+ * Sequence and the default props have to be present
+ * in order for 2) to work.
+ */
+ setDefaultProperties();
+
Properties p = new Properties();
/*