</configuration>
</plugin>
<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
<configuration>
<failOnError>true</failOnError>
<!--
do {
try {
br.sendEOR();
- LOG.debug("Replay sendEOR {} successful");
+ LOG.debug("Replay sendEOR() successful");
break;
} catch (Exception e) {
eorRetry.errorOccured();
Integer.parseInt(nbrshipStatus);
alarmToRaise = false;
} catch (NumberFormatException e) {
- LOG.trace("Exception thrown in parsing the integers. {}", e);
+ LOG.trace("Exception thrown in parsing the integers.", e);
}
final BgpAlarmStatus alarmStatus = neighborsRaisedAlarmStatusMap.get(nbr.getAddress().getValue());
public void remove(@NonNull InstanceIdentifier<K8sClusters> instanceIdentifier, @NonNull K8sClusters clusters) {
LOG.trace("K8 Cluster deleted {}", clusters);
if (clusters.getClusterId() == null) {
- LOG.error("K8 cluster {} deleted with null cluster-id");
+ LOG.error("K8 cluster {} deleted with null cluster-id", clusters);
return;
}
jobCoordinator.enqueueJob(clusters.getClusterId().getValue(),
public void add(@NonNull InstanceIdentifier<K8sClusters> instanceIdentifier, @NonNull K8sClusters clusters) {
LOG.trace("K8 Cluster added {}", clusters);
if (clusters.getClusterId() == null) {
- LOG.error("K8 cluster {} added with null cluster-id");
+ LOG.error("K8 cluster {} added with null cluster-id", clusters);
return;
}
jobCoordinator.enqueueJob(clusters.getClusterId().getValue(),
</configuration>
</plugin>
<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
<configuration>
- <plugins>
- <plugin>
- <groupId>jp.skypencil.findbugs.slf4j</groupId>
- <artifactId>bug-pattern</artifactId>
- <version>1.4.0</version>
- </plugin>
- </plugins>
<failOnError>true</failOnError>
</configuration>
</plugin>
// During controller restart we'll get add for designatedDpns as well and we
// need not install drop flows for those dpns
if (designatedDpnsToTunnelIpElanNameCache.get(dpId) != null) {
- LOG.trace("The dpn {} is designated DPN need not install drop flows");
+ LOG.trace("The dpn {} is designated DPN need not install drop flows", dpId);
return;
}
// Read from DS since the cache may not get loaded completely in restart scenario
if (isDpnDesignatedDpn(dpId)) {
- LOG.trace("The dpn {} is designated DPN need not install drop flows");
+ LOG.trace("The dpn {} is designated DPN need not install drop flows", dpId);
return;
}
List<String> vmMacs = getAllVmMacs();
import java.util.Collection;
import java.util.Collections;
import java.util.List;
+import java.util.Locale;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentMap;
import java.util.stream.Collectors;
-
import org.opendaylight.genius.utils.batching.ResourceBatchingManager;
import org.opendaylight.genius.utils.batching.ResourceBatchingManager.ShardResource;
import org.opendaylight.genius.utils.hwvtep.HwvtepSouthboundUtils;
this.l2GwDevice.getHwvtepNodeId(), this.elanName);
final String logicalSwitchName = ElanL2GatewayUtils.getLogicalSwitchFromElan(this.elanName);
List<MacAddress> macs = new ArrayList<>();
- macAddresses.forEach((mac) -> macs.add(new MacAddress(mac.getValue().toLowerCase())));
-
+ macAddresses.forEach((mac) -> macs.add(new MacAddress(mac.getValue().toLowerCase(Locale.ENGLISH))));
List<ListenableFuture<Void>> futures = new ArrayList<>();
ConcurrentMap<String, L2GatewayDevice> elanL2GwDevices = ElanL2GwCacheUtils
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
+import java.util.Locale;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
Collection<LocalUcastMacs> lstUcastLocalMacs = l2gwDevice.getUcastLocalMacs();
if (!lstUcastLocalMacs.isEmpty()) {
macs.addAll(lstUcastLocalMacs.stream().filter(Objects::nonNull)
- .map(mac -> new MacAddress(mac.getMacEntryKey().getValue().toLowerCase()))
+ .map(mac -> new MacAddress(mac.getMacEntryKey().getValue().toLowerCase(Locale.ENGLISH)))
.collect(Collectors.toList()));
}
Set<MacAddress> macs = new HashSet<>();
if (!lstUcastLocalMacs.isEmpty()) {
macs.addAll(lstUcastLocalMacs.stream().filter(Objects::nonNull)
- .map(mac -> new MacAddress(mac.getMacEntryKey().getValue().toLowerCase()))
+ .map(mac -> new MacAddress(mac.getMacEntryKey().getValue().toLowerCase(Locale.ENGLISH)))
.collect(Collectors.toList()));
}
Optional<Node> configNode = MDSALUtil.read(broker, LogicalDatastoreType.CONFIGURATION,
}
} catch (InterruptedException | ExecutionException e) {
- LOG.error("Error in RPC call getTunnelInterfaceName {}", e);
+ LOG.error("Error in RPC call getTunnelInterfaceName", e);
}
return result;
}
} catch (InterruptedException | ExecutionException e) {
- LOG.error("Error in RPC call getTunnelInterfaceName {}", e);
+ LOG.error("Error in RPC call getTunnelInterfaceName", e);
}
return result;
destinationDpnId);
}
} catch (InterruptedException | ExecutionException e) {
- LOG.error("Error in RPC call getTunnelInterfaceName {}", e);
+ LOG.error("Error in RPC call getTunnelInterfaceName", e);
}
return result;
}
}
}
} catch (Exception e) {
- LOG.error("Error in RPC call getEgressActionsForInterface {}", e);
+ LOG.error("Error in RPC call getEgressActionsForInterface", e);
}
LOG.warn("Could not build Egress actions for interface {} and tunnelId {}", interfaceName, tunnelKey);
return Collections.emptyList();
import org.opendaylight.genius.utils.batching.SubTransaction;
import org.opendaylight.genius.utils.batching.SubTransactionImpl;
import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.netvirt.fibmanager.NexthopManager.AdjacencyResult;
import org.opendaylight.netvirt.fibmanager.api.FibHelper;
import org.opendaylight.netvirt.fibmanager.api.RouteOrigin;
try {
nextHopManager.removeLocalNextHop(dpId, vpnId, ipAddress, ipPrefixAddress);
} catch (NullPointerException e) {
- LOG.trace("", e);
+ // FIXME: NPEs should not be caught but rather their root cause should be eliminated
+ LOG.trace("Failed to remove nexthop", e);
}
}
.collect(toList()));
}
} catch (NullPointerException e) {
- LOG.trace("", e);
+ // FIXME: NPEs should not be caught but rather their root cause should be eliminated
+ LOG.trace("Failed to remove adjacency", e);
}
return adjacencyList;
}
for (AdjacencyResult adjacencyResult : adjacencyResults) {
String interfaceName = adjacencyResult.getInterfaceName();
if (null == fibUtil.getInterfaceStateFromOperDS(interfaceName)) {
- res = fibUtil.buildStateInterfaceId(interfaceName);
+ res = FibUtil.buildStateInterfaceId(interfaceName);
break;
}
}
absentInterfaceStateIid,
(before, after) -> {
LOG.info("programRemoteFib: waited for and got interface state {}", absentInterfaceStateIid);
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(
- (wtx) -> programRemoteFib(remoteDpnId, vpnId, vrfEntry, wtx, rd, adjacencyResults, null));
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(
+ (wtx) -> programRemoteFib(remoteDpnId, vpnId, vrfEntry, wtx, rd, adjacencyResults, null)),
+ LOG, "Failed to program remote FIB {}", absentInterfaceStateIid);
return DataTreeEventCallbackRegistrar.NextAction.UNREGISTER;
},
Duration.of(15, ChronoUnit.MINUTES),
(iid) -> {
LOG.error("programRemoteFib: timed out waiting for {}", absentInterfaceStateIid);
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(
- (wtx) -> programRemoteFib(remoteDpnId, vpnId, vrfEntry, wtx, rd, adjacencyResults, null));
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(
+ (wtx) -> programRemoteFib(remoteDpnId, vpnId, vrfEntry, wtx, rd, adjacencyResults, null)),
+ LOG, "Failed to program timed-out remote FIB {}", absentInterfaceStateIid);
});
return;
}
RpcResult<AllocateIdOutput> rpcResult = result.get();
return rpcResult.getResult().getIdValue();
} catch (NullPointerException | InterruptedException | ExecutionException e) {
- LOG.trace("", e);
+ // FIXME: NPEs should not be caught but rather their root cause should be eliminated
+ LOG.trace("Failed to allocate {}", getIdInput, e);
}
return 0;
}
}
LOG.debug("remove : Retrieved vpnId {} for router {}", vpnId, routerUuid);
//Remove default entry in FIB
- LOG.debug("remove : Removing default route in FIB on dpn {} for vpn {} ...", dpnId,
- vpnName);
+ LOG.debug("remove : Removing default route in FIB on dpn {} ...", dpnId);
snatDefaultRouteProgrammer.removeDefNATRouteInDPN(dpnId, vpnId, confTx);
} else {
LOG.debug("remove : External vpn associated to router {}", routerUuid);
}
Network network = neutronvpnUtils.getNeutronNetwork(nw);
if (network == null) {
- LOG.error("dissociateNetworksFromVpn: Network {} not found in ConfigDS");
+ LOG.error("dissociateNetworksFromVpn: Network {} not found in ConfigDS", nw.getValue());
failedNwList.add(String.format("Failed to disassociate network %s as is not found in ConfigDS",
nw.getValue()));
continue;
}
if (destinationPort != null) {
- LOG.warn("Ace {}: destination port is ignored combined with RSP redirect");
+ LOG.warn("Ace {}: destination port is ignored combined with RSP redirect", ruleName);
}
List<String> interfaces = new ArrayList<>();
@Override
public void onFailure(Throwable throwable) {
- LOG.debug("write Tx config operation failed {}", throwable);
+ LOG.debug("write Tx config operation failedTunnelEndPointChangeListener", throwable);
}
}
}
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
-
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Collections;
@Override
public void onFailure(Throwable throwable) {
- LOG.debug("addVpnInterface: write Tx config execution failed {}", throwable);
+ LOG.debug("addVpnInterface: write Tx config execution failed", throwable);
}
}, MoreExecutors.directExecutor());
futures.add(writeConfigFuture);
boolean isL3VpnOverVxLan = VpnUtil.isL3VpnOverVxLan(l3vni);
VrfEntry.EncapType encapType = isL3VpnOverVxLan ? VrfEntry.EncapType.Vxlan : VrfEntry.EncapType.Mplsgre;
VpnPopulator registeredPopulator = L3vpnRegistry.getRegisteredPopulator(encapType);
- List<Adjacency> nextHops = (adjacencies != null) ? adjacencies.getAdjacency() : emptyList();
+ List<Adjacency> nextHops = adjacencies != null ? adjacencies.getAdjacency() : emptyList();
List<Adjacency> value = new ArrayList<>();
for (Adjacency nextHop : nextHops) {
String rd = primaryRd;
LOG.debug("processVpnInterfaceAdjacencies: Adding prefix {} to interface {} with nextHops {} on dpn {}"
+ " for vpn {}", prefix, interfaceName, nhList, dpnId, vpnName);
- Prefixes prefixes = (intfnetworkUuid != null)
+ Prefixes prefixes = intfnetworkUuid != null
? VpnUtil.getPrefixToInterface(dpnId, interfaceName, prefix, intfnetworkUuid ,networkType,
segmentationId, prefixCue) :
VpnUtil.getPrefixToInterface(dpnId, interfaceName, prefix, prefixCue);
isVpnInstanceUpdate = true;
if (VpnUtil.isDualRouterVpnUpdate(oldVpnListCopy, newVpnListCopy)) {
if ((oldVpnListCopy.size() == 2 || oldVpnListCopy.size() == 3)
- && (oldVpnList.size() == 1 && newVpnList.size() == 0)) {
+ && oldVpnList.size() == 1 && newVpnList.size() == 0) {
//Identify the external BGP-VPN Instance and pass that value as newVpnList
List<String> externalBgpVpnList = new ArrayList<>();
for (String newVpnName : newVpnListCopy) {
externalBgpVpnList, oldVpnListCopy, futures);
} else if ((oldVpnListCopy.size() == 2 || oldVpnListCopy.size() == 3)
- && (oldVpnList.size() == 0 && newVpnList.size() == 1)) {
+ && oldVpnList.size() == 0 && newVpnList.size() == 1) {
//Identify the router VPN Instance and pass that value as oldVpnList
List<String> routerVpnList = new ArrayList<>();
for (String newVpnName : newVpnListCopy) {
List<String> newVpnList, List<String> oldVpnListCopy,
List<ListenableFuture<Void>> futures) {
final Adjacencies origAdjs = original.augmentation(Adjacencies.class);
- final List<Adjacency> oldAdjs = (origAdjs != null && origAdjs.getAdjacency() != null)
+ final List<Adjacency> oldAdjs = origAdjs != null && origAdjs.getAdjacency() != null
? origAdjs.getAdjacency() : new ArrayList<>();
final Adjacencies updateAdjs = update.augmentation(Adjacencies.class);
- final List<Adjacency> newAdjs = (updateAdjs != null && updateAdjs.getAdjacency() != null)
+ final List<Adjacency> newAdjs = updateAdjs != null && updateAdjs.getAdjacency() != null
? updateAdjs.getAdjacency() : new ArrayList<>();
boolean isOldVpnRemoveCallExecuted = false;
@Override
public void onFailure(Throwable throwable) {
- LOG.debug("write Tx config operation failed {}", throwable);
+ LOG.debug("write Tx config operation failed", throwable);
}
}
}
bgpManager.addVrf(rd, importRTList, ertList, AddressFamily.IPV6);
}
}
- } catch (Exception e) {
- LOG.error("VpnOpStatusListener.update: Exception when updating VRF to BGP"
- + " for vpn {} rd {}", vpnName, rd);
+ } catch (RuntimeException e) {
+ LOG.error("VpnOpStatusListener.update: Exception when updating VRF to BGP for vpn {} rd {}",
+ vpnName, rd, e);
}
});
return emptyList();
try {
interVpnLinkUtil.handleStaticRoute(ivpnLink, vpnId, destination, routeNextHop, label);
} catch (Exception e) {
- LOG.error("Exception while advertising prefix for intervpn link, {}", e);
+ LOG.error("Exception while advertising prefix for intervpn link", e);
}
}
}