mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Fabio Pistolesi
08.38.2016 4031e391b96e01be6787f0d04289a2d22e84f9d4
OPENDJ-2828 dsreplication status throws a ClassCastException

dsreplication tries to alphabetically order the list of servers in the topology,
on non comparable objects. Reverts to sort their string representation instead.
1 files modified
9 ■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/ReplicationCliMain.java 9 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/ReplicationCliMain.java
@@ -6324,7 +6324,14 @@
      Set<ServerDescriptor> serversWithNoReplica)
  {
    Set<ReplicaDescriptor> orderedReplicas = new LinkedHashSet<>();
    Set<HostPort> hostPorts = new TreeSet<>();
    Set<HostPort> hostPorts = new TreeSet<>(new Comparator<HostPort>()
    {
      @Override
      public int compare(HostPort hp1, HostPort hp2)
      {
        return hp1.toString().compareTo(hp2.toString());
      }
    });
    Set<ServerDescriptor> notAddedReplicationServers = new TreeSet<>(new ReplicationServerComparator());
    for (Set<ReplicaDescriptor> replicas : orderedReplicaLists)
    {