Repository: cxf Updated Branches: refs/heads/master c7d1969c1 -> e0ace3dc7
[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/48c28c93 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/48c28c93 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/48c28c93 Branch: refs/heads/master Commit: 48c28c931160509a9a847f719c47a7ce54f4c030 Parents: c7d1969 Author: Daniel Kulp <[email protected]> Authored: Wed Jun 7 11:26:02 2017 -0400 Committer: Daniel Kulp <[email protected]> Committed: Wed Jun 7 12:19:22 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/48c28c93/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 0e957f7..e1726ee 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); } /**
