Author: nbubna
Date: Wed Oct 8 20:18:58 2008
New Revision: 703049
URL: http://svn.apache.org/viewvc?rev=703049&view=rev
Log:
don't stomp on overridingProperties when init(String||Properties) is used
Modified:
velocity/engine/trunk/src/java/org/apache/velocity/runtime/RuntimeInstance.java
Modified:
velocity/engine/trunk/src/java/org/apache/velocity/runtime/RuntimeInstance.java
URL:
http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/RuntimeInstance.java?rev=703049&r1=703048&r2=703049&view=diff
==============================================================================
---
velocity/engine/trunk/src/java/org/apache/velocity/runtime/RuntimeInstance.java
(original)
+++
velocity/engine/trunk/src/java/org/apache/velocity/runtime/RuntimeInstance.java
Wed Oct 8 20:18:58 2008
@@ -585,10 +585,22 @@
*/
public void init(Properties p) throws Exception
{
- overridingProperties = ExtendedProperties.convertProperties(p);
+ setProperties(ExtendedProperties.convertProperties(p));
init();
}
+ private void setProperties(ExtendedProperties p)
+ {
+ if (overridingProperties == null)
+ {
+ overridingProperties = p;
+ }
+ else
+ {
+ overridingProperties.combine(p);
+ }
+ }
+
/**
* Initialize the Velocity Runtime with the name of
* ExtendedProperties object.
@@ -599,7 +611,7 @@
public void init(String configurationFile)
throws Exception
{
- overridingProperties = new ExtendedProperties(configurationFile);
+ setProperties(new ExtendedProperties(configurationFile));
init();
}