cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6614] Returning 0 if both interfaces are null
Date Mon, 05 Oct 2015 12:51:22 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 3c95de67c -> 36d9d2c05


[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/36d9d2c0
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/36d9d2c0
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/36d9d2c0

Branch: refs/heads/3.0.x-fixes
Commit: 36d9d2c0522fe2c74e5b5de0d860f467461d2a44
Parents: 3c95de6
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Mon Oct 5 13:49:13 2015 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Mon Oct 5 13:51:05 2015 +0100

----------------------------------------------------------------------
 .../transport/http/DestinationRegistryImpl.java   | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/36d9d2c0/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());
             }
         });
 


Mime
View raw message