Fix some Sonar reported problems with null pointer checks

Change-Id: If6658e38fd76013d065e96a4f0ee427c09b60468
This commit is contained in:
Ray Milkey 2018-06-21 08:28:12 -07:00 committed by Thomas Vachuska
parent eb130706ff
commit 032b964753

View File

@ -293,7 +293,7 @@ public class FpmManager implements FpmInfoService {
}
}
if (pdPushNextHopIPv4 == null || pdPushNextHopIPv4.size() == 0) {
if (pdPushNextHopIPv4.size() == 0) {
rurIPv4Address = interfaceService.getInterfaces()
.stream()
.filter(iface -> iface.name().contains("RUR"))
@ -310,7 +310,7 @@ public class FpmManager implements FpmInfoService {
}
if (pdPushNextHopIPv6 == null) {
if (pdPushNextHopIPv6.size() == 0) {
rurIPv6Address = interfaceService.getInterfaces()
.stream()
.filter(iface -> iface.name().contains("RUR"))
@ -327,13 +327,12 @@ public class FpmManager implements FpmInfoService {
}
log.info("PD pushing is enabled.");
if (pdPushNextHopIPv4 != null || pdPushNextHopIPv4.size() != 0) {
if (pdPushNextHopIPv4.size() != 0) {
log.info("ipv4 next-hop {} with {} items", pdPushNextHopIPv4.toString(), pdPushNextHopIPv4.size());
} else {
log.info("ipv4 next-hop is null");
}
if (pdPushNextHopIPv6 != null || pdPushNextHopIPv6.size() != 0) {
if (pdPushNextHopIPv6.size() != 0) {
log.info("ipv6 next-hop={} with {} items", pdPushNextHopIPv6.toString(), pdPushNextHopIPv6.size());
} else {
log.info("ipv6 next-hop is null");