ode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject svn commit: r781235 - /ode/branches/APACHE_ODE_1.X/utils/src/main/java/org/apache/ode/utils/HierarchicalProperties.java
Date Wed, 03 Jun 2009 01:03:56 GMT
Author: midon
Date: Wed Jun  3 01:03:55 2009
New Revision: 781235

URL: http://svn.apache.org/viewvc?rev=781235&view=rev
Log:
make code more readable for others

Modified:
    ode/branches/APACHE_ODE_1.X/utils/src/main/java/org/apache/ode/utils/HierarchicalProperties.java

Modified: ode/branches/APACHE_ODE_1.X/utils/src/main/java/org/apache/ode/utils/HierarchicalProperties.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/utils/src/main/java/org/apache/ode/utils/HierarchicalProperties.java?rev=781235&r1=781234&r2=781235&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/utils/src/main/java/org/apache/ode/utils/HierarchicalProperties.java
(original)
+++ ode/branches/APACHE_ODE_1.X/utils/src/main/java/org/apache/ode/utils/HierarchicalProperties.java
Wed Jun  3 01:03:55 2009
@@ -172,23 +172,25 @@
         // gather all aliases
         Map<String, String> nsByAlias = new HashMap<String, String>();
 
+        // replace env variable by their values and collect namespace aliases
         for (Iterator it = props.entrySet().iterator(); it.hasNext();) {
             Map.Entry e = (Map.Entry) it.next();
             String key = (String) e.getKey();
-            String namespace = (String) e.getValue();
+            String value = (String) e.getValue();
 
 
             // replace any env variables by its value
-            namespace = SystemUtils.replaceSystemProperties(namespace);
-            props.put(key, namespace);
+            value = SystemUtils.replaceSystemProperties(value);
+            props.put(key, value);
 
             if (key.startsWith("alias.")) {
+                // we found an namespace alias
                 final String alias = key.substring("alias.".length(), key.length());
-                if (log.isDebugEnabled()) log.debug("Alias found: " + alias + " -> " +
namespace);
-                if (nsByAlias.containsKey(alias) && namespace.equals(nsByAlias.get(alias)))
+                if (log.isDebugEnabled()) log.debug("Alias found: " + alias + " -> " +
value);
+                if (nsByAlias.containsKey(alias) && value.equals(nsByAlias.get(alias)))
                     throw new RuntimeException("Same alias used twice for 2 different namespaces!
file=" + file + ", alias=" + alias);
-                nsByAlias.put(alias, namespace);
-                // remove the pair
+                nsByAlias.put(alias, value);
+                // remove the pair from the Properties
                 it.remove();
             }
         }



Mime
View raw message