You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by sa...@apache.org on 2006/09/29 13:09:05 UTC

svn commit: r451230 - in /webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi: PolicyReference.java PolicyRegistryImpl.java

Author: sanka
Date: Fri Sep 29 04:09:05 2006
New Revision: 451230

URL: http://svn.apache.org/viewvc?view=rev&rev=451230
Log:
Fixed few minor errors that caused failures in PolicyReferences resolution.


Modified:
    webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyReference.java
    webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyRegistryImpl.java

Modified: webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyReference.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyReference.java?view=diff&rev=451230&r1=451229&r2=451230
==============================================================================
--- webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyReference.java (original)
+++ webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyReference.java Fri Sep 29 04:09:05 2006
@@ -46,10 +46,15 @@
     }
     
     public PolicyComponent normalize(PolicyRegistry reg, boolean deep) {
-        Policy policy = reg.lookup(getURI());
+        String key = getURI();
+        if (key.startsWith("#")) {
+            key = key.substring(1);
+        }
+        
+        Policy policy = reg.lookup(key);
         
         if (policy == null) {
-            throw new RuntimeException(getURI() + " can't be resolved" );
+            throw new RuntimeException(key + " can't be resolved" );
         }
         
         return policy.normalize(reg, deep);

Modified: webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyRegistryImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyRegistryImpl.java?view=diff&rev=451230&r1=451229&r2=451230
==============================================================================
--- webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyRegistryImpl.java (original)
+++ webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyRegistryImpl.java Fri Sep 29 04:09:05 2006
@@ -39,7 +39,8 @@
         if (policy == null && parent != null) {
             return parent.lookup(key);
         }
-        return null;
+        
+        return policy;
     }
 
     public void register(String key, Policy policy) {



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org