cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [6/9] cxf git commit: [CXF-7395] Allow parameters on the generic WS-A names
Date Wed, 07 Jun 2017 17:54:12 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/6735dd06
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/6735dd06
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/6735dd06

Branch: refs/heads/3.1.x-fixes
Commit: 6735dd0635ea56eae6b4c14d41088a7ea63957c7
Parents: 059cb2b
Author: Daniel Kulp <dkulp@apache.org>
Authored: Wed Jun 7 11:26:02 2017 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Wed Jun 7 12:43:55 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/6735dd06/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 8c171b7..280c297 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