geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r509865 - in /geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/condition: JexlConditionParser.java OgnlConditionParser.java
Date Wed, 21 Feb 2007 02:15:05 GMT
Author: jdillon
Date: Tue Feb 20 18:15:04 2007
New Revision: 509865

URL: http://svn.apache.org/viewvc?view=rev&rev=509865
Log:
Make 'props' a real Properties object so that getProperty(String, String) can be used for
default values

Modified:
    geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/condition/JexlConditionParser.java
    geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/condition/OgnlConditionParser.java

Modified: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/condition/JexlConditionParser.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/condition/JexlConditionParser.java?view=diff&rev=509865&r1=509864&r2=509865
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/condition/JexlConditionParser.java
(original)
+++ geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/condition/JexlConditionParser.java
Tue Feb 20 18:15:04 2007
@@ -23,6 +23,7 @@
 import org.apache.commons.jexl.JexlContext;
 import org.apache.commons.jexl.JexlHelper;
 
+import java.util.Properties;
 import java.util.Map;
 import java.util.HashMap;
 import java.util.Collections;
@@ -47,10 +48,13 @@
     public JexlConditionParser() {
         // Setup the default vars
         vars = new HashMap();
-
-        vars.put("props", Collections.unmodifiableMap(System.getProperties()));
+        
         vars.put("java", new JavaVariable());
         vars.put("os", new OsVariable());
+        
+        // Install properties (to allow getProperty(x,y) to be used for defaults
+        // Using nested defaults to avoid modifications to system props in expresssion
+        vars.put("props", new Properties(System.getProperties()));
     }
 
     /**

Modified: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/condition/OgnlConditionParser.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/condition/OgnlConditionParser.java?view=diff&rev=509865&r1=509864&r2=509865
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/condition/OgnlConditionParser.java
(original)
+++ geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/condition/OgnlConditionParser.java
Tue Feb 20 18:15:04 2007
@@ -17,6 +17,7 @@
 
 package org.apache.geronimo.system.configuration.condition;
 
+import java.util.Properties;
 import java.util.Map;
 import java.util.HashMap;
 import java.util.Collections;
@@ -47,10 +48,13 @@
     public OgnlConditionParser() {
         // Setup the default vars
         vars = new HashMap();
-
-        vars.put("props", Collections.unmodifiableMap(System.getProperties()));
+        
         vars.put("java", new JavaVariable());
         vars.put("os", new OsVariable());
+        
+        // Install properties (to allow getProperty(x,y) to be used for defaults
+        // Using nested defaults to avoid modifications to system props in expresssion
+        vars.put("props", new Properties(System.getProperties()));
     }
     
     /**



Mime
View raw message