private final I addPathRouteKeyIdentifier;
private final boolean depreferenced;
+ // Note: this field hides in the alignment shadow of 'depreferenced', but is used only in AdvertizedRoute.
+ // TODO: move this field back when we require JDK15+ (see https://bugs.openjdk.java.net/browse/JDK-8237767)
+ final boolean isFirstBestPath;
+
AbstractAdvertizedRoute(final RIBSupport<C, S, R, I> ribSupport, final R route, final PeerId fromPeerId,
final Attributes attributes, final boolean depreferenced) {
+ this(ribSupport, route, fromPeerId, attributes, depreferenced, false);
+ }
+
+ AbstractAdvertizedRoute(final RIBSupport<C, S, R, I> ribSupport, final R route, final PeerId fromPeerId,
+ final Attributes attributes, final boolean depreferenced, final boolean isFirstBestPath) {
this.fromPeerId = fromPeerId;
this.route = route;
this.attributes = attributes;
this.depreferenced = depreferenced;
+ this.isFirstBestPath = isFirstBestPath;
final @NonNull String routeKey = verifyNotNull(route.getRouteKey());
this.nonAddPathRouteKeyIdentifier = ribSupport.createRouteListKey(routeKey);
public final class AdvertizedRoute<C extends Routes & DataObject & ChoiceIn<Tables>,
S extends ChildOf<? super C>, R extends Route & ChildOf<? super S> & Identifiable<I>,
I extends Identifier<R>> extends AbstractAdvertizedRoute<C, S, R, I> {
- private final boolean isFirstBestPath;
public AdvertizedRoute(final RIBSupport<C, S, R, I> ribSupport, final R route, final Attributes attributes,
final PeerId fromPeerId, final boolean depreferenced) {
public AdvertizedRoute(final RIBSupport<C, S, R, I> ribSupport, final boolean isFirstBestPath,
final R route, final Attributes attributes, final PeerId fromPeerId, final boolean depreferenced) {
- super(ribSupport, route, fromPeerId, attributes, depreferenced);
- this.isFirstBestPath = isFirstBestPath;
+ super(ribSupport, route, fromPeerId, attributes, depreferenced, isFirstBestPath);
}
public boolean isFirstBestPath() {
- return this.isFirstBestPath;
+ return isFirstBestPath;
}
}