Repository: cxf Updated Branches: refs/heads/master a0f0667ad -> caf903f11
[CXF-6614] Returning 0 if both interfaces are null Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/caf903f1 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/caf903f1 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/caf903f1 Branch: refs/heads/master Commit: caf903f11fad54811bd9d581e073bbf752f63273 Parents: a0f0667 Author: Sergey Beryozkin <[email protected]> Authored: Mon Oct 5 13:49:13 2015 +0100 Committer: Sergey Beryozkin <[email protected]> Committed: Mon Oct 5 13:49:13 2015 +0100 ---------------------------------------------------------------------- .../transport/http/DestinationRegistryImpl.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/caf903f1/rt/transports/http/src/main/java/org/apache/cxf/transport/http/DestinationRegistryImpl.java ---------------------------------------------------------------------- diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/DestinationRegistryImpl.java b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/DestinationRegistryImpl.java index 539ba6f..7d01b17 100644 --- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/DestinationRegistryImpl.java +++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/DestinationRegistryImpl.java @@ -30,6 +30,7 @@ import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; +import org.apache.cxf.service.model.InterfaceInfo; import org.apache.cxf.transport.AbstractDestination; public class DestinationRegistryImpl implements DestinationRegistry { @@ -122,16 +123,19 @@ public class DestinationRegistryImpl implements DestinationRegistry { getDestinations()); Collections.sort(dest2, new Comparator<AbstractHTTPDestination>() { public int compare(AbstractHTTPDestination o1, AbstractHTTPDestination o2) { - if (o1.getEndpointInfo().getInterface() == null) { + InterfaceInfo i1 = o1.getEndpointInfo().getInterface(); + InterfaceInfo i2 = o2.getEndpointInfo().getInterface(); + if (i1 == null && i2 == null) { + return 0; + } else if (i1 == null) { return -1; - } - if (o2.getEndpointInfo().getInterface() == null) { + } else if (i2 == null) { return 1; + } else { + return i1.getName().getLocalPart() + .compareTo( + i2.getName().getLocalPart()); } - return o1.getEndpointInfo().getInterface().getName() - .getLocalPart().compareTo( - o2.getEndpointInfo().getInterface().getName() - .getLocalPart()); } });
