Shashikanth VH
Committed by Gerrit Code Review

BGP linkstate system test issues fix

Change-Id: I4ad53e98cdf30ebae3f305f5dfdd19fbdf5eceac
......@@ -280,14 +280,15 @@ public class BgpLinkLSIdentifier implements Comparable<Object> {
ListIterator<BgpValueType> listIteratorOther = ((BgpLinkLSIdentifier) o).linkDescriptor.listIterator();
while (listIterator.hasNext()) {
BgpValueType tlv = listIterator.next();
BgpValueType tlv1 = listIteratorOther.next();
if (linkDescriptor.contains(tlv) && ((BgpLinkLSIdentifier) o).linkDescriptor.contains(tlv1)) {
if (linkDescriptor.contains(tlv) && ((BgpLinkLSIdentifier) o).linkDescriptor.contains(tlv)) {
int res = linkDescriptor.get(linkDescriptor.indexOf(tlv)).compareTo(
((BgpLinkLSIdentifier) o).linkDescriptor.get(((BgpLinkLSIdentifier) o).linkDescriptor
.indexOf(tlv1)));
.indexOf(tlv)));
if (res != 0) {
return res;
}
} else {
return 1;
}
}
}
......
......@@ -255,14 +255,15 @@ public class BgpPrefixLSIdentifier implements Comparable<Object> {
ListIterator<BgpValueType> listIteratorOther = ((BgpPrefixLSIdentifier) o).prefixDescriptor.listIterator();
while (listIterator.hasNext()) {
BgpValueType tlv = listIterator.next();
BgpValueType tlv1 = listIteratorOther.next();
if (prefixDescriptor.contains(tlv) && ((BgpPrefixLSIdentifier) o).prefixDescriptor.contains(tlv1)) {
if (prefixDescriptor.contains(tlv) && ((BgpPrefixLSIdentifier) o).prefixDescriptor.contains(tlv)) {
int res = prefixDescriptor.get(prefixDescriptor.indexOf(tlv)).compareTo(
((BgpPrefixLSIdentifier) o).prefixDescriptor
.get(((BgpPrefixLSIdentifier) o).prefixDescriptor.indexOf(tlv1)));
.get(((BgpPrefixLSIdentifier) o).prefixDescriptor.indexOf(tlv)));
if (res != 0) {
return res;
}
} else {
return 1;
}
}
}
......
......@@ -247,13 +247,15 @@ public class NodeDescriptors {
} else {
while (listIterator.hasNext()) {
BgpValueType tlv = listIterator.next();
BgpValueType tlv1 = listIteratorOther.next();
if (subTlvs.contains(tlv) && ((NodeDescriptors) o).subTlvs.contains(tlv1)) {
log.debug("NodeDescriptor compare subtlv's");
if (subTlvs.contains(tlv) && ((NodeDescriptors) o).subTlvs.contains(tlv)) {
int result = subTlvs.get(subTlvs.indexOf(tlv)).compareTo(
((NodeDescriptors) o).subTlvs.get(((NodeDescriptors) o).subTlvs.indexOf(tlv1)));
((NodeDescriptors) o).subTlvs.get(((NodeDescriptors) o).subTlvs.indexOf(tlv)));
if (result != 0) {
return result;
}
} else {
return 1;
}
}
}
......