Committed by
Gerrit Code Review
BGP linkstate system test issues fix
Change-Id: I4ad53e98cdf30ebae3f305f5dfdd19fbdf5eceac
Showing
3 changed files
with
13 additions
and
9 deletions
| ... | @@ -280,14 +280,15 @@ public class BgpLinkLSIdentifier implements Comparable<Object> { | ... | @@ -280,14 +280,15 @@ public class BgpLinkLSIdentifier implements Comparable<Object> { |
| 280 | ListIterator<BgpValueType> listIteratorOther = ((BgpLinkLSIdentifier) o).linkDescriptor.listIterator(); | 280 | ListIterator<BgpValueType> listIteratorOther = ((BgpLinkLSIdentifier) o).linkDescriptor.listIterator(); |
| 281 | while (listIterator.hasNext()) { | 281 | while (listIterator.hasNext()) { |
| 282 | BgpValueType tlv = listIterator.next(); | 282 | BgpValueType tlv = listIterator.next(); |
| 283 | - BgpValueType tlv1 = listIteratorOther.next(); | 283 | + if (linkDescriptor.contains(tlv) && ((BgpLinkLSIdentifier) o).linkDescriptor.contains(tlv)) { |
| 284 | - if (linkDescriptor.contains(tlv) && ((BgpLinkLSIdentifier) o).linkDescriptor.contains(tlv1)) { | ||
| 285 | int res = linkDescriptor.get(linkDescriptor.indexOf(tlv)).compareTo( | 284 | int res = linkDescriptor.get(linkDescriptor.indexOf(tlv)).compareTo( |
| 286 | ((BgpLinkLSIdentifier) o).linkDescriptor.get(((BgpLinkLSIdentifier) o).linkDescriptor | 285 | ((BgpLinkLSIdentifier) o).linkDescriptor.get(((BgpLinkLSIdentifier) o).linkDescriptor |
| 287 | - .indexOf(tlv1))); | 286 | + .indexOf(tlv))); |
| 288 | if (res != 0) { | 287 | if (res != 0) { |
| 289 | return res; | 288 | return res; |
| 290 | } | 289 | } |
| 290 | + } else { | ||
| 291 | + return 1; | ||
| 291 | } | 292 | } |
| 292 | } | 293 | } |
| 293 | } | 294 | } | ... | ... |
| ... | @@ -255,14 +255,15 @@ public class BgpPrefixLSIdentifier implements Comparable<Object> { | ... | @@ -255,14 +255,15 @@ public class BgpPrefixLSIdentifier implements Comparable<Object> { |
| 255 | ListIterator<BgpValueType> listIteratorOther = ((BgpPrefixLSIdentifier) o).prefixDescriptor.listIterator(); | 255 | ListIterator<BgpValueType> listIteratorOther = ((BgpPrefixLSIdentifier) o).prefixDescriptor.listIterator(); |
| 256 | while (listIterator.hasNext()) { | 256 | while (listIterator.hasNext()) { |
| 257 | BgpValueType tlv = listIterator.next(); | 257 | BgpValueType tlv = listIterator.next(); |
| 258 | - BgpValueType tlv1 = listIteratorOther.next(); | 258 | + if (prefixDescriptor.contains(tlv) && ((BgpPrefixLSIdentifier) o).prefixDescriptor.contains(tlv)) { |
| 259 | - if (prefixDescriptor.contains(tlv) && ((BgpPrefixLSIdentifier) o).prefixDescriptor.contains(tlv1)) { | ||
| 260 | int res = prefixDescriptor.get(prefixDescriptor.indexOf(tlv)).compareTo( | 259 | int res = prefixDescriptor.get(prefixDescriptor.indexOf(tlv)).compareTo( |
| 261 | ((BgpPrefixLSIdentifier) o).prefixDescriptor | 260 | ((BgpPrefixLSIdentifier) o).prefixDescriptor |
| 262 | - .get(((BgpPrefixLSIdentifier) o).prefixDescriptor.indexOf(tlv1))); | 261 | + .get(((BgpPrefixLSIdentifier) o).prefixDescriptor.indexOf(tlv))); |
| 263 | if (res != 0) { | 262 | if (res != 0) { |
| 264 | return res; | 263 | return res; |
| 265 | } | 264 | } |
| 265 | + } else { | ||
| 266 | + return 1; | ||
| 266 | } | 267 | } |
| 267 | } | 268 | } |
| 268 | } | 269 | } | ... | ... |
| ... | @@ -247,13 +247,15 @@ public class NodeDescriptors { | ... | @@ -247,13 +247,15 @@ public class NodeDescriptors { |
| 247 | } else { | 247 | } else { |
| 248 | while (listIterator.hasNext()) { | 248 | while (listIterator.hasNext()) { |
| 249 | BgpValueType tlv = listIterator.next(); | 249 | BgpValueType tlv = listIterator.next(); |
| 250 | - BgpValueType tlv1 = listIteratorOther.next(); | 250 | + log.debug("NodeDescriptor compare subtlv's"); |
| 251 | - if (subTlvs.contains(tlv) && ((NodeDescriptors) o).subTlvs.contains(tlv1)) { | 251 | + if (subTlvs.contains(tlv) && ((NodeDescriptors) o).subTlvs.contains(tlv)) { |
| 252 | int result = subTlvs.get(subTlvs.indexOf(tlv)).compareTo( | 252 | int result = subTlvs.get(subTlvs.indexOf(tlv)).compareTo( |
| 253 | - ((NodeDescriptors) o).subTlvs.get(((NodeDescriptors) o).subTlvs.indexOf(tlv1))); | 253 | + ((NodeDescriptors) o).subTlvs.get(((NodeDescriptors) o).subTlvs.indexOf(tlv))); |
| 254 | if (result != 0) { | 254 | if (result != 0) { |
| 255 | return result; | 255 | return result; |
| 256 | } | 256 | } |
| 257 | + } else { | ||
| 258 | + return 1; | ||
| 257 | } | 259 | } |
| 258 | } | 260 | } |
| 259 | } | 261 | } | ... | ... |
-
Please register or login to post a comment