This is a simple pass over reported issues, making trivial fixes.
Change-Id: If2094f3e9b02ccfea407dd3eddc641937b186170
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
* @param nlri byte representation of NLRI which will be parsed
* @return list of Flowspec
*/
- protected final List<Flowspec> parseNlriFlowspecList(final @NonNull ByteBuf nlri) throws BGPParsingException {
+ protected final List<Flowspec> parseNlriFlowspecList(final @NonNull ByteBuf nlri) {
if (!nlri.isReadable()) {
return null;
}
import org.opendaylight.protocol.bgp.flowspec.SimpleFlowspecExtensionProviderContext;
import org.opendaylight.protocol.bgp.flowspec.l3vpn.AbstractFlowspecL3vpnRIBSupport;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib.rib.loc.rib.tables.routes.FlowspecL3vpnIpv6RoutesCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib.rib.loc.rib.tables.routes.FlowspecL3vpnIpv6RoutesCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.flowspec.l3vpn.destination.ipv6.DestinationFlowspecL3vpnIpv6;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.flowspec.l3vpn.ipv6.route.FlowspecL3vpnRoute;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.flowspec.l3vpn.ipv6.route.FlowspecL3vpnRouteBuilder;
FlowspecL3vpnRouteKey> {
private static final FlowspecL3vpnIpv6Routes EMPTY_CONTAINER
= new FlowspecL3vpnIpv6RoutesBuilder().setFlowspecL3vpnRoute(Collections.emptyList()).build();
- private static final FlowspecL3vpnIpv6RoutesCase EMPTY_CASE = new FlowspecL3vpnIpv6RoutesCaseBuilder()
- .setFlowspecL3vpnIpv6Routes(EMPTY_CONTAINER).build();
private static FlowspecL3vpnIpv6RIBSupport SINGLETON;
private FlowspecL3vpnIpv6RIBSupport(
final Class<? extends AfiSafiType> afiSafi,
final Attributes attributes,
final BgpConditions conditions) {
- if (!matchAfiSafi(afiSafi, conditions.getAfiSafiIn())) {
- return false;
- }
-
- if (!matchAsPathLength(attributes.getAsPath(), conditions.getAsPathLength())) {
- return false;
- }
-
- if (!matchMED(attributes.getMultiExitDisc(), conditions.getMedEq())) {
- return false;
- }
-
- if (!matchOrigin(attributes.getOrigin(), conditions.getOriginEq())) {
- return false;
- }
-
- if (!matchNextHopIn(attributes.getCNextHop(), conditions.getNextHopIn())) {
- return false;
- }
-
- if (!matchLocalPref(attributes.getLocalPref(), conditions.getLocalPrefEq())) {
- return false;
- }
- return true;
+ return matchAfiSafi(afiSafi, conditions.getAfiSafiIn())
+ && matchAsPathLength(attributes.getAsPath(), conditions.getAsPathLength())
+ && matchMED(attributes.getMultiExitDisc(), conditions.getMedEq())
+ && matchOrigin(attributes.getOrigin(), conditions.getOriginEq())
+ && matchNextHopIn(attributes.getCNextHop(), conditions.getNextHopIn())
+ && matchLocalPref(attributes.getLocalPref(), conditions.getLocalPrefEq());
}
private static boolean matchAfiSafi(
final Class<? extends AfiSafiType> afiSafi,
final List<Class<? extends AfiSafiType>> afiSafiIn) {
- if (afiSafiIn == null) {
- return true;
- }
- return afiSafiIn.contains(afiSafi);
+ return afiSafiIn == null ? true : afiSafiIn.contains(afiSafi);
}
private static boolean matchMED(final MultiExitDisc multiExitDisc, final Long med) {
return false;
}
final BaseBestPath other = (BaseBestPath) obj;
- if (!this.routerId.equals(other.routerId)) {
- return false;
- }
- if (!this.state.equals(other.state)) {
- return false;
- }
- return true;
+ return this.routerId.equals(other.routerId) && this.state.equals(other.state);
}
}
}
@Override
- public synchronized final void channelInactive(final ChannelHandlerContext ctx) {
+ public final synchronized void channelInactive(final ChannelHandlerContext ctx) {
LOG.debug("Channel {} inactive.", ctx.channel());
endOfInput();
}
@Override
- protected synchronized final void channelRead0(final ChannelHandlerContext ctx, final Message msg) {
+ protected final synchronized void channelRead0(final ChannelHandlerContext ctx, final Message msg) {
LOG.debug("Message was received: {}", msg);
handleMessage(msg);
}
@Override
- public synchronized final void handlerAdded(final ChannelHandlerContext ctx) {
+ public final synchronized void handlerAdded(final ChannelHandlerContext ctx) {
this.sessionUp();
}
@Override
- public synchronized void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) {
+ public synchronized void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) {
handleException(cause);
}
}
public boolean isSyncNeedIt() {
- if (doesLspDbMatch() && !this.resynchronizing) {
- return false;
- }
- return true;
+ return !doesLspDbMatch() || this.resynchronizing;
}
public void setResynchronizingState(final Boolean resync) {
return false;
}
final PCEPErrorIdentifier other = (PCEPErrorIdentifier) obj;
- if (this.type != other.type || this.value != other.value) {
- return false;
- }
- return true;
+ return this.type == other.type && this.value == other.value;
}
@Override
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.sync.optimizations.config.rev181109.PcepNodeSyncConfig;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.TopologyTypes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
final class PCEPTopologyProviderUtil {
- private static final Logger LOG = LoggerFactory.getLogger(PCEPTopologyProviderUtil.class);
-
private PCEPTopologyProviderUtil() {
throw new UnsupportedOperationException();
}
try {
wTx.commit().get();
} catch (final InterruptedException | ExecutionException e) {
- LOG.warn("Failed to remove Pcep Node stats {}.", nodeId.getKey().getNodeId());
+ LOG.warn("Failed to remove Pcep Node stats {}.", nodeId.getKey().getNodeId(), e);
}
}
}