BUG-199 : bgp negotiation now working without mentioning specific multiprotocol capab...
[bgpcep.git] / bgp / rib-impl / src / main / java / org / opendaylight / protocol / bgp / rib / impl / BGPObjectComparator.java
index 0be37b9fbe4073848f0813b59a8c6837455b1004..d252af29e4d6338bf091be290a1d7f3babc5e540 100644 (file)
@@ -9,8 +9,7 @@ package org.opendaylight.protocol.bgp.rib.impl;
 
 import java.util.Comparator;
 
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130918.PathAttributes;
-
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.PathAttributes;
 
 /**
  * This comparator is intended to implement BGP Best Path Selection algorithm, as described at
@@ -20,20 +19,24 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mess
  * @param <T> Actual object state reference
  */
 final class BGPObjectComparator implements Comparator<PathAttributes> {
+       public static final BGPObjectComparator INSTANCE = new BGPObjectComparator();
+
+       private BGPObjectComparator() {
+       }
+
        @Override
        public int compare(final PathAttributes o1, final PathAttributes o2) {
-               if (o1 == o2) {
-                       return 0;
-               }
                if (o1 == null) {
                        return 1;
                }
                if (o2 == null) {
                        return -1;
                }
+               if (o1.equals(o2)) {
+                       return 0;
+               }
 
-               // FIXME: look at ASPath
-               // FIXME: look at everything else :-)
+               // FIXME: BUG-185: implement here
 
                return 0;
        }