cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [4/8] cxf git commit: [CXF-7395] Allow parameters on the generic WS-A names
Date Mon, 26 Jun 2017 21:08:29 GMT
[CXF-7395] Allow parameters on the generic WS-A names


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/c2bdbd0b
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/c2bdbd0b
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/c2bdbd0b

Branch: refs/heads/3.0.x-fixes
Commit: c2bdbd0b6ba7cd326b30315451bd16c64dfb3eab
Parents: 2e958fe
Author: Daniel Kulp <dkulp@apache.org>
Authored: Wed Jun 7 11:26:02 2017 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Mon Jun 26 15:37:54 2017 -0400

----------------------------------------------------------------------
 .../org/apache/cxf/ws/addressing/ContextUtils.java    | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/c2bdbd0b/core/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java b/core/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
index 069e325..363085e 100644
--- a/core/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
+++ b/core/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
@@ -35,6 +35,7 @@ import org.apache.cxf.Bus;
 import org.apache.cxf.common.jaxb.JAXBContextCache;
 import org.apache.cxf.common.jaxb.JAXBContextCache.CachedContextAndSchemas;
 import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
@@ -283,6 +284,13 @@ public final class ContextUtils {
         relatesTo.setValue(uri);
         return relatesTo;
     }
+    
+    private static boolean startsWith(String value, String ref) {
+        if (StringUtils.isEmpty(value)) {
+            return false;
+        }
+        return value.startsWith(ref);
+    }
 
     /**
      * Helper method to determine if an EPR address is generic (either null,
@@ -294,8 +302,8 @@ public final class ContextUtils {
     public static boolean isGenericAddress(EndpointReferenceType ref) {
         return ref == null 
                || ref.getAddress() == null
-               || Names.WSA_ANONYMOUS_ADDRESS.equals(ref.getAddress().getValue())
-               || Names.WSA_NONE_ADDRESS.equals(ref.getAddress().getValue());
+               || startsWith(ref.getAddress().getValue(), Names.WSA_ANONYMOUS_ADDRESS)
+               || startsWith(ref.getAddress().getValue(), Names.WSA_NONE_ADDRESS);
     }
     
     /**
@@ -308,7 +316,7 @@ public final class ContextUtils {
     public static boolean isAnonymousAddress(EndpointReferenceType ref) {
         return ref == null 
                || ref.getAddress() == null
-               || Names.WSA_ANONYMOUS_ADDRESS.equals(ref.getAddress().getValue());
+               || startsWith(ref.getAddress().getValue(), Names.WSA_ANONYMOUS_ADDRESS);
     }
     
     /**


Mime
View raw message