diff --git a/src/ext-test/java/org/opentripplanner/ext/fares/model/FareProductTest.java b/src/ext-test/java/org/opentripplanner/ext/fares/model/FareProductTest.java index 089bac64c11..65f10db6f85 100644 --- a/src/ext-test/java/org/opentripplanner/ext/fares/model/FareProductTest.java +++ b/src/ext-test/java/org/opentripplanner/ext/fares/model/FareProductTest.java @@ -6,7 +6,6 @@ import java.time.OffsetDateTime; import java.time.ZonedDateTime; import java.util.stream.Stream; -import javax.annotation.Nonnull; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -57,7 +56,6 @@ void instanceId(FareProduct fareProduct, ZonedDateTime startTime, String expecte assertEquals(expectedInstanceId, instanceId); } - @Nonnull private static FareProduct fareProduct(Duration duration, RiderCategory cat, FareMedium medium) { return new FareProduct( new FeedScopedId("fares", "daypass"), diff --git a/src/ext-test/java/org/opentripplanner/ext/flex/FlexIntegrationTest.java b/src/ext-test/java/org/opentripplanner/ext/flex/FlexIntegrationTest.java index c88439a9e3f..56d66081e35 100644 --- a/src/ext-test/java/org/opentripplanner/ext/flex/FlexIntegrationTest.java +++ b/src/ext-test/java/org/opentripplanner/ext/flex/FlexIntegrationTest.java @@ -13,7 +13,6 @@ import java.time.ZonedDateTime; import java.util.List; import java.util.Map; -import javax.annotation.Nonnull; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -216,7 +215,6 @@ private Itinerary getItinerary(GenericLocation from, GenericLocation to, int ind return itineraries.get(index); } - @Nonnull private static List getItineraries( GenericLocation from, GenericLocation to, diff --git a/src/ext-test/java/org/opentripplanner/ext/flex/trip/UnscheduledTripTest.java b/src/ext-test/java/org/opentripplanner/ext/flex/trip/UnscheduledTripTest.java index 8bc9d7c8919..6280095b6be 100644 --- a/src/ext-test/java/org/opentripplanner/ext/flex/trip/UnscheduledTripTest.java +++ b/src/ext-test/java/org/opentripplanner/ext/flex/trip/UnscheduledTripTest.java @@ -16,7 +16,6 @@ import java.util.List; import java.util.Objects; import java.util.stream.Stream; -import javax.annotation.Nonnull; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; diff --git a/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehiclerental/mapper/VehicleRentalLayerTest.java b/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehiclerental/mapper/VehicleRentalLayerTest.java index 984d4927041..45a4ab30744 100644 --- a/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehiclerental/mapper/VehicleRentalLayerTest.java +++ b/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/vehiclerental/mapper/VehicleRentalLayerTest.java @@ -8,7 +8,6 @@ import java.util.HashMap; import java.util.Locale; import java.util.Map; -import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.opentripplanner.framework.i18n.NonLocalizedString; import org.opentripplanner.framework.i18n.TranslatedString; @@ -114,7 +113,6 @@ public void realtimeStation() { assertEquals(3, map.get("spacesAvailable")); } - @Nonnull private static RentalVehicleType vehicleType(RentalFormFactor formFactor) { return new RentalVehicleType( new FeedScopedId("1", formFactor.name()), diff --git a/src/ext/java/org/opentripplanner/ext/datastore/gs/GsDataSourceRepository.java b/src/ext/java/org/opentripplanner/ext/datastore/gs/GsDataSourceRepository.java index ee7e4614ee7..f049beef0b8 100644 --- a/src/ext/java/org/opentripplanner/ext/datastore/gs/GsDataSourceRepository.java +++ b/src/ext/java/org/opentripplanner/ext/datastore/gs/GsDataSourceRepository.java @@ -9,7 +9,6 @@ import java.io.IOException; import java.net.URI; import java.util.Collections; -import javax.annotation.Nonnull; import org.opentripplanner.datastore.api.CompositeDataSource; import org.opentripplanner.datastore.api.DataSource; import org.opentripplanner.datastore.api.FileType; @@ -39,7 +38,7 @@ public void open() { } @Override - public DataSource findSource(@Nonnull URI uri, @Nonnull FileType type) { + public DataSource findSource(URI uri, FileType type) { if (skipUri(uri)) { return null; } @@ -48,7 +47,7 @@ public DataSource findSource(@Nonnull URI uri, @Nonnull FileType type) { } @Override - public CompositeDataSource findCompositeSource(@Nonnull URI uri, @Nonnull FileType type) { + public CompositeDataSource findCompositeSource(URI uri, FileType type) { if (skipUri(uri)) { return null; } diff --git a/src/ext/java/org/opentripplanner/ext/fares/impl/CombinedInterlinedTransitLeg.java b/src/ext/java/org/opentripplanner/ext/fares/impl/CombinedInterlinedTransitLeg.java index 9d10b87bbd6..ce838480186 100644 --- a/src/ext/java/org/opentripplanner/ext/fares/impl/CombinedInterlinedTransitLeg.java +++ b/src/ext/java/org/opentripplanner/ext/fares/impl/CombinedInterlinedTransitLeg.java @@ -5,7 +5,6 @@ import java.time.ZonedDateTime; import java.util.List; import java.util.Set; -import javax.annotation.Nonnull; import org.locationtech.jts.geom.LineString; import org.opentripplanner.framework.collection.ListUtils; import org.opentripplanner.model.fare.FareProductUse; @@ -39,19 +38,16 @@ public Agency getAgency() { return first.getAgency(); } - @Nonnull @Override public TransitMode getMode() { return first.getMode(); } - @Nonnull @Override public Route getRoute() { return first.getRoute(); } - @Nonnull @Override public Trip getTrip() { return first.getTrip(); diff --git a/src/ext/java/org/opentripplanner/ext/fares/impl/GtfsFaresV2Service.java b/src/ext/java/org/opentripplanner/ext/fares/impl/GtfsFaresV2Service.java index 6aad14179b4..5bff64f05e0 100644 --- a/src/ext/java/org/opentripplanner/ext/fares/impl/GtfsFaresV2Service.java +++ b/src/ext/java/org/opentripplanner/ext/fares/impl/GtfsFaresV2Service.java @@ -13,7 +13,6 @@ import java.util.Set; import java.util.function.Function; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import org.opentripplanner.ext.fares.model.FareDistance; import org.opentripplanner.ext.fares.model.FareLegRule; import org.opentripplanner.ext.fares.model.FareTransferRule; @@ -210,7 +209,7 @@ private boolean transferRuleMatchesNextLeg( .orElse(false); } - private Optional getFareLegRuleByGroupId(@Nonnull FeedScopedId groupId) { + private Optional getFareLegRuleByGroupId(FeedScopedId groupId) { return legRules.stream().filter(lr -> groupId.equals(lr.legGroupId())).findAny(); } diff --git a/src/ext/java/org/opentripplanner/ext/fares/model/FareAttribute.java b/src/ext/java/org/opentripplanner/ext/fares/model/FareAttribute.java index 2c93fb016fa..39a6c0bd1d0 100644 --- a/src/ext/java/org/opentripplanner/ext/fares/model/FareAttribute.java +++ b/src/ext/java/org/opentripplanner/ext/fares/model/FareAttribute.java @@ -2,7 +2,6 @@ package org.opentripplanner.ext.fares.model; import java.util.Objects; -import javax.annotation.Nonnull; import org.opentripplanner.transit.model.basic.Money; import org.opentripplanner.transit.model.framework.AbstractTransitEntity; import org.opentripplanner.transit.model.framework.FeedScopedId; @@ -77,7 +76,7 @@ public Integer getJourneyDuration() { } @Override - public boolean sameAs(@Nonnull FareAttribute other) { + public boolean sameAs(FareAttribute other) { return ( getId().equals(other.getId()) && getPrice().equals(other.getPrice()) && @@ -88,7 +87,6 @@ public boolean sameAs(@Nonnull FareAttribute other) { ); } - @Nonnull @Override public FareAttributeBuilder copy() { return new FareAttributeBuilder(this); diff --git a/src/ext/java/org/opentripplanner/ext/fares/model/FareLegRule.java b/src/ext/java/org/opentripplanner/ext/fares/model/FareLegRule.java index 28ef5dcab6c..984dcb0291a 100644 --- a/src/ext/java/org/opentripplanner/ext/fares/model/FareLegRule.java +++ b/src/ext/java/org/opentripplanner/ext/fares/model/FareLegRule.java @@ -3,19 +3,18 @@ import java.util.Collection; import java.util.List; import java.util.Objects; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.model.fare.FareProduct; import org.opentripplanner.transit.model.framework.FeedScopedId; public record FareLegRule( - @Nonnull FeedScopedId id, + FeedScopedId id, @Nullable FeedScopedId legGroupId, @Nullable String networkId, @Nullable String fromAreaId, @Nullable String toAreaId, @Nullable FareDistance fareDistance, - @Nonnull Collection fareProducts + Collection fareProducts ) { public FareLegRule { Objects.requireNonNull(id); diff --git a/src/ext/java/org/opentripplanner/ext/fares/model/FareTransferRule.java b/src/ext/java/org/opentripplanner/ext/fares/model/FareTransferRule.java index d3b2020771f..87917bc819c 100644 --- a/src/ext/java/org/opentripplanner/ext/fares/model/FareTransferRule.java +++ b/src/ext/java/org/opentripplanner/ext/fares/model/FareTransferRule.java @@ -2,18 +2,17 @@ import java.time.Duration; import java.util.Collection; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.model.fare.FareProduct; import org.opentripplanner.transit.model.framework.FeedScopedId; public record FareTransferRule( - @Nonnull FeedScopedId id, + FeedScopedId id, @Nullable FeedScopedId fromLegGroup, @Nullable FeedScopedId toLegGroup, int transferCount, @Nullable Duration timeLimit, - @Nonnull Collection fareProducts + Collection fareProducts ) { public String feedId() { return id.getFeedId(); diff --git a/src/ext/java/org/opentripplanner/ext/flex/AreaStopsToVerticesMapper.java b/src/ext/java/org/opentripplanner/ext/flex/AreaStopsToVerticesMapper.java index 612fb7a1d29..8b969c99344 100644 --- a/src/ext/java/org/opentripplanner/ext/flex/AreaStopsToVerticesMapper.java +++ b/src/ext/java/org/opentripplanner/ext/flex/AreaStopsToVerticesMapper.java @@ -4,7 +4,6 @@ import com.google.common.collect.ImmutableMultimap; import jakarta.inject.Inject; import java.util.stream.Stream; -import javax.annotation.Nonnull; import org.locationtech.jts.geom.Point; import org.opentripplanner.framework.geometry.GeometryUtils; import org.opentripplanner.framework.logging.ProgressTracker; @@ -77,7 +76,6 @@ public void buildGraph() { LOG.info(progress.completeMessage()); } - @Nonnull private static Stream matchingVerticesForStop( StreetIndex streetIndex, AreaStop areaStop diff --git a/src/ext/java/org/opentripplanner/ext/flex/FlexibleTransitLeg.java b/src/ext/java/org/opentripplanner/ext/flex/FlexibleTransitLeg.java index 0544a46da72..24f996ca5fe 100644 --- a/src/ext/java/org/opentripplanner/ext/flex/FlexibleTransitLeg.java +++ b/src/ext/java/org/opentripplanner/ext/flex/FlexibleTransitLeg.java @@ -6,7 +6,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import javax.annotation.Nonnull; import org.locationtech.jts.geom.LineString; import org.opentripplanner.ext.flex.edgetype.FlexTripEdge; import org.opentripplanner.framework.i18n.I18NString; @@ -96,7 +95,6 @@ public LegTime end() { } @Override - @Nonnull public TransitMode getMode() { return getTrip().getMode(); } diff --git a/src/ext/java/org/opentripplanner/ext/flex/edgetype/FlexTripEdge.java b/src/ext/java/org/opentripplanner/ext/flex/edgetype/FlexTripEdge.java index 40201295d7b..70b0fcdcb3c 100644 --- a/src/ext/java/org/opentripplanner/ext/flex/edgetype/FlexTripEdge.java +++ b/src/ext/java/org/opentripplanner/ext/flex/edgetype/FlexTripEdge.java @@ -2,7 +2,6 @@ import java.time.LocalDate; import java.util.Objects; -import javax.annotation.Nonnull; import org.locationtech.jts.geom.LineString; import org.opentripplanner.ext.flex.flexpathcalculator.FlexPath; import org.opentripplanner.ext.flex.trip.FlexTrip; @@ -92,7 +91,6 @@ public double getDistanceMeters() { } @Override - @Nonnull public State[] traverse(State s0) { StateEditor editor = s0.edit(this); editor.setBackMode(TraverseMode.FLEX); diff --git a/src/ext/java/org/opentripplanner/ext/flex/trip/FlexTrip.java b/src/ext/java/org/opentripplanner/ext/flex/trip/FlexTrip.java index 8fdb1b8fd5c..caceab676ce 100644 --- a/src/ext/java/org/opentripplanner/ext/flex/trip/FlexTrip.java +++ b/src/ext/java/org/opentripplanner/ext/flex/trip/FlexTrip.java @@ -3,7 +3,6 @@ import java.util.List; import java.util.Objects; import java.util.Set; -import javax.annotation.Nonnull; import org.opentripplanner.ext.flex.flexpathcalculator.FlexPathCalculator; import org.opentripplanner.model.PickDrop; import org.opentripplanner.model.StopTime; @@ -140,7 +139,7 @@ public abstract FlexPathCalculator decorateFlexPathCalculator( ); @Override - public boolean sameAs(@Nonnull T other) { + public boolean sameAs(T other) { return getId().equals(other.getId()) && Objects.equals(trip, other.getTrip()); } } diff --git a/src/ext/java/org/opentripplanner/ext/flex/trip/ScheduledDeviatedTrip.java b/src/ext/java/org/opentripplanner/ext/flex/trip/ScheduledDeviatedTrip.java index 5ea0cb9fb91..c8484532b68 100644 --- a/src/ext/java/org/opentripplanner/ext/flex/trip/ScheduledDeviatedTrip.java +++ b/src/ext/java/org/opentripplanner/ext/flex/trip/ScheduledDeviatedTrip.java @@ -9,7 +9,6 @@ import java.util.Set; import java.util.function.Predicate; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import org.opentripplanner.ext.flex.flexpathcalculator.FlexPathCalculator; import org.opentripplanner.ext.flex.flexpathcalculator.ScheduledFlexPathCalculator; import org.opentripplanner.model.PickDrop; @@ -152,7 +151,7 @@ public boolean isAlightingPossible(StopLocation toStop) { } @Override - public boolean sameAs(@Nonnull ScheduledDeviatedTrip other) { + public boolean sameAs(ScheduledDeviatedTrip other) { return ( super.sameAs(other) && Arrays.equals(stopTimes, other.stopTimes) && @@ -161,7 +160,6 @@ public boolean sameAs(@Nonnull ScheduledDeviatedTrip other) { ); } - @Nonnull @Override public TransitBuilder copy() { return new ScheduledDeviatedTripBuilder(this); diff --git a/src/ext/java/org/opentripplanner/ext/flex/trip/UnscheduledTrip.java b/src/ext/java/org/opentripplanner/ext/flex/trip/UnscheduledTrip.java index 20a77bb94ed..30c79ac0d1a 100644 --- a/src/ext/java/org/opentripplanner/ext/flex/trip/UnscheduledTrip.java +++ b/src/ext/java/org/opentripplanner/ext/flex/trip/UnscheduledTrip.java @@ -10,7 +10,6 @@ import java.util.Set; import java.util.function.Predicate; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import org.opentripplanner.ext.flex.flexpathcalculator.FlexPathCalculator; import org.opentripplanner.ext.flex.flexpathcalculator.TimePenaltyCalculator; import org.opentripplanner.framework.lang.DoubleUtils; @@ -197,7 +196,7 @@ public boolean isAlightingPossible(StopLocation stop) { } @Override - public boolean sameAs(@Nonnull UnscheduledTrip other) { + public boolean sameAs(UnscheduledTrip other) { return ( super.sameAs(other) && Arrays.equals(stopTimes, other.stopTimes) && @@ -206,7 +205,6 @@ public boolean sameAs(@Nonnull UnscheduledTrip other) { ); } - @Nonnull @Override public TransitBuilder copy() { return new UnscheduledTripBuilder(this); diff --git a/src/ext/java/org/opentripplanner/ext/reportapi/model/CachedValue.java b/src/ext/java/org/opentripplanner/ext/reportapi/model/CachedValue.java index 6a7dac61b23..acf5758fa66 100644 --- a/src/ext/java/org/opentripplanner/ext/reportapi/model/CachedValue.java +++ b/src/ext/java/org/opentripplanner/ext/reportapi/model/CachedValue.java @@ -3,7 +3,6 @@ import java.time.Duration; import java.time.Instant; import java.util.function.Supplier; -import javax.annotation.Nonnull; /** * The purpose of this class is to be a generic container for caching expensive computations. @@ -16,7 +15,7 @@ public class CachedValue { private T value; private Instant timeout; - public CachedValue(@Nonnull Duration cacheInterval) { + public CachedValue(Duration cacheInterval) { this.value = null; this.cacheInterval = cacheInterval; this.timeout = calculateTimeout(); @@ -27,7 +26,7 @@ public CachedValue(@Nonnull Duration cacheInterval) { *

* Otherwise, recompute and return it. */ - public T get(@Nonnull Supplier supplier) { + public T get(Supplier supplier) { synchronized (this) { if (hasExpired()) { this.value = supplier.get(); diff --git a/src/ext/java/org/opentripplanner/ext/reportapi/model/GraphReportBuilder.java b/src/ext/java/org/opentripplanner/ext/reportapi/model/GraphReportBuilder.java index 57d0872b9bd..7f819c70792 100644 --- a/src/ext/java/org/opentripplanner/ext/reportapi/model/GraphReportBuilder.java +++ b/src/ext/java/org/opentripplanner/ext/reportapi/model/GraphReportBuilder.java @@ -4,7 +4,6 @@ import java.util.HashMap; import java.util.Map; import java.util.function.Function; -import javax.annotation.Nonnull; import org.opentripplanner.standalone.api.OtpServerRequestContext; public class GraphReportBuilder { @@ -50,13 +49,11 @@ public static GraphStats build(OtpServerRequestContext context) { ); } - @Nonnull private static String firstLetterToLowerCase(Object instance) { var className = instance.getClass().getSimpleName(); return Character.toLowerCase(className.charAt(0)) + className.substring(1); } - @Nonnull private static TypeStats countValues(Collection input, Function classify) { Map result = new HashMap<>(); input.forEach(item -> { diff --git a/src/ext/java/org/opentripplanner/ext/reportapi/model/TransfersReport.java b/src/ext/java/org/opentripplanner/ext/reportapi/model/TransfersReport.java index 2cfe1b19c1c..e53cd6c3c58 100644 --- a/src/ext/java/org/opentripplanner/ext/reportapi/model/TransfersReport.java +++ b/src/ext/java/org/opentripplanner/ext/reportapi/model/TransfersReport.java @@ -4,7 +4,6 @@ import java.util.List; import java.util.Optional; -import javax.annotation.Nonnull; import org.opentripplanner.framework.geometry.SphericalDistanceLibrary; import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.I18NString; @@ -196,7 +195,6 @@ private TxPoint pointInfo(TransferPoint p, boolean boarding) { return r; } - @Nonnull private static String getName(Operator operator) { return Optional.ofNullable(operator).map(o -> o.getId().getId()).orElse(""); } diff --git a/src/ext/java/org/opentripplanner/ext/ridehailing/model/RideHailingLeg.java b/src/ext/java/org/opentripplanner/ext/ridehailing/model/RideHailingLeg.java index 91a7a1fbf6f..94587333c4e 100644 --- a/src/ext/java/org/opentripplanner/ext/ridehailing/model/RideHailingLeg.java +++ b/src/ext/java/org/opentripplanner/ext/ridehailing/model/RideHailingLeg.java @@ -1,6 +1,5 @@ package org.opentripplanner.ext.ridehailing.model; -import javax.annotation.Nonnull; import org.opentripplanner.model.plan.StreetLeg; import org.opentripplanner.model.plan.StreetLegBuilder; @@ -27,7 +26,6 @@ public RideHailingProvider provider() { return provider; } - @Nonnull public RideEstimate rideEstimate() { return estimate; } diff --git a/src/ext/java/org/opentripplanner/ext/ridehailing/service/uber/UberService.java b/src/ext/java/org/opentripplanner/ext/ridehailing/service/uber/UberService.java index 9b276fc053e..d5ab1e8c5fa 100644 --- a/src/ext/java/org/opentripplanner/ext/ridehailing/service/uber/UberService.java +++ b/src/ext/java/org/opentripplanner/ext/ridehailing/service/uber/UberService.java @@ -13,7 +13,6 @@ import java.util.Currency; import java.util.List; import java.util.Map; -import javax.annotation.Nonnull; import org.opentripplanner.ext.ridehailing.CachingRideHailingService; import org.opentripplanner.ext.ridehailing.RideHailingServiceParameters; import org.opentripplanner.ext.ridehailing.model.ArrivalTime; @@ -191,7 +190,6 @@ private boolean filterRides(Ride a, boolean wheelchairAccessible) { } } - @Nonnull private Map headers() throws IOException { return Map.ofEntries( entry(AUTHORIZATION, "Bearer %s".formatted(oauthService.getToken())), diff --git a/src/ext/java/org/opentripplanner/ext/siri/AddedTripBuilder.java b/src/ext/java/org/opentripplanner/ext/siri/AddedTripBuilder.java index ed2378a839d..a6894f0748a 100644 --- a/src/ext/java/org/opentripplanner/ext/siri/AddedTripBuilder.java +++ b/src/ext/java/org/opentripplanner/ext/siri/AddedTripBuilder.java @@ -14,7 +14,6 @@ import java.util.List; import java.util.Objects; import java.util.function.Function; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.ext.siri.mapper.PickDropMapper; import org.opentripplanner.framework.i18n.NonLocalizedString; @@ -286,7 +285,6 @@ Result build() { * * @return a new Route */ - @Nonnull private Route createRoute(Agency agency) { var routeBuilder = Route.of(entityResolver.resolveId(lineRef)); diff --git a/src/ext/java/org/opentripplanner/ext/siri/SiriFuzzyTripMatcher.java b/src/ext/java/org/opentripplanner/ext/siri/SiriFuzzyTripMatcher.java index ed5e9818b32..5ce0b114371 100644 --- a/src/ext/java/org/opentripplanner/ext/siri/SiriFuzzyTripMatcher.java +++ b/src/ext/java/org/opentripplanner/ext/siri/SiriFuzzyTripMatcher.java @@ -10,7 +10,6 @@ import java.util.Set; import java.util.function.BiFunction; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.model.Timetable; @@ -196,7 +195,6 @@ private static String createStartStopKey(String lastStopId, int lastStopArrivalT return lastStopId + ":" + lastStopArrivalTime; } - @Nonnull private Set getMatchingTripsOnStopOrSiblings( String lastStopPoint, ZonedDateTime arrivalTime, diff --git a/src/ext/java/org/opentripplanner/ext/siri/SiriTripPatternCache.java b/src/ext/java/org/opentripplanner/ext/siri/SiriTripPatternCache.java index 40c008d0004..01ae306b861 100644 --- a/src/ext/java/org/opentripplanner/ext/siri/SiriTripPatternCache.java +++ b/src/ext/java/org/opentripplanner/ext/siri/SiriTripPatternCache.java @@ -4,7 +4,6 @@ import java.util.HashMap; import java.util.Map; import java.util.function.Function; -import javax.annotation.Nonnull; import org.opentripplanner.transit.model.network.StopPattern; import org.opentripplanner.transit.model.network.TripPattern; import org.opentripplanner.transit.model.timetable.Trip; @@ -71,9 +70,9 @@ public SiriTripPatternCache( * @return cached or newly created trip pattern */ public synchronized TripPattern getOrCreateTripPattern( - @Nonnull final StopPattern stopPattern, - @Nonnull final Trip trip, - @Nonnull LocalDate serviceDate + final StopPattern stopPattern, + final Trip trip, + LocalDate serviceDate ) { TripPattern originalTripPattern = getPatternForTrip.apply(trip); diff --git a/src/ext/java/org/opentripplanner/ext/siri/updater/google/SiriETGooglePubsubUpdaterParameters.java b/src/ext/java/org/opentripplanner/ext/siri/updater/google/SiriETGooglePubsubUpdaterParameters.java index c9e070311c6..934b6d311c8 100644 --- a/src/ext/java/org/opentripplanner/ext/siri/updater/google/SiriETGooglePubsubUpdaterParameters.java +++ b/src/ext/java/org/opentripplanner/ext/siri/updater/google/SiriETGooglePubsubUpdaterParameters.java @@ -2,13 +2,12 @@ import java.time.Duration; import java.util.Objects; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.updater.trip.UrlUpdaterParameters; public record SiriETGooglePubsubUpdaterParameters( - @Nonnull String configRef, + String configRef, @Nullable String feedId, String subscriptionProjectName, String topicProjectName, diff --git a/src/ext/java/org/opentripplanner/ext/smoovebikerental/SmooveBikeRentalDataSourceParameters.java b/src/ext/java/org/opentripplanner/ext/smoovebikerental/SmooveBikeRentalDataSourceParameters.java index ca0f5497601..5aa834554c7 100644 --- a/src/ext/java/org/opentripplanner/ext/smoovebikerental/SmooveBikeRentalDataSourceParameters.java +++ b/src/ext/java/org/opentripplanner/ext/smoovebikerental/SmooveBikeRentalDataSourceParameters.java @@ -1,6 +1,5 @@ package org.opentripplanner.ext.smoovebikerental; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.updater.spi.HttpHeaders; import org.opentripplanner.updater.vehicle_rental.VehicleRentalSourceType; @@ -26,7 +25,6 @@ public String getNetwork(String defaultValue) { return network == null || network.isEmpty() ? defaultValue : network; } - @Nonnull @Override public VehicleRentalSourceType sourceType() { return VehicleRentalSourceType.SMOOVE; diff --git a/src/ext/java/org/opentripplanner/ext/stopconsolidation/StopConsolidationModule.java b/src/ext/java/org/opentripplanner/ext/stopconsolidation/StopConsolidationModule.java index 100941d88d4..7f5cf431a4c 100644 --- a/src/ext/java/org/opentripplanner/ext/stopconsolidation/StopConsolidationModule.java +++ b/src/ext/java/org/opentripplanner/ext/stopconsolidation/StopConsolidationModule.java @@ -4,7 +4,6 @@ import java.util.Collection; import java.util.List; import java.util.Objects; -import javax.annotation.Nonnull; import org.opentripplanner.datastore.api.DataSource; import org.opentripplanner.ext.stopconsolidation.internal.DefaultStopConsolidationService; import org.opentripplanner.ext.stopconsolidation.model.ConsolidatedStopGroup; @@ -62,7 +61,6 @@ public void buildGraph() { }); } - @Nonnull private TripPattern modifyStopsInPattern( TripPattern pattern, List replacements diff --git a/src/ext/java/org/opentripplanner/ext/stopconsolidation/internal/DefaultStopConsolidationService.java b/src/ext/java/org/opentripplanner/ext/stopconsolidation/internal/DefaultStopConsolidationService.java index 9f31e366be5..53a0f8ed827 100644 --- a/src/ext/java/org/opentripplanner/ext/stopconsolidation/internal/DefaultStopConsolidationService.java +++ b/src/ext/java/org/opentripplanner/ext/stopconsolidation/internal/DefaultStopConsolidationService.java @@ -4,7 +4,6 @@ import java.util.Objects; import java.util.Optional; import java.util.stream.Stream; -import javax.annotation.Nonnull; import org.opentripplanner.ext.stopconsolidation.StopConsolidationRepository; import org.opentripplanner.ext.stopconsolidation.StopConsolidationService; import org.opentripplanner.ext.stopconsolidation.model.ConsolidatedStopGroup; @@ -86,7 +85,6 @@ public StopLocation agencySpecificStop(StopLocation stop, Agency agency) { } } - @Nonnull private Optional findAgencySpecificStop(StopLocation stop, Agency agency) { return repo .groups() diff --git a/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/DigitransitVehicleParkingPropertyMapper.java b/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/DigitransitVehicleParkingPropertyMapper.java index 892d4907395..951552e1fdc 100644 --- a/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/DigitransitVehicleParkingPropertyMapper.java +++ b/src/ext/java/org/opentripplanner/ext/vectortiles/layers/vehicleparkings/DigitransitVehicleParkingPropertyMapper.java @@ -4,7 +4,6 @@ import java.util.Collection; import java.util.List; import java.util.Locale; -import javax.annotation.Nonnull; import org.opentripplanner.apis.support.mapping.PropertyMapper; import org.opentripplanner.framework.i18n.I18NStringMapper; import org.opentripplanner.inspector.vector.KeyValue; @@ -27,7 +26,6 @@ protected Collection map(VehicleParking vehicleParking) { return basicMapping(vehicleParking); } - @Nonnull protected ArrayList basicMapping(VehicleParking vehicleParking) { return new ArrayList<>( List.of( diff --git a/src/main/java/org/opentripplanner/apis/gtfs/GraphQLRequestContext.java b/src/main/java/org/opentripplanner/apis/gtfs/GraphQLRequestContext.java index dfc3e2d75f8..192cbb26aa9 100644 --- a/src/main/java/org/opentripplanner/apis/gtfs/GraphQLRequestContext.java +++ b/src/main/java/org/opentripplanner/apis/gtfs/GraphQLRequestContext.java @@ -1,6 +1,5 @@ package org.opentripplanner.apis.gtfs; -import javax.annotation.Nonnull; import org.opentripplanner.routing.api.RoutingService; import org.opentripplanner.routing.api.request.RouteRequest; import org.opentripplanner.routing.fares.FareService; @@ -38,7 +37,6 @@ public static GraphQLRequestContext ofServerContext(OtpServerRequestContext cont * Returns a clone of the default route request. The clone is necessary because one HTTP * request can lead to several GraphQL queries, for example through batch or alias queries. */ - @Nonnull @Override public RouteRequest defaultRouteRequest() { return defaultRouteRequest.clone(); diff --git a/src/main/java/org/opentripplanner/apis/gtfs/GraphQLScalars.java b/src/main/java/org/opentripplanner/apis/gtfs/GraphQLScalars.java index 8ec3172db52..25953652365 100644 --- a/src/main/java/org/opentripplanner/apis/gtfs/GraphQLScalars.java +++ b/src/main/java/org/opentripplanner/apis/gtfs/GraphQLScalars.java @@ -16,7 +16,6 @@ import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; import java.util.Optional; -import javax.annotation.Nonnull; import org.locationtech.jts.geom.Geometry; import org.opentripplanner.framework.graphql.scalar.DateScalarFactory; import org.opentripplanner.framework.graphql.scalar.DurationScalarFactory; @@ -65,8 +64,7 @@ public String parseLiteral(Object input) { .coercing( new Coercing() { @Override - public String serialize(@Nonnull Object dataFetcherResult) - throws CoercingSerializeException { + public String serialize(Object dataFetcherResult) throws CoercingSerializeException { if (dataFetcherResult instanceof ZonedDateTime zdt) { return zdt.format(DateTimeFormatter.ISO_OFFSET_DATE_TIME); } else if (dataFetcherResult instanceof OffsetDateTime odt) { @@ -123,8 +121,7 @@ public OffsetDateTime parseLiteral(Object input) throws CoercingParseLiteralExce private static final String VALIDATION_ERROR_MESSAGE = "Not a valid WGS84 coordinate value"; @Override - public Double serialize(@Nonnull Object dataFetcherResult) - throws CoercingSerializeException { + public Double serialize(Object dataFetcherResult) throws CoercingSerializeException { if (dataFetcherResult instanceof Double doubleValue) { return doubleValue; } else if (dataFetcherResult instanceof Float floatValue) { @@ -188,8 +185,7 @@ private static Optional validateCoordinate(double coordinate) { "Cost cannot be negative or greater than %d".formatted(MAX_COST); @Override - public Integer serialize(@Nonnull Object dataFetcherResult) - throws CoercingSerializeException { + public Integer serialize(Object dataFetcherResult) throws CoercingSerializeException { if (dataFetcherResult instanceof Integer intValue) { return intValue; } else if (dataFetcherResult instanceof Cost costValue) { @@ -358,8 +354,7 @@ public Grams parseLiteral(Object input) throws CoercingParseLiteralException { "Value is under 0 or greater than 1."; @Override - public Double serialize(@Nonnull Object dataFetcherResult) - throws CoercingSerializeException { + public Double serialize(Object dataFetcherResult) throws CoercingSerializeException { var validationException = new CoercingSerializeException(VALIDATION_ERROR_MESSAGE); if (dataFetcherResult instanceof Double doubleValue) { return validateRatio(doubleValue).orElseThrow(() -> validationException); @@ -425,8 +420,7 @@ private static Optional validateRatio(double ratio) { "Reluctance needs to be between %s and %s".formatted(MIN_Reluctance, MAX_Reluctance); @Override - public Double serialize(@Nonnull Object dataFetcherResult) - throws CoercingSerializeException { + public Double serialize(Object dataFetcherResult) throws CoercingSerializeException { if (dataFetcherResult instanceof Double doubleValue) { return doubleValue; } else if (dataFetcherResult instanceof Float floatValue) { diff --git a/src/main/java/org/opentripplanner/apis/gtfs/mapping/BikesAllowedMapper.java b/src/main/java/org/opentripplanner/apis/gtfs/mapping/BikesAllowedMapper.java index cd04601d599..79f55f1e50a 100644 --- a/src/main/java/org/opentripplanner/apis/gtfs/mapping/BikesAllowedMapper.java +++ b/src/main/java/org/opentripplanner/apis/gtfs/mapping/BikesAllowedMapper.java @@ -1,13 +1,11 @@ package org.opentripplanner.apis.gtfs.mapping; -import javax.annotation.Nonnull; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLBikesAllowed; import org.opentripplanner.transit.model.network.BikeAccess; public class BikesAllowedMapper { - @Nonnull - public static GraphQLBikesAllowed map(@Nonnull BikeAccess bikesAllowed) { + public static GraphQLBikesAllowed map(BikeAccess bikesAllowed) { return switch (bikesAllowed) { case UNKNOWN -> GraphQLBikesAllowed.NO_INFORMATION; case ALLOWED -> GraphQLBikesAllowed.ALLOWED; diff --git a/src/main/java/org/opentripplanner/apis/gtfs/mapping/DirectionMapper.java b/src/main/java/org/opentripplanner/apis/gtfs/mapping/DirectionMapper.java index 1deb6e3bb0e..69a78b05f55 100644 --- a/src/main/java/org/opentripplanner/apis/gtfs/mapping/DirectionMapper.java +++ b/src/main/java/org/opentripplanner/apis/gtfs/mapping/DirectionMapper.java @@ -1,6 +1,5 @@ package org.opentripplanner.apis.gtfs.mapping; -import javax.annotation.Nonnull; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLAbsoluteDirection; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLRelativeDirection; @@ -9,7 +8,6 @@ public final class DirectionMapper { - @Nonnull public static GraphQLAbsoluteDirection map(AbsoluteDirection dir) { return switch (dir) { case NORTH -> GraphQLAbsoluteDirection.NORTH; @@ -23,7 +21,6 @@ public static GraphQLAbsoluteDirection map(AbsoluteDirection dir) { }; } - @Nonnull public static GraphQLRelativeDirection map(RelativeDirection relativeDirection) { return switch (relativeDirection) { case DEPART -> GraphQLRelativeDirection.DEPART; diff --git a/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/ArgumentUtils.java b/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/ArgumentUtils.java index b04affeaaf2..8541bd1c3c5 100644 --- a/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/ArgumentUtils.java +++ b/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/ArgumentUtils.java @@ -7,7 +7,6 @@ import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes; @@ -63,7 +62,6 @@ static Map getParking(DataFetchingEnvironment environment, Strin *

* TODO this ugliness can be removed when the bug gets fixed */ - @Nonnull static Collection> getParkingFilters( DataFetchingEnvironment environment, String type @@ -83,7 +81,6 @@ static Collection> getParkingFilters( *

* TODO this ugliness can be removed when the bug gets fixed */ - @Nonnull static Collection> getParkingPreferred( DataFetchingEnvironment environment, String type @@ -103,7 +100,6 @@ static Set parseSelectFilters(Collection> filters) { return parseFilters(filters, "select"); } - @Nonnull private static Set parseFilters(Collection> filters, String key) { return filters .stream() diff --git a/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/LegacyRouteRequestMapper.java b/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/LegacyRouteRequestMapper.java index 050127d9a27..696ce9c45b5 100644 --- a/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/LegacyRouteRequestMapper.java +++ b/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/LegacyRouteRequestMapper.java @@ -12,7 +12,6 @@ import java.util.Map; import java.util.function.Consumer; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import org.opentripplanner.api.common.LocationStringParser; import org.opentripplanner.api.parameter.QualifiedMode; import org.opentripplanner.api.parameter.QualifiedModeSet; @@ -35,7 +34,6 @@ public class LegacyRouteRequestMapper { - @Nonnull public static RouteRequest toRouteRequest( DataFetchingEnvironment environment, GraphQLRequestContext context diff --git a/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/OptimizationTypeMapper.java b/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/OptimizationTypeMapper.java index dc17891f9d2..6e848ce7f66 100644 --- a/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/OptimizationTypeMapper.java +++ b/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/OptimizationTypeMapper.java @@ -1,12 +1,10 @@ package org.opentripplanner.apis.gtfs.mapping.routerequest; -import javax.annotation.Nonnull; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes; import org.opentripplanner.routing.core.VehicleRoutingOptimizeType; public final class OptimizationTypeMapper { - @Nonnull public static VehicleRoutingOptimizeType map(GraphQLTypes.GraphQLOptimizeType optimizeType) { return switch (optimizeType) { case QUICK -> VehicleRoutingOptimizeType.SHORTEST_DURATION; diff --git a/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/RouteRequestMapper.java b/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/RouteRequestMapper.java index ada358d98b3..7a13d8d38a0 100644 --- a/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/RouteRequestMapper.java +++ b/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/RouteRequestMapper.java @@ -9,7 +9,6 @@ import graphql.schema.DataFetchingEnvironment; import java.time.Instant; -import javax.annotation.Nonnull; import org.opentripplanner.apis.gtfs.GraphQLRequestContext; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes; import org.opentripplanner.framework.graphql.GraphQLUtils; @@ -22,7 +21,6 @@ public class RouteRequestMapper { - @Nonnull public static RouteRequest toRouteRequest( DataFetchingEnvironment environment, GraphQLRequestContext context diff --git a/src/main/java/org/opentripplanner/apis/transmodel/mapping/TransitIdMapper.java b/src/main/java/org/opentripplanner/apis/transmodel/mapping/TransitIdMapper.java index 1554a8c9d7c..1231ebd73b6 100644 --- a/src/main/java/org/opentripplanner/apis/transmodel/mapping/TransitIdMapper.java +++ b/src/main/java/org/opentripplanner/apis/transmodel/mapping/TransitIdMapper.java @@ -4,7 +4,6 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.framework.lang.StringUtils; import org.opentripplanner.transit.model.framework.AbstractTransitEntity; @@ -39,7 +38,6 @@ public static String mapIDToApi(FeedScopedId id) { * Return an empty collection if the collection of ids is null. * If the collection of ids contains null or blank elements, they are ignored. */ - @Nonnull public static List mapIDsToDomainNullSafe(@Nullable Collection ids) { if (ids == null) { return List.of(); diff --git a/src/main/java/org/opentripplanner/apis/transmodel/model/scalars/DateTimeScalarFactory.java b/src/main/java/org/opentripplanner/apis/transmodel/model/scalars/DateTimeScalarFactory.java index 9738a277a41..f539715206e 100644 --- a/src/main/java/org/opentripplanner/apis/transmodel/model/scalars/DateTimeScalarFactory.java +++ b/src/main/java/org/opentripplanner/apis/transmodel/model/scalars/DateTimeScalarFactory.java @@ -12,7 +12,6 @@ import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; import java.time.temporal.TemporalAccessor; -import javax.annotation.Nonnull; import org.opentripplanner.framework.time.OffsetDateTimeParser; public final class DateTimeScalarFactory { @@ -41,7 +40,7 @@ public static GraphQLScalarType createMillisecondsSinceEpochAsDateTimeStringScal .coercing( new Coercing<>() { @Override - public String serialize(@Nonnull Object input) { + public String serialize(Object input) { if (input instanceof Long inputAsLong) { return Instant.ofEpochMilli(inputAsLong).atZone(timeZone).format(FORMATTER); } @@ -49,7 +48,7 @@ public String serialize(@Nonnull Object input) { } @Override - public Long parseValue(@Nonnull Object input) { + public Long parseValue(Object input) { Instant instant = null; if (input instanceof CharSequence inputAsCharSequence) { try { @@ -80,7 +79,7 @@ public Long parseValue(@Nonnull Object input) { } @Override - public Long parseLiteral(@Nonnull Object input) { + public Long parseLiteral(Object input) { if (input instanceof StringValue inputAsStringValue) { return parseValue(inputAsStringValue.getValue()); } diff --git a/src/main/java/org/opentripplanner/apis/transmodel/model/scalars/DoubleFunctionFactory.java b/src/main/java/org/opentripplanner/apis/transmodel/model/scalars/DoubleFunctionFactory.java index fd45b001642..5259c0dd9db 100644 --- a/src/main/java/org/opentripplanner/apis/transmodel/model/scalars/DoubleFunctionFactory.java +++ b/src/main/java/org/opentripplanner/apis/transmodel/model/scalars/DoubleFunctionFactory.java @@ -10,7 +10,6 @@ import graphql.schema.GraphQLScalarType; import java.util.Locale; import java.util.NoSuchElementException; -import javax.annotation.Nonnull; import org.opentripplanner.routing.api.request.framework.LinearFunctionSerialization; public class DoubleFunctionFactory { @@ -40,9 +39,9 @@ public static GraphQLScalarType createDoubleFunctionScalar() { new Coercing() { @Override public String serialize( - @Nonnull Object dataFetcherResult, - @Nonnull GraphQLContext graphQLContext, - @Nonnull Locale locale + Object dataFetcherResult, + GraphQLContext graphQLContext, + Locale locale ) { var value = (DoubleFunction) dataFetcherResult; return LinearFunctionSerialization.serialize(value.constant(), value.coefficient()); @@ -50,9 +49,9 @@ public String serialize( @Override public DoubleFunction parseValue( - @Nonnull Object input, - @Nonnull GraphQLContext graphQLContext, - @Nonnull Locale locale + Object input, + GraphQLContext graphQLContext, + Locale locale ) throws CoercingParseValueException { try { String text = (String) input; @@ -64,10 +63,10 @@ public DoubleFunction parseValue( @Override public DoubleFunction parseLiteral( - @Nonnull Value input, - @Nonnull CoercedVariables variables, - @Nonnull GraphQLContext graphQLContext, - @Nonnull Locale locale + Value input, + CoercedVariables variables, + GraphQLContext graphQLContext, + Locale locale ) throws CoercingParseLiteralException { if (input instanceof StringValue stringValue) { return parseValue(stringValue.getValue(), graphQLContext, locale); diff --git a/src/main/java/org/opentripplanner/apis/vectortiles/GraphInspectorVectorTileResource.java b/src/main/java/org/opentripplanner/apis/vectortiles/GraphInspectorVectorTileResource.java index f97830232bd..26863157353 100644 --- a/src/main/java/org/opentripplanner/apis/vectortiles/GraphInspectorVectorTileResource.java +++ b/src/main/java/org/opentripplanner/apis/vectortiles/GraphInspectorVectorTileResource.java @@ -23,7 +23,6 @@ import java.util.Objects; import java.util.function.Predicate; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import org.glassfish.grizzly.http.server.Request; import org.opentripplanner.apis.support.TileJson; import org.opentripplanner.apis.vectortiles.model.LayerParams; @@ -164,7 +163,6 @@ private String tileJsonUrl(String base, List> layers) ); } - @Nonnull private List feedInfos() { return serverContext .transitService() diff --git a/src/main/java/org/opentripplanner/astar/AStar.java b/src/main/java/org/opentripplanner/astar/AStar.java index 1b4c69bfc16..9c14669a159 100644 --- a/src/main/java/org/opentripplanner/astar/AStar.java +++ b/src/main/java/org/opentripplanner/astar/AStar.java @@ -7,7 +7,6 @@ import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import org.opentripplanner.astar.model.BinHeap; import org.opentripplanner.astar.model.GraphPath; import org.opentripplanner.astar.model.ShortestPathTree; @@ -63,7 +62,7 @@ public class AStar< Set toVertices, SearchTerminationStrategy terminationStrategy, DominanceFunction dominanceFunction, - @Nonnull Duration timeout, + Duration timeout, Collection initialStates ) { this.heuristic = heuristic; diff --git a/src/main/java/org/opentripplanner/astar/AStarBuilder.java b/src/main/java/org/opentripplanner/astar/AStarBuilder.java index a4b0ac32389..349b7185b29 100644 --- a/src/main/java/org/opentripplanner/astar/AStarBuilder.java +++ b/src/main/java/org/opentripplanner/astar/AStarBuilder.java @@ -6,7 +6,6 @@ import java.util.List; import java.util.Optional; import java.util.Set; -import javax.annotation.Nonnull; import org.opentripplanner.astar.model.GraphPath; import org.opentripplanner.astar.model.ShortestPathTree; import org.opentripplanner.astar.spi.AStarEdge; @@ -98,7 +97,6 @@ public Builder setDominanceFunction(DominanceFunction dominanceFunction) return builder; } - @Nonnull protected abstract Duration streetRoutingTimeout(); public Builder setOriginBackEdge(Edge originBackEdge) { diff --git a/src/main/java/org/opentripplanner/astar/spi/AStarEdge.java b/src/main/java/org/opentripplanner/astar/spi/AStarEdge.java index 91872021fc1..c4caafb19a9 100644 --- a/src/main/java/org/opentripplanner/astar/spi/AStarEdge.java +++ b/src/main/java/org/opentripplanner/astar/spi/AStarEdge.java @@ -1,7 +1,5 @@ package org.opentripplanner.astar.spi; -import javax.annotation.Nonnull; - /** * Represents an edge in the street network. Most edges have a one-to-one mapping to real world * things like street segments or stairs. @@ -43,6 +41,5 @@ public interface AStarEdge< * vehicle is speculatively dropped off and the passenger continues on foot in case * that the destination is inside the zone. */ - @Nonnull State[] traverse(State s0); } diff --git a/src/main/java/org/opentripplanner/datastore/OtpDataStore.java b/src/main/java/org/opentripplanner/datastore/OtpDataStore.java index 397d3f64c70..b85622de7f1 100644 --- a/src/main/java/org/opentripplanner/datastore/OtpDataStore.java +++ b/src/main/java/org/opentripplanner/datastore/OtpDataStore.java @@ -21,7 +21,6 @@ import java.util.Optional; import java.util.function.Function; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.datastore.api.CompositeDataSource; import org.opentripplanner.datastore.api.DataSource; @@ -135,25 +134,21 @@ public List getRepositoryDescriptions() { * @return The collection may contain elements of type {@link DataSource} or {@link * CompositeDataSource}. */ - @Nonnull public Collection listExistingSourcesFor(FileType type) { assertDataStoreIsOpened(); return sources.get(type).stream().filter(DataSource::exists).collect(Collectors.toList()); } - @Nonnull public DataSource getStreetGraph() { assertDataStoreIsOpened(); return streetGraph; } - @Nonnull public DataSource getGraph() { assertDataStoreIsOpened(); return graph; } - @Nonnull public CompositeDataSource getBuildReportDir() { assertDataStoreIsOpened(); return buildReportDir; @@ -188,11 +183,7 @@ private LocalDataSourceRepository getLocalDataSourceRepo( return localRepos.get(0); } - private DataSource findSingleSource( - @Nullable URI uri, - @Nonnull String filename, - @Nonnull FileType type - ) { + private DataSource findSingleSource(@Nullable URI uri, String filename, FileType type) { if (uri != null) { return findSourceUsingAllRepos(it -> it.findSource(uri, type)); } @@ -201,8 +192,8 @@ private DataSource findSingleSource( private CompositeDataSource findCompositeSource( @Nullable URI uri, - @Nonnull String filename, - @Nonnull FileType type + String filename, + FileType type ) { if (uri != null) { return findSourceUsingAllRepos(it -> it.findCompositeSource(uri, type)); @@ -211,10 +202,7 @@ private CompositeDataSource findCompositeSource( } } - private List findMultipleSources( - @Nonnull Collection uris, - @Nonnull FileType type - ) { + private List findMultipleSources(Collection uris, FileType type) { if (uris == null || uris.isEmpty()) { return localRepository.listExistingSources(type); } @@ -227,8 +215,8 @@ private List findMultipleSources( } private List findMultipleCompositeSources( - @Nonnull Collection uris, - @Nonnull FileType type + Collection uris, + FileType type ) { if (uris.isEmpty()) { return localRepository diff --git a/src/main/java/org/opentripplanner/datastore/api/OtpDataStoreConfig.java b/src/main/java/org/opentripplanner/datastore/api/OtpDataStoreConfig.java index 984d66de2e9..ac220d932d6 100644 --- a/src/main/java/org/opentripplanner/datastore/api/OtpDataStoreConfig.java +++ b/src/main/java/org/opentripplanner/datastore/api/OtpDataStoreConfig.java @@ -3,7 +3,6 @@ import java.net.URI; import java.util.List; import java.util.regex.Pattern; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.datastore.OtpDataStore; @@ -48,7 +47,6 @@ public interface OtpDataStoreConfig { *

* This parameter is optional. If {@code null} GTFS files are loaded from {@code baseDirectory}. */ - @Nonnull List gtfsFiles(); /** @@ -56,7 +54,6 @@ public interface OtpDataStoreConfig { *

* This parameter is optional. If {@code null} Netex files are loaded from {@code baseDirectory}. */ - @Nonnull List netexFiles(); /** diff --git a/src/main/java/org/opentripplanner/datastore/base/DataSourceRepository.java b/src/main/java/org/opentripplanner/datastore/base/DataSourceRepository.java index 92f2a5769b3..51f3e23347e 100644 --- a/src/main/java/org/opentripplanner/datastore/base/DataSourceRepository.java +++ b/src/main/java/org/opentripplanner/datastore/base/DataSourceRepository.java @@ -1,7 +1,6 @@ package org.opentripplanner.datastore.base; import java.net.URI; -import javax.annotation.Nonnull; import org.opentripplanner.datastore.api.CompositeDataSource; import org.opentripplanner.datastore.api.DataSource; import org.opentripplanner.datastore.api.FileType; @@ -43,7 +42,7 @@ public interface DataSourceRepository { * @param type the file type to load. * @return the datasource wrapper that can be used to access the data source. */ - DataSource findSource(@Nonnull URI uri, @Nonnull FileType type); + DataSource findSource(URI uri, FileType type); /** * Get the a composite data source (zip/directory) for the given uri and type. @@ -54,5 +53,5 @@ public interface DataSourceRepository { * @param type the file type to load. * @return the datasource wrapper that can be used to access the data source. */ - CompositeDataSource findCompositeSource(@Nonnull URI uri, @Nonnull FileType type); + CompositeDataSource findCompositeSource(URI uri, FileType type); } diff --git a/src/main/java/org/opentripplanner/datastore/base/LocalDataSourceRepository.java b/src/main/java/org/opentripplanner/datastore/base/LocalDataSourceRepository.java index a68b6753fa1..10776c31f6e 100644 --- a/src/main/java/org/opentripplanner/datastore/base/LocalDataSourceRepository.java +++ b/src/main/java/org/opentripplanner/datastore/base/LocalDataSourceRepository.java @@ -1,7 +1,6 @@ package org.opentripplanner.datastore.base; import java.util.List; -import javax.annotation.Nonnull; import org.opentripplanner.datastore.api.CompositeDataSource; import org.opentripplanner.datastore.api.DataSource; import org.opentripplanner.datastore.api.FileType; @@ -43,7 +42,7 @@ static boolean isCurrentDir(String filename) { * @param type the file type to load. * @return the datasource wrapper that can be used to access the data source. */ - CompositeDataSource findCompositeSource(String localFilename, @Nonnull FileType type); + CompositeDataSource findCompositeSource(String localFilename, FileType type); /** * List all existing data sources for the given type. diff --git a/src/main/java/org/opentripplanner/datastore/file/FileDataSourceRepository.java b/src/main/java/org/opentripplanner/datastore/file/FileDataSourceRepository.java index 75a157d83a0..ec5555be29e 100644 --- a/src/main/java/org/opentripplanner/datastore/file/FileDataSourceRepository.java +++ b/src/main/java/org/opentripplanner/datastore/file/FileDataSourceRepository.java @@ -16,7 +16,6 @@ import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; -import javax.annotation.Nonnull; import org.opentripplanner.datastore.api.CompositeDataSource; import org.opentripplanner.datastore.api.DataSource; import org.opentripplanner.datastore.api.FileType; @@ -56,7 +55,6 @@ public FileDataSourceRepository( /** * Use for unit testing */ - @Nonnull public static CompositeDataSource compositeSource(File file, FileType type) { // The cast is safe return createCompositeSource(file, type); @@ -73,12 +71,12 @@ public void open() { } @Override - public DataSource findSource(@Nonnull URI uri, @Nonnull FileType type) { + public DataSource findSource(URI uri, FileType type) { return new FileDataSource(openFile(uri, type), type); } @Override - public CompositeDataSource findCompositeSource(@Nonnull URI uri, @Nonnull FileType type) { + public CompositeDataSource findCompositeSource(URI uri, FileType type) { return createCompositeSource(openFile(uri, type), type); } diff --git a/src/main/java/org/opentripplanner/datastore/https/HttpsDataSourceRepository.java b/src/main/java/org/opentripplanner/datastore/https/HttpsDataSourceRepository.java index 56afc888c73..a0abd07cf38 100644 --- a/src/main/java/org/opentripplanner/datastore/https/HttpsDataSourceRepository.java +++ b/src/main/java/org/opentripplanner/datastore/https/HttpsDataSourceRepository.java @@ -4,7 +4,6 @@ import java.time.Duration; import java.util.List; import java.util.Map; -import javax.annotation.Nonnull; import org.apache.hc.core5.http.Header; import org.opentripplanner.datastore.api.CompositeDataSource; import org.opentripplanner.datastore.api.DataSource; @@ -33,7 +32,7 @@ public String description() { public void open() {} @Override - public DataSource findSource(@Nonnull URI uri, @Nonnull FileType type) { + public DataSource findSource(URI uri, FileType type) { if (skipUri(uri)) { return null; } @@ -41,7 +40,7 @@ public DataSource findSource(@Nonnull URI uri, @Nonnull FileType type) { } @Override - public CompositeDataSource findCompositeSource(@Nonnull URI uri, @Nonnull FileType type) { + public CompositeDataSource findCompositeSource(URI uri, FileType type) { if (skipUri(uri)) { return null; } diff --git a/src/main/java/org/opentripplanner/framework/concurrent/OtpRequestThreadFactory.java b/src/main/java/org/opentripplanner/framework/concurrent/OtpRequestThreadFactory.java index e88bbb420cd..cb738363bcb 100644 --- a/src/main/java/org/opentripplanner/framework/concurrent/OtpRequestThreadFactory.java +++ b/src/main/java/org/opentripplanner/framework/concurrent/OtpRequestThreadFactory.java @@ -2,7 +2,6 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder; import java.util.concurrent.ThreadFactory; -import javax.annotation.Nonnull; import org.opentripplanner.framework.application.LogMDCSupport; /** @@ -34,7 +33,7 @@ public static ThreadFactory of(String nameFormat) { } @Override - public Thread newThread(@Nonnull Runnable r) { + public Thread newThread(Runnable r) { if (LogMDCSupport.isRequestTracingInLoggingEnabled()) { return delegate.newThread(new LogMDCRunnableDecorator(r)); } diff --git a/src/main/java/org/opentripplanner/framework/graphql/GraphQLUtils.java b/src/main/java/org/opentripplanner/framework/graphql/GraphQLUtils.java index 334513fd419..ff5485d75b2 100644 --- a/src/main/java/org/opentripplanner/framework/graphql/GraphQLUtils.java +++ b/src/main/java/org/opentripplanner/framework/graphql/GraphQLUtils.java @@ -4,7 +4,6 @@ import java.util.Locale; import java.util.Map; import java.util.Optional; -import javax.annotation.Nonnull; import org.opentripplanner.framework.i18n.I18NString; public class GraphQLUtils { @@ -65,7 +64,7 @@ private static Optional getDefaultLocale(DataFetchingEnvironment environ return Optional.ofNullable((Locale) localContext.get("locale")); } - private static boolean acceptAnyLocale(@Nonnull Locale locale) { + private static boolean acceptAnyLocale(Locale locale) { return locale.getLanguage().equals("*"); } } diff --git a/src/main/java/org/opentripplanner/framework/graphql/scalar/CostScalarFactory.java b/src/main/java/org/opentripplanner/framework/graphql/scalar/CostScalarFactory.java index 6f710328174..415118013f3 100644 --- a/src/main/java/org/opentripplanner/framework/graphql/scalar/CostScalarFactory.java +++ b/src/main/java/org/opentripplanner/framework/graphql/scalar/CostScalarFactory.java @@ -10,7 +10,6 @@ import graphql.schema.GraphQLScalarType; import java.util.Locale; import java.util.NoSuchElementException; -import javax.annotation.Nonnull; import org.opentripplanner.framework.model.Cost; import org.opentripplanner.framework.time.DurationUtils; @@ -54,7 +53,7 @@ private static Cost parseCost(String input) throws CoercingParseValueException { private static Coercing createCoercing() { return new Coercing<>() { @Override - public String serialize(@Nonnull Object result, GraphQLContext c, Locale l) { + public String serialize(Object result, GraphQLContext c, Locale l) { return serializeCost((Cost) result); } @@ -74,7 +73,6 @@ public Cost parseLiteral(Value input, CoercedVariables v, GraphQLContext c, L } @Override - @Nonnull public Value valueToLiteral(Object input, GraphQLContext c, Locale l) { return StringValue.of((String) input); } diff --git a/src/main/java/org/opentripplanner/framework/graphql/scalar/DurationScalarFactory.java b/src/main/java/org/opentripplanner/framework/graphql/scalar/DurationScalarFactory.java index 50af0fbc759..b685ecc597e 100644 --- a/src/main/java/org/opentripplanner/framework/graphql/scalar/DurationScalarFactory.java +++ b/src/main/java/org/opentripplanner/framework/graphql/scalar/DurationScalarFactory.java @@ -8,7 +8,6 @@ import graphql.schema.GraphQLScalarType; import java.time.Duration; import java.time.format.DateTimeParseException; -import javax.annotation.Nonnull; import org.opentripplanner.framework.time.DurationUtils; public class DurationScalarFactory { @@ -30,8 +29,7 @@ public static GraphQLScalarType createDurationScalar() { private static class DurationCoercing implements Coercing { @Override - @Nonnull - public String serialize(@Nonnull Object input) throws CoercingSerializeException { + public String serialize(Object input) throws CoercingSerializeException { if (input instanceof Duration duration) { return DurationUtils.formatDurationWithLeadingMinus(duration); } @@ -40,8 +38,7 @@ public String serialize(@Nonnull Object input) throws CoercingSerializeException } @Override - @Nonnull - public Duration parseValue(@Nonnull Object input) throws CoercingParseValueException { + public Duration parseValue(Object input) throws CoercingParseValueException { try { return DurationUtils.duration(input.toString()); } catch (DateTimeParseException dtpe) { @@ -50,8 +47,7 @@ public Duration parseValue(@Nonnull Object input) throws CoercingParseValueExcep } @Override - @Nonnull - public Duration parseLiteral(@Nonnull Object input) throws CoercingParseLiteralException { + public Duration parseLiteral(Object input) throws CoercingParseLiteralException { if (input instanceof StringValue) { return parseValue(((StringValue) input).getValue()); } diff --git a/src/main/java/org/opentripplanner/framework/i18n/I18NStringMapper.java b/src/main/java/org/opentripplanner/framework/i18n/I18NStringMapper.java index acdb30b301f..ca3de85c221 100644 --- a/src/main/java/org/opentripplanner/framework/i18n/I18NStringMapper.java +++ b/src/main/java/org/opentripplanner/framework/i18n/I18NStringMapper.java @@ -1,7 +1,6 @@ package org.opentripplanner.framework.i18n; import java.util.Locale; -import javax.annotation.Nonnull; import javax.annotation.Nullable; public class I18NStringMapper { @@ -17,7 +16,6 @@ public String mapToApi(I18NString string) { return string == null ? null : string.toString(locale); } - @Nonnull public String mapNonnullToApi(I18NString string) { return string.toString(locale); } diff --git a/src/main/java/org/opentripplanner/framework/i18n/NonLocalizedString.java b/src/main/java/org/opentripplanner/framework/i18n/NonLocalizedString.java index 3eddae235e4..dd7dfc8df05 100644 --- a/src/main/java/org/opentripplanner/framework/i18n/NonLocalizedString.java +++ b/src/main/java/org/opentripplanner/framework/i18n/NonLocalizedString.java @@ -4,7 +4,6 @@ import java.util.Locale; import java.util.Objects; import java.util.function.Function; -import javax.annotation.Nonnull; import javax.annotation.Nullable; /** @@ -18,7 +17,7 @@ public class NonLocalizedString implements I18NString, Serializable { private final String name; - public NonLocalizedString(@Nonnull String name) { + public NonLocalizedString(String name) { this.name = Objects.requireNonNull(name); } @@ -40,7 +39,7 @@ public static NonLocalizedString ofNullable(@Nullable String name) { */ public static NonLocalizedString ofNullable( @Nullable W wrapper, - @Nonnull Function getValueOp + Function getValueOp ) { return wrapper == null ? null : new NonLocalizedString(getValueOp.apply(wrapper)); } @@ -51,8 +50,8 @@ public static NonLocalizedString ofNullable( */ public static NonLocalizedString ofNullable( @Nullable W wrapper, - @Nonnull Function getValueOp, - @Nonnull String defaultValue + Function getValueOp, + String defaultValue ) { return new NonLocalizedString(wrapper == null ? defaultValue : getValueOp.apply(wrapper)); } @@ -61,11 +60,7 @@ public static NonLocalizedString ofNullable( * Check if name is non-null and returns an instance of {@link NonLocalizedString}, otherwise * returns a {@link NonLocalizedString} with the default name. */ - @Nonnull - public static NonLocalizedString ofNullableOrElse( - @Nullable String name, - @Nonnull String defaultName - ) { + public static NonLocalizedString ofNullableOrElse(@Nullable String name, String defaultName) { return new NonLocalizedString(name == null ? defaultName : name); } @@ -73,11 +68,7 @@ public static NonLocalizedString ofNullableOrElse( * Check if name is non-null and returns an instance of {@link NonLocalizedString}, otherwise * returns a {@link I18NString} with the default name. */ - @Nonnull - public static I18NString ofNullableOrElse( - @Nullable String name, - @Nonnull I18NString defaultName - ) { + public static I18NString ofNullableOrElse(@Nullable String name, I18NString defaultName) { return name == null ? defaultName : new NonLocalizedString(name); } diff --git a/src/main/java/org/opentripplanner/framework/io/JsonDataListDownloader.java b/src/main/java/org/opentripplanner/framework/io/JsonDataListDownloader.java index 3affa734605..81f8ee5b3c4 100644 --- a/src/main/java/org/opentripplanner/framework/io/JsonDataListDownloader.java +++ b/src/main/java/org/opentripplanner/framework/io/JsonDataListDownloader.java @@ -11,7 +11,6 @@ import java.util.Map; import java.util.Objects; import java.util.function.Function; -import javax.annotation.Nonnull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -25,20 +24,20 @@ public class JsonDataListDownloader { private final OtpHttpClient otpHttpClient; public JsonDataListDownloader( - @Nonnull String url, - @Nonnull String jsonParsePath, - @Nonnull Function elementParser, - @Nonnull Map headers + String url, + String jsonParsePath, + Function elementParser, + Map headers ) { this(url, jsonParsePath, elementParser, headers, new OtpHttpClientFactory().create(LOG)); } public JsonDataListDownloader( - @Nonnull String url, - @Nonnull String jsonParsePath, - @Nonnull Function elementParser, - @Nonnull Map headers, - @Nonnull OtpHttpClient OtpHttpClient + String url, + String jsonParsePath, + Function elementParser, + Map headers, + OtpHttpClient OtpHttpClient ) { this.url = Objects.requireNonNull(url); this.jsonParsePath = Objects.requireNonNull(jsonParsePath); diff --git a/src/main/java/org/opentripplanner/framework/json/JsonUtils.java b/src/main/java/org/opentripplanner/framework/json/JsonUtils.java index 1f235eb6483..17b875b5596 100644 --- a/src/main/java/org/opentripplanner/framework/json/JsonUtils.java +++ b/src/main/java/org/opentripplanner/framework/json/JsonUtils.java @@ -2,11 +2,10 @@ import com.fasterxml.jackson.databind.JsonNode; import java.util.Optional; -import javax.annotation.Nonnull; public class JsonUtils { - public static Optional asText(@Nonnull JsonNode node, @Nonnull String field) { + public static Optional asText(JsonNode node, String field) { JsonNode valueNode = node.get(field); if (valueNode == null) { return Optional.empty(); diff --git a/src/main/java/org/opentripplanner/framework/lang/MemEfficientArrayBuilder.java b/src/main/java/org/opentripplanner/framework/lang/MemEfficientArrayBuilder.java index 8b3a6ba6cd0..7bf36dd5b86 100644 --- a/src/main/java/org/opentripplanner/framework/lang/MemEfficientArrayBuilder.java +++ b/src/main/java/org/opentripplanner/framework/lang/MemEfficientArrayBuilder.java @@ -2,7 +2,6 @@ import java.util.Arrays; import java.util.Objects; -import javax.annotation.Nonnull; /** * This array builder is used to minimize the creation of new objects (arrays). It takes an array as base, @@ -20,7 +19,7 @@ public final class MemEfficientArrayBuilder { private final T[] original; private T[] array = null; - private MemEfficientArrayBuilder(@Nonnull T[] original) { + private MemEfficientArrayBuilder(T[] original) { this.original = Objects.requireNonNull(original); } diff --git a/src/main/java/org/opentripplanner/framework/lang/StringUtils.java b/src/main/java/org/opentripplanner/framework/lang/StringUtils.java index 9eff448d0c7..5d18981e0e3 100644 --- a/src/main/java/org/opentripplanner/framework/lang/StringUtils.java +++ b/src/main/java/org/opentripplanner/framework/lang/StringUtils.java @@ -1,7 +1,6 @@ package org.opentripplanner.framework.lang; import java.util.regex.Pattern; -import javax.annotation.Nonnull; /** * OTP String utils extending the Java lang String... @@ -120,7 +119,7 @@ public static String padRight(String value, char ch, int width) { } /** Replace single quotes with double quotes. */ - public static String quoteReplace(@Nonnull String text) { + public static String quoteReplace(String text) { return text.replace('\'', '\"'); } diff --git a/src/main/java/org/opentripplanner/framework/time/DateUtils.java b/src/main/java/org/opentripplanner/framework/time/DateUtils.java index d212af56b79..36f62fb0448 100644 --- a/src/main/java/org/opentripplanner/framework/time/DateUtils.java +++ b/src/main/java/org/opentripplanner/framework/time/DateUtils.java @@ -10,7 +10,6 @@ import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; import java.util.List; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -86,7 +85,7 @@ public static ZonedDateTime toZonedDateTime(String date, String time, ZoneId tz) } // TODO: could be replaced with Apache's DateFormat.parseDate ??? - public static LocalDate parseDate(@Nonnull String input) { + public static LocalDate parseDate(String input) { LocalDate retVal = null; try { String newString = input diff --git a/src/main/java/org/opentripplanner/framework/time/TimeUtils.java b/src/main/java/org/opentripplanner/framework/time/TimeUtils.java index 9cc5594cb76..f2d2cf5de41 100644 --- a/src/main/java/org/opentripplanner/framework/time/TimeUtils.java +++ b/src/main/java/org/opentripplanner/framework/time/TimeUtils.java @@ -14,7 +14,6 @@ import java.util.concurrent.atomic.AtomicLong; import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.annotation.Nonnull; /** * Time utility methods. See the unit test for examples on how to use this class. @@ -108,7 +107,7 @@ public static int time(String hhmmss, int defaultValue) { * very helpful when specifying a schedule using a sting instead of using a int array with seconds * past midnight. */ - public static int[] times(@Nonnull String input) { + public static int[] times(String input) { return Arrays.stream(input.split("[ ,;]+")).mapToInt(TimeUtils::time).toArray(); } diff --git a/src/main/java/org/opentripplanner/framework/tostring/ToStringBuilder.java b/src/main/java/org/opentripplanner/framework/tostring/ToStringBuilder.java index 6480b6f1187..f600a2a31bc 100644 --- a/src/main/java/org/opentripplanner/framework/tostring/ToStringBuilder.java +++ b/src/main/java/org/opentripplanner/framework/tostring/ToStringBuilder.java @@ -15,7 +15,6 @@ import java.util.function.Function; import java.util.function.Supplier; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.framework.lang.ObjectUtils; import org.opentripplanner.framework.lang.OtpNumberFormat; @@ -372,7 +371,7 @@ private ToStringBuilder addIfNotIgnored( return addIt(name, mapToString.apply(value)); } - private ToStringBuilder addIt(String name, @Nonnull String value) { + private ToStringBuilder addIt(String name, String value) { addLabel(name); addValue(value); return this; @@ -387,7 +386,7 @@ private void addLabel(String name) { sb.append(name); } - private void addValue(@Nonnull String value) { + private void addValue(String value) { sb.append(FIELD_VALUE_SEP); sb.append(value); } diff --git a/src/main/java/org/opentripplanner/graph_builder/GraphBuilder.java b/src/main/java/org/opentripplanner/graph_builder/GraphBuilder.java index 26e7ddbe014..d6f91696e64 100644 --- a/src/main/java/org/opentripplanner/graph_builder/GraphBuilder.java +++ b/src/main/java/org/opentripplanner/graph_builder/GraphBuilder.java @@ -8,7 +8,6 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.ext.emissions.EmissionsDataModel; import org.opentripplanner.ext.stopconsolidation.StopConsolidationRepository; @@ -44,11 +43,7 @@ public class GraphBuilder implements Runnable { private boolean hasTransitData = false; @Inject - public GraphBuilder( - @Nonnull Graph baseGraph, - @Nonnull TransitModel transitModel, - @Nonnull DataImportIssueStore issueStore - ) { + public GraphBuilder(Graph baseGraph, TransitModel transitModel, DataImportIssueStore issueStore) { this.graph = baseGraph; this.transitModel = transitModel; this.issueStore = issueStore; diff --git a/src/main/java/org/opentripplanner/graph_builder/issue/api/DataImportIssueSummary.java b/src/main/java/org/opentripplanner/graph_builder/issue/api/DataImportIssueSummary.java index ba1e6610a30..da3110d0ce7 100644 --- a/src/main/java/org/opentripplanner/graph_builder/issue/api/DataImportIssueSummary.java +++ b/src/main/java/org/opentripplanner/graph_builder/issue/api/DataImportIssueSummary.java @@ -8,7 +8,6 @@ import java.util.Map; import java.util.function.Function; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -74,7 +73,6 @@ public void logSummary() { .forEach(issueType -> ISSUE_LOG.info(String.format(FMT, issueType, summary.get(issueType)))); } - @Nonnull public Map asMap() { return summary; } diff --git a/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java b/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java index 56b6b80c682..a134dd3c75b 100644 --- a/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java +++ b/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java @@ -5,7 +5,6 @@ import java.util.Set; import java.util.function.BiFunction; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import org.opentripplanner.framework.application.OTPFeature; import org.opentripplanner.framework.logging.ProgressTracker; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; @@ -180,7 +179,6 @@ private void linkToDriveableEdge(TransitStopVertex tStop) { ); } - @Nonnull private static List createStopLinkEdges( TransitStopVertex vertex, StreetVertex streetVertex diff --git a/src/main/java/org/opentripplanner/graph_builder/module/osm/ElevatorProcessor.java b/src/main/java/org/opentripplanner/graph_builder/module/osm/ElevatorProcessor.java index 3a0a9fa404b..57e1abdd2d3 100644 --- a/src/main/java/org/opentripplanner/graph_builder/module/osm/ElevatorProcessor.java +++ b/src/main/java/org/opentripplanner/graph_builder/module/osm/ElevatorProcessor.java @@ -7,7 +7,6 @@ import java.util.List; import java.util.Map; import java.util.OptionalInt; -import javax.annotation.Nonnull; import org.opentripplanner.framework.i18n.NonLocalizedString; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.graph_builder.issue.api.Issue; @@ -46,9 +45,9 @@ class ElevatorProcessor { private final VertexGenerator vertexGenerator; public ElevatorProcessor( - @Nonnull DataImportIssueStore issueStore, - @Nonnull OsmDatabase osmdb, - @Nonnull VertexGenerator vertexGenerator + DataImportIssueStore issueStore, + OsmDatabase osmdb, + VertexGenerator vertexGenerator ) { this.issueStore = issueStore; this.osmdb = osmdb; diff --git a/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java b/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java index 10c215ee448..df46836942f 100644 --- a/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java +++ b/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java @@ -8,7 +8,6 @@ import java.util.List; import java.util.Map; import java.util.Objects; -import javax.annotation.Nonnull; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.LineString; @@ -63,7 +62,7 @@ public class OsmModule implements GraphBuilderModule { Collection providers, Graph graph, DataImportIssueStore issueStore, - @Nonnull StreetLimitationParameters streetLimitationParameters, + StreetLimitationParameters streetLimitationParameters, OsmProcessingParameters params ) { this.providers = List.copyOf(providers); diff --git a/src/main/java/org/opentripplanner/graph_builder/services/osm/EdgeNamer.java b/src/main/java/org/opentripplanner/graph_builder/services/osm/EdgeNamer.java index 60cf780f714..819e9e77d02 100644 --- a/src/main/java/org/opentripplanner/graph_builder/services/osm/EdgeNamer.java +++ b/src/main/java/org/opentripplanner/graph_builder/services/osm/EdgeNamer.java @@ -1,6 +1,5 @@ package org.opentripplanner.graph_builder.services.osm; -import javax.annotation.Nonnull; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.framework.i18n.NonLocalizedString; import org.opentripplanner.graph_builder.module.osm.StreetEdgePair; @@ -33,7 +32,7 @@ public interface EdgeNamer { */ void postprocess(); - default I18NString getNameForWay(OSMWithTags way, @Nonnull String id) { + default I18NString getNameForWay(OSMWithTags way, String id) { var name = name(way); if (name == null) { diff --git a/src/main/java/org/opentripplanner/gtfs/mapping/TranslationHelper.java b/src/main/java/org/opentripplanner/gtfs/mapping/TranslationHelper.java index 03ed54d55f7..ce61c01b05e 100644 --- a/src/main/java/org/opentripplanner/gtfs/mapping/TranslationHelper.java +++ b/src/main/java/org/opentripplanner/gtfs/mapping/TranslationHelper.java @@ -7,7 +7,6 @@ import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.onebusaway.csv_entities.schema.annotations.CsvField; import org.onebusaway.csv_entities.schema.annotations.CsvFieldNameConvention; @@ -83,9 +82,9 @@ void importTranslations(Collection allTranslations, Collection clazz, - @Nonnull String fieldName, - @Nonnull String recordId, + Class clazz, + String fieldName, + String recordId, @Nullable String defaultValue ) { return getTranslation(clazz, fieldName, recordId, null, defaultValue); @@ -93,9 +92,9 @@ I18NString getTranslation( @Nullable I18NString getTranslation( - @Nonnull Class clazz, - @Nonnull String fieldName, - @Nonnull String recordId, + Class clazz, + String fieldName, + String recordId, @Nullable String recordSubId, @Nullable String defaultValue ) { diff --git a/src/main/java/org/opentripplanner/model/calendar/ServiceDateInterval.java b/src/main/java/org/opentripplanner/model/calendar/ServiceDateInterval.java index 5d2657912fc..a879f6c790e 100644 --- a/src/main/java/org/opentripplanner/model/calendar/ServiceDateInterval.java +++ b/src/main/java/org/opentripplanner/model/calendar/ServiceDateInterval.java @@ -6,7 +6,6 @@ import java.time.LocalDate; import java.time.temporal.ChronoUnit; import java.util.Objects; -import javax.annotation.Nonnull; import org.opentripplanner.framework.time.ServiceDateUtils; /** @@ -52,7 +51,6 @@ public boolean isUnbounded() { * Return the interval start, inclusive. If the period start is unbounded the {@link * LocalDate#MIN} is returned. */ - @Nonnull public LocalDate getStart() { return start; } @@ -61,7 +59,6 @@ public LocalDate getStart() { * Return the interval end, inclusive. If the period start is unbounded the {@link * LocalDate#MAX} is returned. */ - @Nonnull public LocalDate getEnd() { return end; } diff --git a/src/main/java/org/opentripplanner/model/fare/RiderCategory.java b/src/main/java/org/opentripplanner/model/fare/RiderCategory.java index 43f777cd31a..df68d3a8ce6 100644 --- a/src/main/java/org/opentripplanner/model/fare/RiderCategory.java +++ b/src/main/java/org/opentripplanner/model/fare/RiderCategory.java @@ -1,13 +1,12 @@ package org.opentripplanner.model.fare; import java.util.Objects; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.framework.lang.Sandbox; import org.opentripplanner.transit.model.framework.FeedScopedId; @Sandbox -public record RiderCategory(@Nonnull FeedScopedId id, @Nonnull String name, @Nullable String url) { +public record RiderCategory(FeedScopedId id, String name, @Nullable String url) { public RiderCategory { Objects.requireNonNull(id); Objects.requireNonNull(name); diff --git a/src/main/java/org/opentripplanner/model/modes/AllowMainAndSubModeFilter.java b/src/main/java/org/opentripplanner/model/modes/AllowMainAndSubModeFilter.java index ec197522590..1b34acd5327 100644 --- a/src/main/java/org/opentripplanner/model/modes/AllowMainAndSubModeFilter.java +++ b/src/main/java/org/opentripplanner/model/modes/AllowMainAndSubModeFilter.java @@ -1,7 +1,6 @@ package org.opentripplanner.model.modes; import java.util.Objects; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.transit.model.basic.MainAndSubMode; @@ -14,12 +13,12 @@ class AllowMainAndSubModeFilter implements AllowTransitModeFilter { private final SubMode subMode; - AllowMainAndSubModeFilter(@Nonnull TransitMode mainMode, @Nullable SubMode subMode) { + AllowMainAndSubModeFilter(TransitMode mainMode, @Nullable SubMode subMode) { this.mainMode = mainMode; this.subMode = subMode; } - AllowMainAndSubModeFilter(@Nonnull MainAndSubMode mode) { + AllowMainAndSubModeFilter(MainAndSubMode mode) { this(mode.mainMode(), mode.subMode()); } @@ -34,7 +33,6 @@ public boolean match(TransitMode transitMode, SubMode netexSubMode) { return mainMode == transitMode && subMode == netexSubMode; } - @Nonnull TransitMode mainMode() { return mainMode; } diff --git a/src/main/java/org/opentripplanner/model/plan/LegTime.java b/src/main/java/org/opentripplanner/model/plan/LegTime.java index 354ce4f4b0b..71ced95942a 100644 --- a/src/main/java/org/opentripplanner/model/plan/LegTime.java +++ b/src/main/java/org/opentripplanner/model/plan/LegTime.java @@ -3,24 +3,21 @@ import java.time.Duration; import java.time.ZonedDateTime; import java.util.Objects; -import javax.annotation.Nonnull; import javax.annotation.Nullable; /** * A scheduled time of a transit vehicle at a certain location with a optional realtime information. */ -public record LegTime(@Nonnull ZonedDateTime scheduledTime, @Nullable RealTimeEstimate estimated) { +public record LegTime(ZonedDateTime scheduledTime, @Nullable RealTimeEstimate estimated) { public LegTime { Objects.requireNonNull(scheduledTime); } - @Nonnull public static LegTime of(ZonedDateTime realtime, int delaySecs) { var delay = Duration.ofSeconds(delaySecs); return new LegTime(realtime.minus(delay), new RealTimeEstimate(realtime, delay)); } - @Nonnull public static LegTime ofStatic(ZonedDateTime staticTime) { return new LegTime(staticTime, null); } diff --git a/src/main/java/org/opentripplanner/model/plan/ScheduledTransitLeg.java b/src/main/java/org/opentripplanner/model/plan/ScheduledTransitLeg.java index e774c9e0dbc..7af091531e0 100644 --- a/src/main/java/org/opentripplanner/model/plan/ScheduledTransitLeg.java +++ b/src/main/java/org/opentripplanner/model/plan/ScheduledTransitLeg.java @@ -10,7 +10,6 @@ import java.util.List; import java.util.Objects; import java.util.Set; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.LineString; @@ -182,7 +181,6 @@ public LegTime end() { } @Override - @Nonnull public TransitMode getMode() { return getTrip().getMode(); } diff --git a/src/main/java/org/opentripplanner/model/plan/TransitLeg.java b/src/main/java/org/opentripplanner/model/plan/TransitLeg.java index 736739ca970..f7ac3e42544 100644 --- a/src/main/java/org/opentripplanner/model/plan/TransitLeg.java +++ b/src/main/java/org/opentripplanner/model/plan/TransitLeg.java @@ -1,13 +1,11 @@ package org.opentripplanner.model.plan; -import javax.annotation.Nonnull; import org.opentripplanner.transit.model.basic.TransitMode; public interface TransitLeg extends Leg { /** * The mode (e.g., BUS) used when traversing this leg. */ - @Nonnull TransitMode getMode(); @Override diff --git a/src/main/java/org/opentripplanner/netex/mapping/QuayMapper.java b/src/main/java/org/opentripplanner/netex/mapping/QuayMapper.java index 5e9285043d5..a304ca32f72 100644 --- a/src/main/java/org/opentripplanner/netex/mapping/QuayMapper.java +++ b/src/main/java/org/opentripplanner/netex/mapping/QuayMapper.java @@ -1,7 +1,6 @@ package org.opentripplanner.netex.mapping; import java.util.Collection; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.framework.i18n.NonLocalizedString; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; @@ -39,7 +38,7 @@ class QuayMapper { */ @Nullable RegularStop mapQuayToStop( - @Nonnull Quay quay, + Quay quay, Station parentStation, Collection fareZones, NetexMainAndSubMode transitMode, @@ -54,7 +53,7 @@ RegularStop mapQuayToStop( private RegularStop map( FeedScopedId id, - @Nonnull Quay quay, + Quay quay, Station parentStation, Collection fareZones, NetexMainAndSubMode transitMode, diff --git a/src/main/java/org/opentripplanner/netex/mapping/calendar/OperatingDayMapper.java b/src/main/java/org/opentripplanner/netex/mapping/calendar/OperatingDayMapper.java index 63c554c95fa..be398d34902 100644 --- a/src/main/java/org/opentripplanner/netex/mapping/calendar/OperatingDayMapper.java +++ b/src/main/java/org/opentripplanner/netex/mapping/calendar/OperatingDayMapper.java @@ -1,7 +1,6 @@ package org.opentripplanner.netex.mapping.calendar; import java.time.LocalDate; -import javax.annotation.Nonnull; import org.rutebanken.netex.model.OperatingDay; class OperatingDayMapper { @@ -9,7 +8,7 @@ class OperatingDayMapper { /** Utility class, prevent instantiation. */ private OperatingDayMapper() {} - static LocalDate map(@Nonnull OperatingDay opDay) { + static LocalDate map(OperatingDay opDay) { return opDay.getCalendarDate().toLocalDate(); } } diff --git a/src/main/java/org/opentripplanner/netex/mapping/support/NetexObjectDecorator.java b/src/main/java/org/opentripplanner/netex/mapping/support/NetexObjectDecorator.java index e096cc499b7..1f4b8b0c786 100644 --- a/src/main/java/org/opentripplanner/netex/mapping/support/NetexObjectDecorator.java +++ b/src/main/java/org/opentripplanner/netex/mapping/support/NetexObjectDecorator.java @@ -1,7 +1,6 @@ package org.opentripplanner.netex.mapping.support; import java.util.function.Consumer; -import javax.annotation.Nonnull; import org.rutebanken.netex.model.VersionOfObjectRefStructure; import org.slf4j.Logger; @@ -46,7 +45,7 @@ public static void foo() {} * the right scope - this class is just a utility class, or the messenger. * @param ref the unexpected reference to an unmapped object. */ - public static void logUnmappedEntityRef(Logger log, @Nonnull VersionOfObjectRefStructure ref) { + public static void logUnmappedEntityRef(Logger log, VersionOfObjectRefStructure ref) { log.warn("Unexpected entity {} in NeTEx import. The entity is ignored.", ref); } } diff --git a/src/main/java/org/opentripplanner/openstreetmap/model/OSMWithTags.java b/src/main/java/org/opentripplanner/openstreetmap/model/OSMWithTags.java index b53739bf6a1..6c5af2b26c6 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/model/OSMWithTags.java +++ b/src/main/java/org/opentripplanner/openstreetmap/model/OSMWithTags.java @@ -11,7 +11,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.framework.i18n.NonLocalizedString; @@ -199,7 +198,6 @@ public String getTag(String tag) { * * @return A tags value converted to lower case. An empty Optional if tags is not present. */ - @Nonnull public Optional getTagOpt(String network) { return Optional.ofNullable(getTag(network)); } @@ -513,7 +511,6 @@ public String url() { *

* Values are split by semicolons. */ - @Nonnull public Set getMultiTagValues(Set refTags) { return refTags .stream() @@ -622,7 +619,6 @@ private boolean isTagDeniedAccess(String tagName) { * Returns level tag (i.e. building floor) or layer tag values, defaults to "0" * Some entities can have a semicolon separated list of levels (e.g. elevators) */ - @Nonnull public Set getLevels() { var levels = getMultiTagValues(LEVEL_TAGS); if (levels.isEmpty()) { diff --git a/src/main/java/org/opentripplanner/openstreetmap/wayproperty/WayProperties.java b/src/main/java/org/opentripplanner/openstreetmap/wayproperty/WayProperties.java index 4facfd041c8..fd8b67bada2 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/wayproperty/WayProperties.java +++ b/src/main/java/org/opentripplanner/openstreetmap/wayproperty/WayProperties.java @@ -2,7 +2,6 @@ import java.util.Objects; import java.util.Optional; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.street.model.StreetTraversalPermission; @@ -13,7 +12,6 @@ */ public class WayProperties { - @Nonnull private final StreetTraversalPermission permission; @Nullable @@ -31,7 +29,6 @@ public class WayProperties { /** * The value for the bicycle safety. If none has been set a default value of 1 is returned. */ - @Nonnull public SafetyFeatures bicycleSafety() { return Objects.requireNonNullElse(bicycleSafetyFeatures, SafetyFeatures.DEFAULT); } @@ -39,12 +36,10 @@ public SafetyFeatures bicycleSafety() { /** * The value for the walk safety. If none has been set a default value of 1 is returned. */ - @Nonnull public SafetyFeatures walkSafety() { return Objects.requireNonNullElse(walkSafetyFeatures, SafetyFeatures.DEFAULT); } - @Nonnull public StreetTraversalPermission getPermission() { return permission; } @@ -52,7 +47,6 @@ public StreetTraversalPermission getPermission() { /** * An optional value for the walk safety. If none has been set an empty Optional is returned. */ - @Nonnull protected Optional walkSafetyOpt() { return Optional.ofNullable(walkSafetyFeatures); } @@ -60,7 +54,6 @@ protected Optional walkSafetyOpt() { /** * An optional value for the bicycle safety. If none has been set an empty Optional is returned. */ - @Nonnull protected Optional bicycleSafetyOpt() { return Optional.ofNullable(bicycleSafetyFeatures); } diff --git a/src/main/java/org/opentripplanner/raptor/api/path/AccessPathLeg.java b/src/main/java/org/opentripplanner/raptor/api/path/AccessPathLeg.java index b76e0a1df4d..cb4a8030ff6 100644 --- a/src/main/java/org/opentripplanner/raptor/api/path/AccessPathLeg.java +++ b/src/main/java/org/opentripplanner/raptor/api/path/AccessPathLeg.java @@ -1,7 +1,6 @@ package org.opentripplanner.raptor.api.path; import java.util.Objects; -import javax.annotation.Nonnull; import org.opentripplanner.raptor.api.model.RaptorAccessEgress; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; @@ -20,11 +19,11 @@ public final class AccessPathLeg implements PathLe private final PathLeg next; public AccessPathLeg( - @Nonnull RaptorAccessEgress access, + RaptorAccessEgress access, int fromTime, int toTime, int c1, - @Nonnull PathLeg next + PathLeg next ) { this.access = access; this.fromTime = fromTime; diff --git a/src/main/java/org/opentripplanner/raptor/rangeraptor/path/PathParetoSetComparators.java b/src/main/java/org/opentripplanner/raptor/rangeraptor/path/PathParetoSetComparators.java index 192f957ae8f..22212517ce1 100644 --- a/src/main/java/org/opentripplanner/raptor/rangeraptor/path/PathParetoSetComparators.java +++ b/src/main/java/org/opentripplanner/raptor/rangeraptor/path/PathParetoSetComparators.java @@ -8,7 +8,6 @@ import static org.opentripplanner.raptor.api.path.RaptorPath.compareNumberOfTransfers; import java.util.Objects; -import javax.annotation.Nonnull; import org.opentripplanner.raptor.api.model.DominanceFunction; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; import org.opentripplanner.raptor.api.model.RelaxFunction; @@ -128,9 +127,7 @@ > ParetoComparator> comparatorTimetableAndC1() { private static < T extends RaptorTripSchedule - > ParetoComparator> comparatorTimetableAndRelaxedC1( - @Nonnull final RelaxFunction relaxCost - ) { + > ParetoComparator> comparatorTimetableAndRelaxedC1(final RelaxFunction relaxCost) { return (l, r) -> compareIterationDepartureTime(l, r) || compareArrivalTime(l, r) || @@ -161,9 +158,7 @@ > ParetoComparator> comparatorDepartureTimeAndC1() { private static < T extends RaptorTripSchedule - > ParetoComparator> comparatorArrivalTimeAndRelaxedC1( - @Nonnull RelaxFunction relaxCost - ) { + > ParetoComparator> comparatorArrivalTimeAndRelaxedC1(RelaxFunction relaxCost) { return (l, r) -> compareArrivalTime(l, r) || compareNumberOfTransfers(l, r) || @@ -173,9 +168,7 @@ > ParetoComparator> comparatorArrivalTimeAndRelaxedC1( private static < T extends RaptorTripSchedule - > ParetoComparator> comparatorDepartureTimeAndRelaxedC1( - @Nonnull RelaxFunction relaxCost - ) { + > ParetoComparator> comparatorDepartureTimeAndRelaxedC1(RelaxFunction relaxCost) { return (l, r) -> compareDepartureTime(l, r) || compareNumberOfTransfers(l, r) || @@ -185,9 +178,7 @@ > ParetoComparator> comparatorDepartureTimeAndRelaxedC1( private static < T extends RaptorTripSchedule - > ParetoComparator> comparatorTimetableAndC1AndC2( - @Nonnull DominanceFunction c2Comp - ) { + > ParetoComparator> comparatorTimetableAndC1AndC2(DominanceFunction c2Comp) { return (l, r) -> compareIterationDepartureTime(l, r) || compareArrivalTime(l, r) || @@ -200,8 +191,8 @@ > ParetoComparator> comparatorTimetableAndC1AndC2( private static < T extends RaptorTripSchedule > ParetoComparator> comparatorTimetableAndRelaxedC1IfC2IsOptimal( - @Nonnull RelaxFunction relaxCost, - @Nonnull DominanceFunction c2Comp + RelaxFunction relaxCost, + DominanceFunction c2Comp ) { return (l, r) -> compareIterationDepartureTime(l, r) || @@ -213,7 +204,7 @@ > ParetoComparator> comparatorTimetableAndRelaxedC1IfC2IsOptimal( private static < T extends RaptorTripSchedule - > ParetoComparator> comparatorWithC1AndC2(@Nonnull DominanceFunction c2Comp) { + > ParetoComparator> comparatorWithC1AndC2(DominanceFunction c2Comp) { return (l, r) -> compareArrivalTime(l, r) || compareNumberOfTransfers(l, r) || @@ -224,9 +215,7 @@ > ParetoComparator> comparatorWithC1AndC2(@Nonnull DominanceFuncti private static < T extends RaptorTripSchedule - > ParetoComparator> comparatorDepartureTimeAndC1AndC2( - @Nonnull DominanceFunction c2Comp - ) { + > ParetoComparator> comparatorDepartureTimeAndC1AndC2(DominanceFunction c2Comp) { return (l, r) -> compareDepartureTime(l, r) || compareNumberOfTransfers(l, r) || @@ -238,8 +227,8 @@ > ParetoComparator> comparatorDepartureTimeAndC1AndC2( private static < T extends RaptorTripSchedule > ParetoComparator> comparatorArrivalTimeAndRelaxedC1IfC2IsOptimal( - @Nonnull RelaxFunction relaxCost, - @Nonnull DominanceFunction c2Comp + RelaxFunction relaxCost, + DominanceFunction c2Comp ) { return (l, r) -> compareArrivalTime(l, r) || @@ -251,8 +240,8 @@ > ParetoComparator> comparatorArrivalTimeAndRelaxedC1IfC2IsOptimal private static < T extends RaptorTripSchedule > ParetoComparator> comparatorDepartureTimeAndRelaxedC1IfC2IsOptimal( - @Nonnull RelaxFunction relaxCost, - @Nonnull DominanceFunction c2Comp + RelaxFunction relaxCost, + DominanceFunction c2Comp ) { return (l, r) -> compareDepartureTime(l, r) || @@ -262,10 +251,10 @@ > ParetoComparator> comparatorDepartureTimeAndRelaxedC1IfC2IsOptim } private static boolean compareC1RelaxedIfC2IsOptimal( - @Nonnull RaptorPath l, - @Nonnull RaptorPath r, - @Nonnull RelaxFunction relaxCost, - @Nonnull DominanceFunction c2Comp + RaptorPath l, + RaptorPath r, + RelaxFunction relaxCost, + DominanceFunction c2Comp ) { return c2Comp.leftDominateRight(l.c2(), r.c2()) ? compareC1(relaxCost, l, r) : compareC1(l, r); } diff --git a/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/stoparrivals/view/StopsCursor.java b/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/stoparrivals/view/StopsCursor.java index f72047597a7..32406951eda 100644 --- a/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/stoparrivals/view/StopsCursor.java +++ b/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/stoparrivals/view/StopsCursor.java @@ -1,7 +1,6 @@ package org.opentripplanner.raptor.rangeraptor.standard.stoparrivals.view; import java.util.function.ToIntFunction; -import javax.annotation.Nonnull; import org.opentripplanner.raptor.api.model.RaptorAccessEgress; import org.opentripplanner.raptor.api.model.RaptorConstants; import org.opentripplanner.raptor.api.model.RaptorTransfer; @@ -139,7 +138,7 @@ public ArrivalView stop(int round, int stop, boolean stopReachedOnBoard) { * Set cursor to stop followed by the give transit leg - this allows access to be time-shifted * according to the next transit boarding/departure time. */ - public ArrivalView stop(int round, int stop, @Nonnull Transit nextTransitLeg) { + public ArrivalView stop(int round, int stop, Transit nextTransitLeg) { var arrival = arrivals.get(round, stop); if (arrival.arrivedByAccessOnStreet()) { diff --git a/src/main/java/org/opentripplanner/raptor/spi/EmptyBoardOrAlightEvent.java b/src/main/java/org/opentripplanner/raptor/spi/EmptyBoardOrAlightEvent.java index 9d29fc50d38..07984903f2a 100644 --- a/src/main/java/org/opentripplanner/raptor/spi/EmptyBoardOrAlightEvent.java +++ b/src/main/java/org/opentripplanner/raptor/spi/EmptyBoardOrAlightEvent.java @@ -1,7 +1,6 @@ package org.opentripplanner.raptor.spi; import java.util.function.Consumer; -import javax.annotation.Nonnull; import org.opentripplanner.raptor.api.model.RaptorConstants; import org.opentripplanner.raptor.api.model.RaptorTransferConstraint; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; @@ -28,7 +27,6 @@ public int time() { throw new UnsupportedOperationException(); } - @Nonnull @Override public RaptorTransferConstraint transferConstraint() { return RaptorTransferConstraint.REGULAR_TRANSFER; diff --git a/src/main/java/org/opentripplanner/raptor/spi/RaptorBoardOrAlightEvent.java b/src/main/java/org/opentripplanner/raptor/spi/RaptorBoardOrAlightEvent.java index 5913f950969..bf71011a330 100644 --- a/src/main/java/org/opentripplanner/raptor/spi/RaptorBoardOrAlightEvent.java +++ b/src/main/java/org/opentripplanner/raptor/spi/RaptorBoardOrAlightEvent.java @@ -1,7 +1,6 @@ package org.opentripplanner.raptor.spi; import java.util.function.Consumer; -import javax.annotation.Nonnull; import org.opentripplanner.raptor.api.model.RaptorConstants; import org.opentripplanner.raptor.api.model.RaptorTransferConstraint; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; @@ -65,7 +64,6 @@ default int boardStopIndex() { * constraints assisiated with the boarding the {@link RaptorTransferConstraint#isRegularTransfer()} * is {@code true}. */ - @Nonnull RaptorTransferConstraint transferConstraint(); /** diff --git a/src/main/java/org/opentripplanner/raptor/spi/RaptorTransitDataProvider.java b/src/main/java/org/opentripplanner/raptor/spi/RaptorTransitDataProvider.java index b4accdbcc2b..2b04586498c 100644 --- a/src/main/java/org/opentripplanner/raptor/spi/RaptorTransitDataProvider.java +++ b/src/main/java/org/opentripplanner/raptor/spi/RaptorTransitDataProvider.java @@ -1,7 +1,6 @@ package org.opentripplanner.raptor.spi; import java.util.Iterator; -import javax.annotation.Nonnull; import org.opentripplanner.raptor.api.model.RaptorTransfer; import org.opentripplanner.raptor.api.model.RaptorTransferConstraint; import org.opentripplanner.raptor.api.model.RaptorTripPattern; @@ -120,7 +119,6 @@ default void setup() {} * method is used by Raptor to translate from the stop index to a string which should be short and * identify the stop given the related pattern, for example the stop name would be great. */ - @Nonnull RaptorStopNameResolver stopNameResolver(); /** diff --git a/src/main/java/org/opentripplanner/routing/alertpatch/TransitAlert.java b/src/main/java/org/opentripplanner/routing/alertpatch/TransitAlert.java index d7a3c93abe5..4555573c8ca 100644 --- a/src/main/java/org/opentripplanner/routing/alertpatch/TransitAlert.java +++ b/src/main/java/org/opentripplanner/routing/alertpatch/TransitAlert.java @@ -8,7 +8,6 @@ import java.util.Objects; import java.util.Optional; import java.util.Set; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.transit.model.framework.AbstractTransitEntity; @@ -214,7 +213,7 @@ public boolean noServiceAt(Instant instant) { } @Override - public boolean sameAs(@Nonnull TransitAlert other) { + public boolean sameAs(TransitAlert other) { return ( getId().equals(other.getId()) && Objects.equals(headerText, other.headerText) && @@ -237,7 +236,6 @@ public boolean sameAs(@Nonnull TransitAlert other) { ); } - @Nonnull @Override public TransitBuilder copy() { return new TransitAlertBuilder(this); diff --git a/src/main/java/org/opentripplanner/routing/algorithm/mapping/StatesToWalkStepsMapper.java b/src/main/java/org/opentripplanner/routing/algorithm/mapping/StatesToWalkStepsMapper.java index 94905bb840a..32f5ccf533b 100644 --- a/src/main/java/org/opentripplanner/routing/algorithm/mapping/StatesToWalkStepsMapper.java +++ b/src/main/java/org/opentripplanner/routing/algorithm/mapping/StatesToWalkStepsMapper.java @@ -7,7 +7,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; -import javax.annotation.Nonnull; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Geometry; import org.opentripplanner.framework.geometry.DirectionUtils; @@ -296,7 +295,6 @@ private void processState(State backState, State forwardState) { current.addEdge(edge); } - @Nonnull private static RelativeDirection relativeDirectionForTransitLink(StreetTransitEntranceLink link) { if (link.isExit()) { return EXIT_STATION; diff --git a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/constrainedtransfer/ConstrainedTransferBoarding.java b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/constrainedtransfer/ConstrainedTransferBoarding.java index 63a0d50aa03..bf5de51e2c8 100644 --- a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/constrainedtransfer/ConstrainedTransferBoarding.java +++ b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/constrainedtransfer/ConstrainedTransferBoarding.java @@ -1,7 +1,6 @@ package org.opentripplanner.routing.algorithm.raptoradapter.transit.constrainedtransfer; import java.util.function.Consumer; -import javax.annotation.Nonnull; import org.opentripplanner.raptor.api.model.RaptorTransferConstraint; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; import org.opentripplanner.raptor.spi.RaptorBoardOrAlightEvent; @@ -20,7 +19,7 @@ public class ConstrainedTransferBoarding private final int earliestBoardTime; public ConstrainedTransferBoarding( - @Nonnull RaptorTransferConstraint constraint, + RaptorTransferConstraint constraint, int tripIndex, T trip, int stopPositionInPattern, @@ -41,7 +40,6 @@ public int tripIndex() { } @Override - @Nonnull public T trip() { return trip; } @@ -62,7 +60,6 @@ public int earliestBoardTime() { } @Override - @Nonnull public RaptorTransferConstraint transferConstraint() { return constraint; } diff --git a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/cost/PatternCostCalculator.java b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/cost/PatternCostCalculator.java index 734355f0ac5..d611c73b7ad 100644 --- a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/cost/PatternCostCalculator.java +++ b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/cost/PatternCostCalculator.java @@ -1,7 +1,6 @@ package org.opentripplanner.routing.algorithm.raptoradapter.transit.cost; import java.util.BitSet; -import javax.annotation.Nonnull; import org.opentripplanner.raptor.api.model.RaptorAccessEgress; import org.opentripplanner.raptor.api.model.RaptorTransferConstraint; import org.opentripplanner.raptor.spi.RaptorCostCalculator; @@ -13,9 +12,9 @@ class PatternCostCalculator implements RaptorCost private final RaptorCostLinearFunction unpreferredCost; PatternCostCalculator( - @Nonnull RaptorCostCalculator delegate, - @Nonnull BitSet unpreferredPatterns, - @Nonnull RaptorCostLinearFunction unpreferredCost + RaptorCostCalculator delegate, + BitSet unpreferredPatterns, + RaptorCostLinearFunction unpreferredCost ) { this.unpreferredPatterns = unpreferredPatterns; this.delegate = delegate; diff --git a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/cost/WheelchairCostCalculator.java b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/cost/WheelchairCostCalculator.java index d0697f78692..d68d2230a5c 100644 --- a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/cost/WheelchairCostCalculator.java +++ b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/cost/WheelchairCostCalculator.java @@ -1,6 +1,5 @@ package org.opentripplanner.routing.algorithm.raptoradapter.transit.cost; -import javax.annotation.Nonnull; import org.opentripplanner.raptor.api.model.RaptorAccessEgress; import org.opentripplanner.raptor.api.model.RaptorTransferConstraint; import org.opentripplanner.raptor.spi.RaptorCostCalculator; @@ -14,8 +13,8 @@ public class WheelchairCostCalculator private final int[] wheelchairBoardingCost; public WheelchairCostCalculator( - @Nonnull RaptorCostCalculator delegate, - @Nonnull AccessibilityPreferences wheelchairAccessibility + RaptorCostCalculator delegate, + AccessibilityPreferences wheelchairAccessibility ) { this.delegate = delegate; this.wheelchairBoardingCost = createWheelchairCost(wheelchairAccessibility); diff --git a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/frequency/FrequencyBoardOrAlightEvent.java b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/frequency/FrequencyBoardOrAlightEvent.java index 927b1d966ed..b2cbb51fb00 100644 --- a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/frequency/FrequencyBoardOrAlightEvent.java +++ b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/frequency/FrequencyBoardOrAlightEvent.java @@ -1,7 +1,6 @@ package org.opentripplanner.routing.algorithm.raptoradapter.transit.frequency; import java.time.LocalDate; -import javax.annotation.Nonnull; import org.opentripplanner.raptor.api.model.RaptorTransferConstraint; import org.opentripplanner.raptor.api.model.RaptorTripPattern; import org.opentripplanner.raptor.spi.RaptorBoardOrAlightEvent; @@ -90,7 +89,6 @@ public int earliestBoardTime() { } @Override - @Nonnull public RaptorTransferConstraint transferConstraint() { return RaptorTransferConstraint.REGULAR_TRANSFER; } diff --git a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RaptorRequestTransferCache.java b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RaptorRequestTransferCache.java index 99ad83d3f4d..5e274c4120f 100644 --- a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RaptorRequestTransferCache.java +++ b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RaptorRequestTransferCache.java @@ -6,7 +6,6 @@ import java.util.List; import java.util.Objects; import java.util.concurrent.ExecutionException; -import javax.annotation.Nonnull; import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.routing.algorithm.raptoradapter.transit.RaptorTransferIndex; import org.opentripplanner.routing.algorithm.raptoradapter.transit.Transfer; @@ -57,8 +56,7 @@ public RaptorTransferIndex get(List> transfersByStopIndex, RouteR private CacheLoader cacheLoader() { return new CacheLoader<>() { @Override - @Nonnull - public RaptorTransferIndex load(@Nonnull CacheKey cacheKey) { + public RaptorTransferIndex load(CacheKey cacheKey) { LOG.info("Adding runtime request to cache: {}", cacheKey.options); return RaptorTransferIndex.create(cacheKey.transfersByStopIndex, cacheKey.request); } diff --git a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RaptorRoutingRequestTransitData.java b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RaptorRoutingRequestTransitData.java index 5b9d81fa6c3..9717404d370 100644 --- a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RaptorRoutingRequestTransitData.java +++ b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RaptorRoutingRequestTransitData.java @@ -4,7 +4,6 @@ import java.util.BitSet; import java.util.Iterator; import java.util.List; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.framework.application.OTPFeature; import org.opentripplanner.framework.time.ServiceDateUtils; @@ -200,7 +199,6 @@ public RaptorConstrainedTransfer findConstrainedTransfer( }; } - @Nonnull @Override public RaptorStopNameResolver stopNameResolver() { return (int stopIndex) -> { diff --git a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TripScheduleAlightSearch.java b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TripScheduleAlightSearch.java index 7be4f1eecf9..5ece76aedb5 100644 --- a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TripScheduleAlightSearch.java +++ b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TripScheduleAlightSearch.java @@ -1,7 +1,6 @@ package org.opentripplanner.routing.algorithm.raptoradapter.transit.request; import java.util.function.IntUnaryOperator; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.raptor.api.model.RaptorConstants; @@ -76,7 +75,6 @@ public int stopPositionInPattern() { } @Override - @Nonnull public RaptorTransferConstraint transferConstraint() { return RaptorTransferConstraint.REGULAR_TRANSFER; } diff --git a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TripScheduleBoardSearch.java b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TripScheduleBoardSearch.java index 78bc2101775..db08dd2dada 100644 --- a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TripScheduleBoardSearch.java +++ b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TripScheduleBoardSearch.java @@ -1,7 +1,6 @@ package org.opentripplanner.routing.algorithm.raptoradapter.transit.request; import java.util.function.IntUnaryOperator; -import javax.annotation.Nonnull; import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.raptor.api.model.RaptorConstants; import org.opentripplanner.raptor.api.model.RaptorTransferConstraint; @@ -74,7 +73,6 @@ public int stopPositionInPattern() { } @Override - @Nonnull public RaptorTransferConstraint transferConstraint() { return RaptorTransferConstraint.REGULAR_TRANSFER; } diff --git a/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/services/TransferGenerator.java b/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/services/TransferGenerator.java index f06e2142073..0e5e5ebd8e0 100644 --- a/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/services/TransferGenerator.java +++ b/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/services/TransferGenerator.java @@ -5,7 +5,6 @@ import java.util.Comparator; import java.util.Iterator; import java.util.List; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.model.transfer.ConstrainedTransfer; import org.opentripplanner.raptor.api.model.RaptorTransfer; @@ -229,12 +228,10 @@ private int calcRegularTransferEarliestBoardTime( return from.time() + transferDuration; } - @Nonnull private StopTime getFromStopTime(final TransitPathLeg leg) { return StopTime.stopTime(leg.fromStop(), leg.fromTime()); } - @Nonnull private TripStopTime findMinimumToStopTime(List> transfers) { return transfers .stream() diff --git a/src/main/java/org/opentripplanner/routing/alternativelegs/AlternativeLegs.java b/src/main/java/org/opentripplanner/routing/alternativelegs/AlternativeLegs.java index 6b51c0b1282..465ed230884 100644 --- a/src/main/java/org/opentripplanner/routing/alternativelegs/AlternativeLegs.java +++ b/src/main/java/org/opentripplanner/routing/alternativelegs/AlternativeLegs.java @@ -16,7 +16,6 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; import java.util.stream.Stream; -import javax.annotation.Nonnull; import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.model.Timetable; import org.opentripplanner.model.TripTimeOnDate; @@ -138,7 +137,6 @@ public static List getAlternativeLegs( * This has been copied and slightly modified from StopTimesHelper. * TODO: Adapt after new transit model is in place */ - @Nonnull private static Stream generateLegs( TransitService transitService, TripPatternBetweenStops tripPatternBetweenStops, @@ -224,7 +222,6 @@ private static Stream generateLegs( return res.stream(); } - @Nonnull private static ScheduledTransitLeg mapToLeg( ZoneId timeZone, TripPattern pattern, @@ -264,7 +261,6 @@ private static ScheduledTransitLeg mapToLeg( .build(); } - @Nonnull private static Stream withBoardingAlightingPositions( Collection origins, Collection destinations, diff --git a/src/main/java/org/opentripplanner/routing/api/request/RequestModes.java b/src/main/java/org/opentripplanner/routing/api/request/RequestModes.java index 72b06f62979..8afb3082e1b 100644 --- a/src/main/java/org/opentripplanner/routing/api/request/RequestModes.java +++ b/src/main/java/org/opentripplanner/routing/api/request/RequestModes.java @@ -3,7 +3,6 @@ import static org.opentripplanner.routing.api.request.StreetMode.NOT_SET; import java.util.Objects; -import javax.annotation.Nonnull; import org.opentripplanner.framework.tostring.ToStringBuilder; public class RequestModes { @@ -18,16 +17,12 @@ public class RequestModes { StreetMode.WALK ); - @Nonnull public final StreetMode accessMode; - @Nonnull public final StreetMode egressMode; - @Nonnull public final StreetMode directMode; - @Nonnull public final StreetMode transferMode; private RequestModes( diff --git a/src/main/java/org/opentripplanner/routing/api/request/preference/RoutingPreferences.java b/src/main/java/org/opentripplanner/routing/api/request/preference/RoutingPreferences.java index 58ca5b180bf..5e5475d12ac 100644 --- a/src/main/java/org/opentripplanner/routing/api/request/preference/RoutingPreferences.java +++ b/src/main/java/org/opentripplanner/routing/api/request/preference/RoutingPreferences.java @@ -6,7 +6,6 @@ import java.io.Serializable; import java.util.Objects; import java.util.function.Consumer; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.routing.api.request.StreetMode; import org.opentripplanner.street.search.TraverseMode; @@ -81,7 +80,6 @@ public StreetPreferences street() { /** * Preferences for how strict wheel-accessibility settings are */ - @Nonnull public WheelchairPreferences wheelchair() { return wheelchair; } @@ -108,7 +106,6 @@ public VehicleParkingPreferences parking(TraverseMode mode) { /** * Get rental preferences for the traverse mode. Note, only car, scooter and bike are supported. */ - @Nonnull public VehicleRentalPreferences rental(TraverseMode mode) { return switch (mode) { case BICYCLE -> bike.rental(); @@ -131,7 +128,6 @@ public VehicleRentalPreferences rental(StreetMode mode) { }; } - @Nonnull public ItineraryFilterPreferences itineraryFilter() { return itineraryFilter; } diff --git a/src/main/java/org/opentripplanner/routing/api/request/preference/StreetPreferences.java b/src/main/java/org/opentripplanner/routing/api/request/preference/StreetPreferences.java index 6ea6ee1fc3a..166c950a0e7 100644 --- a/src/main/java/org/opentripplanner/routing/api/request/preference/StreetPreferences.java +++ b/src/main/java/org/opentripplanner/routing/api/request/preference/StreetPreferences.java @@ -9,7 +9,6 @@ import java.util.Map; import java.util.Objects; import java.util.function.Consumer; -import javax.annotation.Nonnull; import org.opentripplanner.framework.lang.DoubleUtils; import org.opentripplanner.framework.model.Units; import org.opentripplanner.framework.tostring.ToStringBuilder; @@ -100,7 +99,6 @@ public DurationForEnum maxDirectDuration() { * CAR). So the default timeout for a street search is set quite high. This is used to abort the * search if the max distance is not reached within the timeout. */ - @Nonnull public Duration routingTimeout() { return routingTimeout; } diff --git a/src/main/java/org/opentripplanner/routing/api/request/preference/filter/VehicleParkingFilter.java b/src/main/java/org/opentripplanner/routing/api/request/preference/filter/VehicleParkingFilter.java index c4f5cee422f..3fb6d6b0a62 100644 --- a/src/main/java/org/opentripplanner/routing/api/request/preference/filter/VehicleParkingFilter.java +++ b/src/main/java/org/opentripplanner/routing/api/request/preference/filter/VehicleParkingFilter.java @@ -4,7 +4,6 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; -import javax.annotation.Nonnull; import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.routing.vehicle_parking.VehicleParking; @@ -87,7 +86,6 @@ public int hashCode() { return Arrays.hashCode(not) + Arrays.hashCode(select); } - @Nonnull private static VehicleParkingSelect[] makeFilter(Collection select) { return select.stream().filter(f -> !f.isEmpty()).toArray(VehicleParkingSelect[]::new); } diff --git a/src/main/java/org/opentripplanner/routing/graph/Graph.java b/src/main/java/org/opentripplanner/routing/graph/Graph.java index fa3d12b92f7..1fbea77e759 100644 --- a/src/main/java/org/opentripplanner/routing/graph/Graph.java +++ b/src/main/java/org/opentripplanner/routing/graph/Graph.java @@ -12,7 +12,6 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.prefs.Preferences; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.locationtech.jts.geom.Geometry; import org.opentripplanner.ext.dataoverlay.configuration.DataOverlayParameterBindings; @@ -363,7 +362,6 @@ public void setDistanceBetweenElevationSamples(double distanceBetweenElevationSa CompactElevationProfile.setDistanceBetweenSamplesM(distanceBetweenElevationSamples); } - @Nonnull public VehicleParkingService getVehicleParkingService() { return vehicleParkingService; } diff --git a/src/main/java/org/opentripplanner/service/realtimevehicles/RealtimeVehicleService.java b/src/main/java/org/opentripplanner/service/realtimevehicles/RealtimeVehicleService.java index 949b196faeb..d697853880d 100644 --- a/src/main/java/org/opentripplanner/service/realtimevehicles/RealtimeVehicleService.java +++ b/src/main/java/org/opentripplanner/service/realtimevehicles/RealtimeVehicleService.java @@ -1,7 +1,6 @@ package org.opentripplanner.service.realtimevehicles; import java.util.List; -import javax.annotation.Nonnull; import org.opentripplanner.service.realtimevehicles.model.RealtimeVehicle; import org.opentripplanner.transit.model.network.TripPattern; import org.opentripplanner.transit.model.timetable.OccupancyStatus; @@ -12,11 +11,11 @@ public interface RealtimeVehicleService { * Get the realtime vehicles for a certain trip pattern. Service contains all the vehicles that * exist in input feeds but doesn't store any historical data. */ - List getRealtimeVehicles(@Nonnull TripPattern pattern); + List getRealtimeVehicles(TripPattern pattern); /** * Get the latest occupancy status for a certain trip. Service contains all the vehicles that * exist in input feeds but doesn't store any historical data. */ - OccupancyStatus getVehicleOccupancyStatus(@Nonnull Trip trip); + OccupancyStatus getVehicleOccupancyStatus(Trip trip); } diff --git a/src/main/java/org/opentripplanner/service/realtimevehicles/internal/DefaultRealtimeVehicleService.java b/src/main/java/org/opentripplanner/service/realtimevehicles/internal/DefaultRealtimeVehicleService.java index 0058cdd9e15..17a4d22e60c 100644 --- a/src/main/java/org/opentripplanner/service/realtimevehicles/internal/DefaultRealtimeVehicleService.java +++ b/src/main/java/org/opentripplanner/service/realtimevehicles/internal/DefaultRealtimeVehicleService.java @@ -9,7 +9,6 @@ import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import javax.annotation.Nonnull; import org.opentripplanner.service.realtimevehicles.RealtimeVehicleRepository; import org.opentripplanner.service.realtimevehicles.RealtimeVehicleService; import org.opentripplanner.service.realtimevehicles.model.RealtimeVehicle; @@ -58,7 +57,7 @@ public void clearRealtimeVehicles(TripPattern pattern) { * @see DefaultRealtimeVehicleService#setRealtimeVehicles(TripPattern, List) */ @Override - public List getRealtimeVehicles(@Nonnull TripPattern pattern) { + public List getRealtimeVehicles(TripPattern pattern) { if (pattern.getOriginalTripPattern() != null) { pattern = pattern.getOriginalTripPattern(); } @@ -66,9 +65,8 @@ public List getRealtimeVehicles(@Nonnull TripPattern pattern) { return vehicles.getOrDefault(pattern, List.of()); } - @Nonnull @Override - public OccupancyStatus getVehicleOccupancyStatus(@Nonnull Trip trip) { + public OccupancyStatus getVehicleOccupancyStatus(Trip trip) { return getOccupancyStatus(trip.getId(), transitService.getPatternForTrip(trip)); } diff --git a/src/main/java/org/opentripplanner/service/realtimevehicles/model/RealtimeVehicle.java b/src/main/java/org/opentripplanner/service/realtimevehicles/model/RealtimeVehicle.java index e06ae5ebaa7..fb0cbb28dbe 100644 --- a/src/main/java/org/opentripplanner/service/realtimevehicles/model/RealtimeVehicle.java +++ b/src/main/java/org/opentripplanner/service/realtimevehicles/model/RealtimeVehicle.java @@ -2,7 +2,6 @@ import java.time.Instant; import java.util.Optional; -import javax.annotation.Nonnull; import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.site.StopLocation; @@ -91,7 +90,6 @@ public Optional stop() { return Optional.ofNullable(stop); } - @Nonnull public Trip trip() { return trip; } diff --git a/src/main/java/org/opentripplanner/service/vehiclerental/street/StreetVehicleRentalLink.java b/src/main/java/org/opentripplanner/service/vehiclerental/street/StreetVehicleRentalLink.java index 2c39d9d4cee..99775b6112d 100644 --- a/src/main/java/org/opentripplanner/service/vehiclerental/street/StreetVehicleRentalLink.java +++ b/src/main/java/org/opentripplanner/service/vehiclerental/street/StreetVehicleRentalLink.java @@ -1,6 +1,5 @@ package org.opentripplanner.service.vehiclerental.street; -import javax.annotation.Nonnull; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.street.model.vertex.StreetVertex; @@ -39,7 +38,6 @@ public static StreetVehicleRentalLink createStreetVehicleRentalLink( } @Override - @Nonnull public State[] traverse(State s0) { // Disallow traversing two StreetBikeRentalLinks in a row. // This prevents the router from using bike rental stations as shortcuts to get around diff --git a/src/main/java/org/opentripplanner/service/vehiclerental/street/VehicleRentalEdge.java b/src/main/java/org/opentripplanner/service/vehiclerental/street/VehicleRentalEdge.java index dc9fed8b9a3..0935909e0c7 100644 --- a/src/main/java/org/opentripplanner/service/vehiclerental/street/VehicleRentalEdge.java +++ b/src/main/java/org/opentripplanner/service/vehiclerental/street/VehicleRentalEdge.java @@ -2,7 +2,6 @@ import java.util.Collections; import java.util.Set; -import javax.annotation.Nonnull; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.routing.api.request.StreetMode; import org.opentripplanner.service.vehiclerental.model.VehicleRentalPlace; @@ -33,7 +32,6 @@ public static VehicleRentalEdge createVehicleRentalEdge( } @Override - @Nonnull public State[] traverse(State s0) { if (!s0.getRequest().mode().includesRenting()) { return State.empty(); diff --git a/src/main/java/org/opentripplanner/service/vehiclerental/street/VehicleRentalPlaceVertex.java b/src/main/java/org/opentripplanner/service/vehiclerental/street/VehicleRentalPlaceVertex.java index 5a04d56d60c..903747b0206 100644 --- a/src/main/java/org/opentripplanner/service/vehiclerental/street/VehicleRentalPlaceVertex.java +++ b/src/main/java/org/opentripplanner/service/vehiclerental/street/VehicleRentalPlaceVertex.java @@ -1,6 +1,5 @@ package org.opentripplanner.service.vehiclerental.street; -import javax.annotation.Nonnull; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.service.vehiclerental.model.VehicleRentalPlace; import org.opentripplanner.street.model.vertex.Vertex; @@ -20,7 +19,6 @@ public VehicleRentalPlaceVertex(VehicleRentalPlace station) { this.station = station; } - @Nonnull @Override public I18NString getName() { return station.getName(); diff --git a/src/main/java/org/opentripplanner/service/worldenvelope/WorldEnvelopeRepository.java b/src/main/java/org/opentripplanner/service/worldenvelope/WorldEnvelopeRepository.java index 5aba781f79c..bdf9df4f8d3 100644 --- a/src/main/java/org/opentripplanner/service/worldenvelope/WorldEnvelopeRepository.java +++ b/src/main/java/org/opentripplanner/service/worldenvelope/WorldEnvelopeRepository.java @@ -2,7 +2,6 @@ import java.io.Serializable; import java.util.Optional; -import javax.annotation.Nonnull; import org.opentripplanner.service.worldenvelope.model.WorldEnvelope; /** @@ -27,5 +26,5 @@ public interface WorldEnvelopeRepository extends Serializable { Optional retrieveEnvelope(); - void saveEnvelope(@Nonnull WorldEnvelope envelope); + void saveEnvelope(WorldEnvelope envelope); } diff --git a/src/main/java/org/opentripplanner/service/worldenvelope/internal/DefaultWorldEnvelopeRepository.java b/src/main/java/org/opentripplanner/service/worldenvelope/internal/DefaultWorldEnvelopeRepository.java index 1fea3c4aeda..226122c803b 100644 --- a/src/main/java/org/opentripplanner/service/worldenvelope/internal/DefaultWorldEnvelopeRepository.java +++ b/src/main/java/org/opentripplanner/service/worldenvelope/internal/DefaultWorldEnvelopeRepository.java @@ -4,7 +4,6 @@ import jakarta.inject.Singleton; import java.io.Serializable; import java.util.Optional; -import javax.annotation.Nonnull; import org.opentripplanner.service.worldenvelope.WorldEnvelopeRepository; import org.opentripplanner.service.worldenvelope.model.WorldEnvelope; @@ -26,7 +25,7 @@ public Optional retrieveEnvelope() { } @Override - public void saveEnvelope(@Nonnull WorldEnvelope envelope) { + public void saveEnvelope(WorldEnvelope envelope) { this.envelope = envelope; } } diff --git a/src/main/java/org/opentripplanner/standalone/config/BuildConfig.java b/src/main/java/org/opentripplanner/standalone/config/BuildConfig.java index 62b4d09a1bb..ef2931b987e 100644 --- a/src/main/java/org/opentripplanner/standalone/config/BuildConfig.java +++ b/src/main/java/org/opentripplanner/standalone/config/BuildConfig.java @@ -17,7 +17,6 @@ import java.util.List; import java.util.Set; import java.util.regex.Pattern; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.datastore.api.OtpDataStoreConfig; import org.opentripplanner.ext.dataoverlay.configuration.DataOverlayConfig; @@ -675,13 +674,11 @@ public List demFiles() { return dem.demFiles(); } - @Nonnull @Override public List gtfsFiles() { return transitFeeds.gtfsFiles(); } - @Nonnull @Override public List netexFiles() { return transitFeeds.netexFiles(); diff --git a/src/main/java/org/opentripplanner/standalone/config/buildconfig/TransitFeeds.java b/src/main/java/org/opentripplanner/standalone/config/buildconfig/TransitFeeds.java index 91485f09e05..c4a57213afa 100644 --- a/src/main/java/org/opentripplanner/standalone/config/buildconfig/TransitFeeds.java +++ b/src/main/java/org/opentripplanner/standalone/config/buildconfig/TransitFeeds.java @@ -2,14 +2,13 @@ import java.net.URI; import java.util.List; -import javax.annotation.Nonnull; import org.opentripplanner.graph_builder.model.DataSourceConfig; import org.opentripplanner.gtfs.graphbuilder.GtfsFeedParameters; import org.opentripplanner.netex.config.NetexFeedParameters; public record TransitFeeds( - @Nonnull List gtfsFeeds, - @Nonnull List netexFeeds + List gtfsFeeds, + List netexFeeds ) { public TransitFeeds(List gtfsFeeds, List netexFeeds) { this.netexFeeds = netexFeeds; diff --git a/src/main/java/org/opentripplanner/standalone/config/framework/json/ConfigType.java b/src/main/java/org/opentripplanner/standalone/config/framework/json/ConfigType.java index f62ec56dbfc..fec5cb05a51 100644 --- a/src/main/java/org/opentripplanner/standalone/config/framework/json/ConfigType.java +++ b/src/main/java/org/opentripplanner/standalone/config/framework/json/ConfigType.java @@ -5,7 +5,6 @@ import java.util.Arrays; import java.util.EnumSet; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.framework.lang.StringUtils; import org.opentripplanner.framework.text.MarkdownFormatter; @@ -157,7 +156,7 @@ public String docName() { /** * Quote the given {@code value} is the JSON type is a {@code string}. */ - public String quote(@Nonnull Object value) { + public String quote(Object value) { return type == JsonType.string ? quoteText(value) : value.toString(); } diff --git a/src/main/java/org/opentripplanner/standalone/config/framework/json/NodeAdapter.java b/src/main/java/org/opentripplanner/standalone/config/framework/json/NodeAdapter.java index 51303ea4fc5..273c630d2bf 100644 --- a/src/main/java/org/opentripplanner/standalone/config/framework/json/NodeAdapter.java +++ b/src/main/java/org/opentripplanner/standalone/config/framework/json/NodeAdapter.java @@ -12,7 +12,6 @@ import java.util.Set; import java.util.function.Consumer; import java.util.stream.Stream; -import javax.annotation.Nonnull; import org.opentripplanner.framework.application.OtpAppException; /** @@ -63,21 +62,21 @@ public class NodeAdapter { private final int level; - private NodeAdapter(@Nonnull JsonNode node, String source, String contextPath, int level) { + private NodeAdapter(JsonNode node, String source, String contextPath, int level) { this.json = node; this.source = source; this.contextPath = contextPath; this.level = level; } - public NodeAdapter(@Nonnull JsonNode node, String source) { + public NodeAdapter(JsonNode node, String source) { this(node, source, null, 0); } /** * Constructor for nested configuration nodes. */ - private NodeAdapter(@Nonnull JsonNode node, @Nonnull NodeAdapter parent, String paramName) { + private NodeAdapter(JsonNode node, NodeAdapter parent, String paramName) { this(node, parent.source, parent.fullPath(paramName), parent.level + 1); parent.childrenByName.put(paramName, this); } diff --git a/src/main/java/org/opentripplanner/standalone/config/framework/json/NodeInfo.java b/src/main/java/org/opentripplanner/standalone/config/framework/json/NodeInfo.java index 06675475fd1..ce29639b924 100644 --- a/src/main/java/org/opentripplanner/standalone/config/framework/json/NodeInfo.java +++ b/src/main/java/org/opentripplanner/standalone/config/framework/json/NodeInfo.java @@ -5,7 +5,6 @@ import java.util.Arrays; import java.util.List; import java.util.Objects; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.framework.lang.StringUtils; import org.opentripplanner.framework.tostring.ValueObjectToStringBuilder; @@ -187,7 +186,7 @@ public String toString() { * */ @Override - public int compareTo(@Nonnull NodeInfo other) { + public int compareTo(NodeInfo other) { // Put type qualifier first if (isTypeQualifier()) { return -1; diff --git a/src/main/java/org/opentripplanner/street/model/edge/AreaEdgeList.java b/src/main/java/org/opentripplanner/street/model/edge/AreaEdgeList.java index 09eb347ac5d..1f8d286995b 100644 --- a/src/main/java/org/opentripplanner/street/model/edge/AreaEdgeList.java +++ b/src/main/java/org/opentripplanner/street/model/edge/AreaEdgeList.java @@ -7,7 +7,6 @@ import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.annotation.Nonnull; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.Polygon; import org.opentripplanner.street.model.vertex.IntersectionVertex; @@ -60,7 +59,6 @@ public Geometry getGeometry() { /** * Returns the list of visibility vertices. */ - @Nonnull public Set visibilityVertices() { return visibilityVertices; } @@ -68,7 +66,7 @@ public Set visibilityVertices() { /** * Add a visibility vertex to this edge. */ - public void addVisibilityVertex(@Nonnull IntersectionVertex toBeAdded) { + public void addVisibilityVertex(IntersectionVertex toBeAdded) { Objects.requireNonNull(toBeAdded); synchronized (this) { if (visibilityVertices == EMPTY_SET) { diff --git a/src/main/java/org/opentripplanner/street/model/edge/ElevatorAlightEdge.java b/src/main/java/org/opentripplanner/street/model/edge/ElevatorAlightEdge.java index 97aee90e244..ca3b0b4b0f7 100644 --- a/src/main/java/org/opentripplanner/street/model/edge/ElevatorAlightEdge.java +++ b/src/main/java/org/opentripplanner/street/model/edge/ElevatorAlightEdge.java @@ -1,6 +1,5 @@ package org.opentripplanner.street.model.edge; -import javax.annotation.Nonnull; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.LineString; import org.opentripplanner.framework.geometry.GeometryUtils; @@ -57,7 +56,6 @@ public static ElevatorAlightEdge createElevatorAlightEdge( } @Override - @Nonnull public State[] traverse(State s0) { StateEditor s1 = createEditorForDrivingOrWalking(s0, this); s1.incrementWeight(1); diff --git a/src/main/java/org/opentripplanner/street/model/edge/ElevatorBoardEdge.java b/src/main/java/org/opentripplanner/street/model/edge/ElevatorBoardEdge.java index 8c85cb4ff2a..81856476f2e 100644 --- a/src/main/java/org/opentripplanner/street/model/edge/ElevatorBoardEdge.java +++ b/src/main/java/org/opentripplanner/street/model/edge/ElevatorBoardEdge.java @@ -1,7 +1,6 @@ package org.opentripplanner.street.model.edge; import java.util.List; -import javax.annotation.Nonnull; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.LineString; import org.opentripplanner.framework.geometry.GeometryUtils; @@ -42,7 +41,6 @@ public static ElevatorBoardEdge createElevatorBoardEdge( } @Override - @Nonnull public State[] traverse(State s0) { StateEditor s1 = createEditorForDrivingOrWalking(s0, this); if (s1 == null) { diff --git a/src/main/java/org/opentripplanner/street/model/edge/ElevatorHopEdge.java b/src/main/java/org/opentripplanner/street/model/edge/ElevatorHopEdge.java index 5135eb471de..4acecd05a64 100644 --- a/src/main/java/org/opentripplanner/street/model/edge/ElevatorHopEdge.java +++ b/src/main/java/org/opentripplanner/street/model/edge/ElevatorHopEdge.java @@ -1,6 +1,5 @@ package org.opentripplanner.street.model.edge; -import javax.annotation.Nonnull; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.routing.api.request.preference.RoutingPreferences; @@ -101,7 +100,6 @@ public StreetTraversalPermission getPermission() { } @Override - @Nonnull public State[] traverse(State s0) { RoutingPreferences preferences = s0.getPreferences(); diff --git a/src/main/java/org/opentripplanner/street/model/edge/EscalatorEdge.java b/src/main/java/org/opentripplanner/street/model/edge/EscalatorEdge.java index 5a6927bfb53..20fae657c78 100644 --- a/src/main/java/org/opentripplanner/street/model/edge/EscalatorEdge.java +++ b/src/main/java/org/opentripplanner/street/model/edge/EscalatorEdge.java @@ -1,6 +1,5 @@ package org.opentripplanner.street.model.edge; -import javax.annotation.Nonnull; import org.locationtech.jts.geom.LineString; import org.opentripplanner.framework.geometry.GeometryUtils; import org.opentripplanner.framework.i18n.I18NString; @@ -24,7 +23,6 @@ private EscalatorEdge(Vertex v1, Vertex v2, double length) { this.length = length; } - @Nonnull @Override public State[] traverse(State s0) { // Only allow traversal by walking diff --git a/src/main/java/org/opentripplanner/street/model/edge/FreeEdge.java b/src/main/java/org/opentripplanner/street/model/edge/FreeEdge.java index 53fef7110fa..3b1631211ff 100644 --- a/src/main/java/org/opentripplanner/street/model/edge/FreeEdge.java +++ b/src/main/java/org/opentripplanner/street/model/edge/FreeEdge.java @@ -1,6 +1,5 @@ package org.opentripplanner.street.model.edge; -import javax.annotation.Nonnull; import org.locationtech.jts.geom.LineString; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.street.model.vertex.Vertex; @@ -24,7 +23,6 @@ public static FreeEdge createFreeEdge(Vertex from, Vertex to) { } @Override - @Nonnull public State[] traverse(State s0) { StateEditor s1 = s0.edit(this); s1.incrementWeight(1); diff --git a/src/main/java/org/opentripplanner/street/model/edge/PathwayEdge.java b/src/main/java/org/opentripplanner/street/model/edge/PathwayEdge.java index 587b25a6704..703658fdda4 100644 --- a/src/main/java/org/opentripplanner/street/model/edge/PathwayEdge.java +++ b/src/main/java/org/opentripplanner/street/model/edge/PathwayEdge.java @@ -2,7 +2,6 @@ import java.util.Objects; import java.util.Optional; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.LineString; @@ -103,7 +102,6 @@ public static PathwayEdge createPathwayEdge( } @Override - @Nonnull public State[] traverse(State s0) { StateEditor s1 = createEditorForWalking(s0, this); if (s1 == null) { diff --git a/src/main/java/org/opentripplanner/street/model/edge/StreetEdge.java b/src/main/java/org/opentripplanner/street/model/edge/StreetEdge.java index 06bb129f729..92244fe2af2 100644 --- a/src/main/java/org/opentripplanner/street/model/edge/StreetEdge.java +++ b/src/main/java/org/opentripplanner/street/model/edge/StreetEdge.java @@ -9,7 +9,6 @@ import java.util.Objects; import java.util.Optional; import java.util.stream.Stream; -import javax.annotation.Nonnull; import org.locationtech.jts.geom.LineString; import org.locationtech.jts.geom.impl.PackedCoordinateSequence; import org.opentripplanner.framework.geometry.CompactLineStringUtils; @@ -327,7 +326,6 @@ public boolean isRoundabout() { } @Override - @Nonnull public State[] traverse(State s0) { final StateEditor editor; @@ -855,7 +853,6 @@ public void removeTurnRestrictionsTo(Edge other) { * This method is thread-safe, even if {@link StreetEdge#addTurnRestriction} or * {@link StreetEdge#removeTurnRestriction} is called concurrently. */ - @Nonnull public List getTurnRestrictions() { // this can be safely returned as it's unmodifiable return turnRestrictions; @@ -989,7 +986,6 @@ static int defaultMillimeterLength(LineString geometry) { * When we then leave the no drop off zone on foot we generate a state for each network that the * zone applies to where we pick up a vehicle with a specific network. */ - @Nonnull private State[] splitStatesAfterHavingExitedNoDropOffZoneWhenReverseSearching(State s0) { var networks = Stream.concat( // null is a special rental network that speculatively assumes that you can take any vehicle @@ -1191,7 +1187,6 @@ private StateEditor doTraverse(State s0, TraverseMode traverseMode, boolean walk return s1; } - @Nonnull private TraversalCosts otherTraversalCosts( RoutingPreferences preferences, TraverseMode traverseMode, @@ -1210,7 +1205,6 @@ private TraversalCosts otherTraversalCosts( return new TraversalCosts(time, weight); } - @Nonnull private TraversalCosts bicycleOrScooterTraversalCost( RoutingPreferences pref, TraverseMode mode, @@ -1255,7 +1249,6 @@ private TraversalCosts bicycleOrScooterTraversalCost( return new TraversalCosts(time, weight); } - @Nonnull private TraversalCosts walkingTraversalCosts( RoutingPreferences preferences, TraverseMode traverseMode, diff --git a/src/main/java/org/opentripplanner/street/model/edge/StreetTransitEntityLink.java b/src/main/java/org/opentripplanner/street/model/edge/StreetTransitEntityLink.java index de03dcc3549..92897232700 100644 --- a/src/main/java/org/opentripplanner/street/model/edge/StreetTransitEntityLink.java +++ b/src/main/java/org/opentripplanner/street/model/edge/StreetTransitEntityLink.java @@ -1,6 +1,5 @@ package org.opentripplanner.street.model.edge; -import javax.annotation.Nonnull; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.LineString; import org.opentripplanner.framework.geometry.GeometryUtils; @@ -47,7 +46,6 @@ protected StreetTransitEntityLink( } @Override - @Nonnull public State[] traverse(State s0) { // Forbid taking shortcuts composed of two street-transit links associated with the same stop in a row. Also // avoids spurious leg transitions. As noted in https://github.com/opentripplanner/OpenTripPlanner/issues/2815, @@ -131,7 +129,6 @@ else if ( }; } - @Nonnull private State[] buildState(State s0, StateEditor s1, RoutingPreferences pref) { if (s0.isRentingVehicleFromStation() && s0.mayKeepRentedVehicleAtDestination()) { var rentalPreferences = s0.getRequest().preferences().rental(s0.getRequest().mode()); diff --git a/src/main/java/org/opentripplanner/street/model/edge/StreetVehicleParkingLink.java b/src/main/java/org/opentripplanner/street/model/edge/StreetVehicleParkingLink.java index 0dd3f54139f..e8fbae31b5f 100644 --- a/src/main/java/org/opentripplanner/street/model/edge/StreetVehicleParkingLink.java +++ b/src/main/java/org/opentripplanner/street/model/edge/StreetVehicleParkingLink.java @@ -1,6 +1,5 @@ package org.opentripplanner.street.model.edge; -import javax.annotation.Nonnull; import org.locationtech.jts.geom.LineString; import org.opentripplanner.framework.geometry.GeometryUtils; import org.opentripplanner.framework.i18n.I18NString; @@ -45,7 +44,6 @@ public static StreetVehicleParkingLink createStreetVehicleParkingLink( } @Override - @Nonnull public State[] traverse(State s0) { // Disallow traversing two StreetBikeParkLinks in a row. // Prevents router using bike rental stations as shortcuts to get around diff --git a/src/main/java/org/opentripplanner/street/model/edge/TemporaryFreeEdge.java b/src/main/java/org/opentripplanner/street/model/edge/TemporaryFreeEdge.java index d2fbb55a941..7b114cfeade 100644 --- a/src/main/java/org/opentripplanner/street/model/edge/TemporaryFreeEdge.java +++ b/src/main/java/org/opentripplanner/street/model/edge/TemporaryFreeEdge.java @@ -1,6 +1,5 @@ package org.opentripplanner.street.model.edge; -import javax.annotation.Nonnull; import org.opentripplanner.street.model.vertex.TemporaryVertex; import org.opentripplanner.street.model.vertex.Vertex; import org.opentripplanner.street.search.state.State; @@ -31,7 +30,6 @@ public static TemporaryFreeEdge createTemporaryFreeEdge(Vertex from, TemporaryVe } @Override - @Nonnull public State[] traverse(State s0) { StateEditor s1 = s0.edit(this); s1.incrementWeight(1); diff --git a/src/main/java/org/opentripplanner/street/model/edge/VehicleParkingEdge.java b/src/main/java/org/opentripplanner/street/model/edge/VehicleParkingEdge.java index b8d21520187..95d9ea5507d 100644 --- a/src/main/java/org/opentripplanner/street/model/edge/VehicleParkingEdge.java +++ b/src/main/java/org/opentripplanner/street/model/edge/VehicleParkingEdge.java @@ -1,7 +1,6 @@ package org.opentripplanner.street.model.edge; import java.time.Duration; -import javax.annotation.Nonnull; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.framework.model.Cost; import org.opentripplanner.routing.api.request.StreetMode; @@ -63,7 +62,6 @@ public boolean equals(Object o) { } @Override - @Nonnull public State[] traverse(State s0) { if (!s0.getRequest().mode().includesParking()) { return State.empty(); diff --git a/src/main/java/org/opentripplanner/street/model/vertex/ElevatorOffboardVertex.java b/src/main/java/org/opentripplanner/street/model/vertex/ElevatorOffboardVertex.java index 7fd66d8a759..89148bc6ace 100644 --- a/src/main/java/org/opentripplanner/street/model/vertex/ElevatorOffboardVertex.java +++ b/src/main/java/org/opentripplanner/street/model/vertex/ElevatorOffboardVertex.java @@ -1,6 +1,5 @@ package org.opentripplanner.street.model.vertex; -import javax.annotation.Nonnull; import org.opentripplanner.framework.i18n.I18NString; public class ElevatorOffboardVertex extends StreetVertex { @@ -20,7 +19,6 @@ public VertexLabel getLabel() { return VertexLabel.string(LABEL_TEMPLATE.formatted(label, level)); } - @Nonnull @Override public I18NString getName() { return I18NString.of(label); diff --git a/src/main/java/org/opentripplanner/street/model/vertex/ElevatorOnboardVertex.java b/src/main/java/org/opentripplanner/street/model/vertex/ElevatorOnboardVertex.java index 5999b293ce7..5f6f19e2dab 100644 --- a/src/main/java/org/opentripplanner/street/model/vertex/ElevatorOnboardVertex.java +++ b/src/main/java/org/opentripplanner/street/model/vertex/ElevatorOnboardVertex.java @@ -1,6 +1,5 @@ package org.opentripplanner.street.model.vertex; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.framework.i18n.I18NString; @@ -21,7 +20,6 @@ public VertexLabel getLabel() { return VertexLabel.string(LABEL_TEMPLATE.formatted(label, level)); } - @Nonnull @Override public I18NString getName() { return I18NString.of(label); diff --git a/src/main/java/org/opentripplanner/street/model/vertex/LabelledIntersectionVertex.java b/src/main/java/org/opentripplanner/street/model/vertex/LabelledIntersectionVertex.java index c32ac19fd89..ecb82b43008 100644 --- a/src/main/java/org/opentripplanner/street/model/vertex/LabelledIntersectionVertex.java +++ b/src/main/java/org/opentripplanner/street/model/vertex/LabelledIntersectionVertex.java @@ -1,6 +1,5 @@ package org.opentripplanner.street.model.vertex; -import javax.annotation.Nonnull; import org.opentripplanner.framework.i18n.I18NString; /** @@ -12,7 +11,7 @@ public class LabelledIntersectionVertex extends IntersectionVertex { private final String label; public LabelledIntersectionVertex( - @Nonnull String label, + String label, double x, double y, boolean hasHighwayTrafficLight, @@ -27,7 +26,6 @@ public VertexLabel getLabel() { return VertexLabel.string(label); } - @Nonnull @Override public I18NString getName() { return I18NString.of(label); diff --git a/src/main/java/org/opentripplanner/street/model/vertex/OsmBoardingLocationVertex.java b/src/main/java/org/opentripplanner/street/model/vertex/OsmBoardingLocationVertex.java index 606c27ef4b2..8ba8b25c2b2 100644 --- a/src/main/java/org/opentripplanner/street/model/vertex/OsmBoardingLocationVertex.java +++ b/src/main/java/org/opentripplanner/street/model/vertex/OsmBoardingLocationVertex.java @@ -3,7 +3,6 @@ import java.util.Collection; import java.util.Objects; import java.util.Set; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.framework.tostring.ToStringBuilder; @@ -44,7 +43,6 @@ public boolean isConnectedToStreetNetwork() { return (getOutgoing().size() + getIncoming().size()) > 0; } - @Nonnull @Override public I18NString getName() { return name; diff --git a/src/main/java/org/opentripplanner/street/model/vertex/OsmVertex.java b/src/main/java/org/opentripplanner/street/model/vertex/OsmVertex.java index e4784e6edb9..39d195f695e 100644 --- a/src/main/java/org/opentripplanner/street/model/vertex/OsmVertex.java +++ b/src/main/java/org/opentripplanner/street/model/vertex/OsmVertex.java @@ -1,6 +1,5 @@ package org.opentripplanner.street.model.vertex; -import javax.annotation.Nonnull; import org.opentripplanner.framework.i18n.I18NString; /** @@ -29,7 +28,6 @@ public OsmVertex( this.nodeId = nodeId; } - @Nonnull @Override public I18NString getName() { return NO_NAME; diff --git a/src/main/java/org/opentripplanner/street/model/vertex/SplitterVertex.java b/src/main/java/org/opentripplanner/street/model/vertex/SplitterVertex.java index 0362f6e1766..c1fc60983e4 100644 --- a/src/main/java/org/opentripplanner/street/model/vertex/SplitterVertex.java +++ b/src/main/java/org/opentripplanner/street/model/vertex/SplitterVertex.java @@ -1,6 +1,5 @@ package org.opentripplanner.street.model.vertex; -import javax.annotation.Nonnull; import org.opentripplanner.framework.i18n.I18NString; /** @@ -31,7 +30,6 @@ public boolean inferredFreeFlowing() { return true; } - @Nonnull @Override public I18NString getName() { return name; diff --git a/src/main/java/org/opentripplanner/street/model/vertex/StationElementVertex.java b/src/main/java/org/opentripplanner/street/model/vertex/StationElementVertex.java index 3c72905333c..63595803300 100644 --- a/src/main/java/org/opentripplanner/street/model/vertex/StationElementVertex.java +++ b/src/main/java/org/opentripplanner/street/model/vertex/StationElementVertex.java @@ -1,6 +1,5 @@ package org.opentripplanner.street.model.vertex; -import javax.annotation.Nonnull; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.site.StationElement; @@ -22,10 +21,8 @@ public final VertexLabel getLabel() { } /** Get the corresponding StationElement */ - @Nonnull public abstract StationElement getStationElement(); - @Nonnull @Override public I18NString getName() { return name; diff --git a/src/main/java/org/opentripplanner/street/model/vertex/StreetLocation.java b/src/main/java/org/opentripplanner/street/model/vertex/StreetLocation.java index 31b25ec7b7d..44ca1f4db32 100644 --- a/src/main/java/org/opentripplanner/street/model/vertex/StreetLocation.java +++ b/src/main/java/org/opentripplanner/street/model/vertex/StreetLocation.java @@ -1,6 +1,5 @@ package org.opentripplanner.street.model.vertex; -import javax.annotation.Nonnull; import org.locationtech.jts.geom.Coordinate; import org.opentripplanner.framework.i18n.I18NString; @@ -42,7 +41,6 @@ public I18NString getIntersectionName() { return getName(); } - @Nonnull @Override public I18NString getName() { return name; diff --git a/src/main/java/org/opentripplanner/street/model/vertex/StreetVertex.java b/src/main/java/org/opentripplanner/street/model/vertex/StreetVertex.java index 64438667af8..8b58466a33c 100644 --- a/src/main/java/org/opentripplanner/street/model/vertex/StreetVertex.java +++ b/src/main/java/org/opentripplanner/street/model/vertex/StreetVertex.java @@ -8,7 +8,6 @@ import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.annotation.Nonnull; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.framework.i18n.LocalizedString; import org.opentripplanner.street.model.edge.Edge; @@ -84,7 +83,6 @@ public boolean isEligibleForCarPickupDropoff() { /** * Returns the list of area stops that this vertex is inside of. */ - @Nonnull public Set areaStops() { return areaStops; } @@ -92,7 +90,7 @@ public Set areaStops() { /** * Add a collection of area stops to this vertex. */ - public void addAreaStops(@Nonnull Collection toBeAdded) { + public void addAreaStops(Collection toBeAdded) { Objects.requireNonNull(toBeAdded); synchronized (this) { if (areaStops == EMPTY_SET) { diff --git a/src/main/java/org/opentripplanner/street/model/vertex/TransitBoardingAreaVertex.java b/src/main/java/org/opentripplanner/street/model/vertex/TransitBoardingAreaVertex.java index 3221934c2f6..5654185440a 100644 --- a/src/main/java/org/opentripplanner/street/model/vertex/TransitBoardingAreaVertex.java +++ b/src/main/java/org/opentripplanner/street/model/vertex/TransitBoardingAreaVertex.java @@ -1,6 +1,5 @@ package org.opentripplanner.street.model.vertex; -import javax.annotation.Nonnull; import org.opentripplanner.transit.model.basic.Accessibility; import org.opentripplanner.transit.model.site.BoardingArea; import org.opentripplanner.transit.model.site.StationElement; @@ -30,7 +29,6 @@ public boolean isWheelchairAccessible() { return wheelchairAccessible; } - @Nonnull @Override public StationElement getStationElement() { return this.boardingArea; diff --git a/src/main/java/org/opentripplanner/street/model/vertex/TransitEntranceVertex.java b/src/main/java/org/opentripplanner/street/model/vertex/TransitEntranceVertex.java index 54de400dedb..81b89ad3dfb 100644 --- a/src/main/java/org/opentripplanner/street/model/vertex/TransitEntranceVertex.java +++ b/src/main/java/org/opentripplanner/street/model/vertex/TransitEntranceVertex.java @@ -1,6 +1,5 @@ package org.opentripplanner.street.model.vertex; -import javax.annotation.Nonnull; import org.opentripplanner.transit.model.basic.Accessibility; import org.opentripplanner.transit.model.site.Entrance; import org.opentripplanner.transit.model.site.StationElement; @@ -33,7 +32,6 @@ public Entrance getEntrance() { return this.entrance; } - @Nonnull @Override public StationElement getStationElement() { return this.entrance; diff --git a/src/main/java/org/opentripplanner/street/model/vertex/TransitPathwayNodeVertex.java b/src/main/java/org/opentripplanner/street/model/vertex/TransitPathwayNodeVertex.java index b8cec0ec37c..645ec96b5ea 100644 --- a/src/main/java/org/opentripplanner/street/model/vertex/TransitPathwayNodeVertex.java +++ b/src/main/java/org/opentripplanner/street/model/vertex/TransitPathwayNodeVertex.java @@ -1,6 +1,5 @@ package org.opentripplanner.street.model.vertex; -import javax.annotation.Nonnull; import org.opentripplanner.transit.model.basic.Accessibility; import org.opentripplanner.transit.model.site.PathwayNode; import org.opentripplanner.transit.model.site.StationElement; @@ -33,7 +32,6 @@ public PathwayNode getNode() { return this.node; } - @Nonnull @Override public StationElement getStationElement() { return this.node; diff --git a/src/main/java/org/opentripplanner/street/model/vertex/TransitStopVertex.java b/src/main/java/org/opentripplanner/street/model/vertex/TransitStopVertex.java index a9d7d221d44..82c977902b0 100644 --- a/src/main/java/org/opentripplanner/street/model/vertex/TransitStopVertex.java +++ b/src/main/java/org/opentripplanner/street/model/vertex/TransitStopVertex.java @@ -2,7 +2,6 @@ import java.util.HashSet; import java.util.Set; -import javax.annotation.Nonnull; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.street.model.edge.PathwayEdge; import org.opentripplanner.transit.model.basic.Accessibility; @@ -84,7 +83,6 @@ public RegularStop getStop() { return this.stop; } - @Nonnull @Override public StationElement getStationElement() { return this.stop; diff --git a/src/main/java/org/opentripplanner/street/model/vertex/VehicleParkingEntranceVertex.java b/src/main/java/org/opentripplanner/street/model/vertex/VehicleParkingEntranceVertex.java index ba7a1540715..591f71f1869 100644 --- a/src/main/java/org/opentripplanner/street/model/vertex/VehicleParkingEntranceVertex.java +++ b/src/main/java/org/opentripplanner/street/model/vertex/VehicleParkingEntranceVertex.java @@ -2,7 +2,6 @@ import java.util.Collection; import java.util.Objects; -import javax.annotation.Nonnull; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.routing.vehicle_parking.VehicleParking; import org.opentripplanner.routing.vehicle_parking.VehicleParkingEntrance; @@ -25,7 +24,6 @@ public VehicleParkingEntranceVertex(VehicleParkingEntrance parkingEntrance) { this.parkingEntrance = parkingEntrance; } - @Nonnull @Override public I18NString getName() { return Objects.requireNonNullElse(parkingEntrance.getName(), NO_NAME); diff --git a/src/main/java/org/opentripplanner/street/model/vertex/Vertex.java b/src/main/java/org/opentripplanner/street/model/vertex/Vertex.java index f9431b2dbac..75fd5b7218e 100644 --- a/src/main/java/org/opentripplanner/street/model/vertex/Vertex.java +++ b/src/main/java/org/opentripplanner/street/model/vertex/Vertex.java @@ -8,7 +8,6 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; -import javax.annotation.Nonnull; import org.locationtech.jts.geom.Coordinate; import org.opentripplanner.astar.spi.AStarVertex; import org.opentripplanner.framework.geometry.WgsCoordinate; @@ -137,7 +136,6 @@ public final double getLat() { /** * Longer human-readable name for the client */ - @Nonnull public abstract I18NString getName(); /** diff --git a/src/main/java/org/opentripplanner/street/model/vertex/VertexFactory.java b/src/main/java/org/opentripplanner/street/model/vertex/VertexFactory.java index 9da8d0ff892..3e1a57a4581 100644 --- a/src/main/java/org/opentripplanner/street/model/vertex/VertexFactory.java +++ b/src/main/java/org/opentripplanner/street/model/vertex/VertexFactory.java @@ -1,7 +1,6 @@ package org.opentripplanner.street.model.vertex; import java.util.Set; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.locationtech.jts.geom.Coordinate; import org.opentripplanner.framework.i18n.I18NString; @@ -33,12 +32,10 @@ public VertexFactory(Graph graph) { this.graph = graph; } - @Nonnull public TransitBoardingAreaVertex transitBoardingArea(BoardingArea boardingArea) { return addToGraph(new TransitBoardingAreaVertex(boardingArea)); } - @Nonnull public ElevatorOnboardVertex elevatorOnboard( Vertex sourceVertex, String label, @@ -47,7 +44,6 @@ public ElevatorOnboardVertex elevatorOnboard( return addToGraph(new ElevatorOnboardVertex(sourceVertex, label, levelName)); } - @Nonnull public ElevatorOffboardVertex elevatorOffboard( Vertex sourceVertex, String label, @@ -56,7 +52,6 @@ public ElevatorOffboardVertex elevatorOffboard( return addToGraph(new ElevatorOffboardVertex(sourceVertex, label, levelName)); } - @Nonnull public IntersectionVertex intersection(Coordinate edgeCoordinate) { return addToGraph( new LabelledIntersectionVertex( @@ -69,12 +64,10 @@ public IntersectionVertex intersection(Coordinate edgeCoordinate) { ); } - @Nonnull public IntersectionVertex intersection(String label, double longitude, double latitude) { return addToGraph(new LabelledIntersectionVertex(label, longitude, latitude, false, false)); } - @Nonnull public OsmBoardingLocationVertex osmBoardingLocation( Coordinate coordinate, String label, @@ -84,7 +77,6 @@ public OsmBoardingLocationVertex osmBoardingLocation( return addToGraph(new OsmBoardingLocationVertex(label, coordinate.x, coordinate.y, name, refs)); } - @Nonnull public SplitterVertex splitter( StreetEdge originalEdge, double x, @@ -94,17 +86,14 @@ public SplitterVertex splitter( return addToGraph(new SplitterVertex(uniqueSplitLabel, x, y, originalEdge.getName())); } - @Nonnull public BarrierVertex barrier(long nid, Coordinate coordinate) { return addToGraph(new BarrierVertex(coordinate.x, coordinate.y, nid)); } - @Nonnull public ExitVertex exit(long nid, Coordinate coordinate, String exitName) { return addToGraph(new ExitVertex(coordinate.x, coordinate.y, nid, exitName)); } - @Nonnull public OsmVertex osm( Coordinate coordinate, OSMNode node, @@ -122,17 +111,14 @@ public OsmVertex osm( ); } - @Nonnull public TransitStopVertex transitStop(TransitStopVertexBuilder transitStopVertexBuilder) { return addToGraph(transitStopVertexBuilder.build()); } - @Nonnull public StationCentroidVertex stationCentroid(Station station) { return addToGraph(new StationCentroidVertex(station)); } - @Nonnull public VehicleParkingEntranceVertex vehicleParkingEntrance(VehicleParking vehicleParking) { return vehicleParkingEntrance(vehicleParking.getEntrances().get(0)); } @@ -141,17 +127,14 @@ public VehicleParkingEntranceVertex vehicleParkingEntrance(VehicleParkingEntranc return addToGraph(new VehicleParkingEntranceVertex(entrance)); } - @Nonnull public VehicleRentalPlaceVertex vehicleRentalPlace(VehicleRentalPlace station) { return addToGraph(new VehicleRentalPlaceVertex(station)); } - @Nonnull public TransitPathwayNodeVertex transitPathwayNode(PathwayNode node) { return addToGraph(new TransitPathwayNodeVertex(node)); } - @Nonnull public TransitEntranceVertex transitEntrance(Entrance entrance) { return addToGraph(new TransitEntranceVertex(entrance)); } diff --git a/src/main/java/org/opentripplanner/street/search/StreetSearchBuilder.java b/src/main/java/org/opentripplanner/street/search/StreetSearchBuilder.java index 079cd29706f..68a71aef0a7 100644 --- a/src/main/java/org/opentripplanner/street/search/StreetSearchBuilder.java +++ b/src/main/java/org/opentripplanner/street/search/StreetSearchBuilder.java @@ -3,7 +3,6 @@ import java.time.Duration; import java.util.Collection; import java.util.Set; -import javax.annotation.Nonnull; import org.opentripplanner.astar.AStarBuilder; import org.opentripplanner.astar.spi.DominanceFunction; import org.opentripplanner.astar.spi.RemainingWeightHeuristic; @@ -65,7 +64,6 @@ public StreetSearchBuilder setDataOverlayContext(DataOverlayContext dataOverlayC return this; } - @Nonnull @Override protected Duration streetRoutingTimeout() { return routeRequest.preferences().street().routingTimeout(); diff --git a/src/main/java/org/opentripplanner/street/search/request/StreetSearchRequest.java b/src/main/java/org/opentripplanner/street/search/request/StreetSearchRequest.java index c33ed6a35e9..c93ea598256 100644 --- a/src/main/java/org/opentripplanner/street/search/request/StreetSearchRequest.java +++ b/src/main/java/org/opentripplanner/street/search/request/StreetSearchRequest.java @@ -1,7 +1,6 @@ package org.opentripplanner.street.search.request; import java.time.Instant; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Envelope; @@ -76,12 +75,10 @@ private StreetSearchRequest() { this.toEnvelope = createEnvelope(to); } - @Nonnull public static StreetSearchRequestBuilder of() { return new StreetSearchRequestBuilder(DEFAULT).withStartTime(Instant.now()); } - @Nonnull public static StreetSearchRequestBuilder copyOf(StreetSearchRequest original) { return new StreetSearchRequestBuilder(original); } diff --git a/src/main/java/org/opentripplanner/street/search/state/State.java b/src/main/java/org/opentripplanner/street/search/state/State.java index deef516a674..6c7f342cad6 100644 --- a/src/main/java/org/opentripplanner/street/search/state/State.java +++ b/src/main/java/org/opentripplanner/street/search/state/State.java @@ -8,7 +8,6 @@ import java.util.Objects; import java.util.Set; import java.util.stream.Stream; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.astar.spi.AStarState; import org.opentripplanner.ext.dataoverlay.routing.DataOverlayContext; @@ -57,7 +56,7 @@ public class State implements AStarState, Cloneable { /** * Create an initial state, forcing vertex to the specified value. Useful for tests, etc. */ - public State(@Nonnull Vertex vertex, @Nonnull StreetSearchRequest streetSearchRequest) { + public State(Vertex vertex, StreetSearchRequest streetSearchRequest) { this( vertex, streetSearchRequest.startTime(), @@ -66,12 +65,7 @@ public State(@Nonnull Vertex vertex, @Nonnull StreetSearchRequest streetSearchRe ); } - public State( - @Nonnull Vertex vertex, - @Nonnull Instant startTime, - @Nonnull StateData stateData, - @Nonnull StreetSearchRequest request - ) { + public State(Vertex vertex, Instant startTime, StateData stateData, StreetSearchRequest request) { this.request = request; this.weight = 0; this.vertex = vertex; diff --git a/src/main/java/org/opentripplanner/street/search/state/StateEditor.java b/src/main/java/org/opentripplanner/street/search/state/StateEditor.java index 40c44a16488..271b6e78030 100644 --- a/src/main/java/org/opentripplanner/street/search/state/StateEditor.java +++ b/src/main/java/org/opentripplanner/street/search/state/StateEditor.java @@ -1,7 +1,6 @@ package org.opentripplanner.street.search.state; import java.util.Set; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.street.model.RentalFormFactor; import org.opentripplanner.street.model.edge.Edge; @@ -135,7 +134,6 @@ public State makeState() { * Calls {@link StateEditor#makeState()} and wraps the result in an array of {@link State}. * If the state is null, then a zero-length array is returned. */ - @Nonnull public State[] makeStateArray() { return State.ofNullable(makeState()); } diff --git a/src/main/java/org/opentripplanner/transit/model/basic/MainAndSubMode.java b/src/main/java/org/opentripplanner/transit/model/basic/MainAndSubMode.java index 571584700e9..030e5b5ac63 100644 --- a/src/main/java/org/opentripplanner/transit/model/basic/MainAndSubMode.java +++ b/src/main/java/org/opentripplanner/transit/model/basic/MainAndSubMode.java @@ -4,13 +4,12 @@ import java.util.List; import java.util.function.Predicate; import java.util.stream.Stream; -import javax.annotation.Nonnull; import javax.annotation.Nullable; /** * Tupple of main- and sub-mode. */ -public record MainAndSubMode(@Nonnull TransitMode mainMode, @Nullable SubMode subMode) { +public record MainAndSubMode(TransitMode mainMode, @Nullable SubMode subMode) { private static final List ALL = Stream .of(TransitMode.values()) .map(MainAndSubMode::new) diff --git a/src/main/java/org/opentripplanner/transit/model/basic/Money.java b/src/main/java/org/opentripplanner/transit/model/basic/Money.java index 35278d8fbd8..de1c6647b6b 100644 --- a/src/main/java/org/opentripplanner/transit/model/basic/Money.java +++ b/src/main/java/org/opentripplanner/transit/model/basic/Money.java @@ -8,7 +8,6 @@ import java.util.Locale; import java.util.Objects; import java.util.function.Function; -import javax.annotation.Nonnull; import org.opentripplanner.framework.lang.IntUtils; /** @@ -26,7 +25,7 @@ public class Money implements Comparable, Serializable { * @param currency The currency of the money amount * @param minorUnitAmount The amount in the smaller currency unit, so for 1.50 EUR pass 150. */ - private Money(@Nonnull Currency currency, int minorUnitAmount) { + private Money(Currency currency, int minorUnitAmount) { this.currency = Objects.requireNonNull(currency); this.amount = minorUnitAmount; } @@ -65,7 +64,7 @@ public static Money max(Money first, Money second) { * Take a fractional amount of money, ie 1.5 and convert it to amount using the number of default * fraction digits of the currency. */ - public static Money ofFractionalAmount(@Nonnull Currency currency, float fractionalAmount) { + public static Money ofFractionalAmount(Currency currency, float fractionalAmount) { Objects.requireNonNull(currency); var fractionDigits = currency.getDefaultFractionDigits(); int amount = IntUtils.round(fractionalAmount * Math.pow(10, fractionDigits)); @@ -181,7 +180,6 @@ private boolean booleanOp(Money other, boolean result) { return result; } - @Nonnull private Money op(Money other, Function op) { checkCurrencyOrThrow(other); return op.apply(other); diff --git a/src/main/java/org/opentripplanner/transit/model/basic/Notice.java b/src/main/java/org/opentripplanner/transit/model/basic/Notice.java index f9713417805..660a44c680f 100644 --- a/src/main/java/org/opentripplanner/transit/model/basic/Notice.java +++ b/src/main/java/org/opentripplanner/transit/model/basic/Notice.java @@ -1,7 +1,6 @@ package org.opentripplanner.transit.model.basic; import java.util.Objects; -import javax.annotation.Nonnull; import org.opentripplanner.transit.model.framework.AbstractTransitEntity; import org.opentripplanner.transit.model.framework.FeedScopedId; @@ -34,7 +33,7 @@ public String publicCode() { } @Override - public boolean sameAs(@Nonnull Notice other) { + public boolean sameAs(Notice other) { return ( getId().equals(other.getId()) && Objects.equals(publicCode, other.publicCode) && @@ -43,7 +42,6 @@ public boolean sameAs(@Nonnull Notice other) { } @Override - @Nonnull public NoticeBuilder copy() { return new NoticeBuilder(this); } diff --git a/src/main/java/org/opentripplanner/transit/model/framework/AbstractBuilder.java b/src/main/java/org/opentripplanner/transit/model/framework/AbstractBuilder.java index de20445a7ba..60a970a0521 100644 --- a/src/main/java/org/opentripplanner/transit/model/framework/AbstractBuilder.java +++ b/src/main/java/org/opentripplanner/transit/model/framework/AbstractBuilder.java @@ -1,6 +1,5 @@ package org.opentripplanner.transit.model.framework; -import javax.annotation.Nonnull; import javax.annotation.Nullable; public abstract class AbstractBuilder< @@ -29,7 +28,7 @@ E original() { protected abstract E buildFromValues(); @Override - public final @Nonnull E build() { + public final E build() { var b = buildFromValues(); if (original == null) { diff --git a/src/main/java/org/opentripplanner/transit/model/framework/AbstractTransitEntity.java b/src/main/java/org/opentripplanner/transit/model/framework/AbstractTransitEntity.java index 4053a4860f2..258d505b53c 100644 --- a/src/main/java/org/opentripplanner/transit/model/framework/AbstractTransitEntity.java +++ b/src/main/java/org/opentripplanner/transit/model/framework/AbstractTransitEntity.java @@ -5,7 +5,6 @@ import java.util.List; import java.util.Objects; import java.util.Set; -import javax.annotation.Nonnull; /** * All OTP Transit entities should extend this class. The purpose of the class is to enforce a @@ -30,7 +29,7 @@ public abstract class AbstractTransitEntity< private final FeedScopedId id; - public AbstractTransitEntity(@Nonnull FeedScopedId id) { + public AbstractTransitEntity(FeedScopedId id) { this.id = Objects.requireNonNull(id); } diff --git a/src/main/java/org/opentripplanner/transit/model/framework/FeedScopedId.java b/src/main/java/org/opentripplanner/transit/model/framework/FeedScopedId.java index b48ff040c28..bdb09cb0db8 100644 --- a/src/main/java/org/opentripplanner/transit/model/framework/FeedScopedId.java +++ b/src/main/java/org/opentripplanner/transit/model/framework/FeedScopedId.java @@ -5,7 +5,6 @@ import java.io.Serializable; import java.util.Arrays; import java.util.List; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.framework.lang.StringUtils; @@ -22,7 +21,7 @@ public final class FeedScopedId implements Serializable, Comparable { private Result() {} - public static Result failure(@Nonnull E failure) { + public static Result failure(E failure) { return new Failure<>(failure); } - public static Result success(@Nonnull T success) { + public static Result success(T success) { return new Success<>(success); } diff --git a/src/main/java/org/opentripplanner/transit/model/framework/TransitObject.java b/src/main/java/org/opentripplanner/transit/model/framework/TransitObject.java index ad09a40db07..60d261fee00 100644 --- a/src/main/java/org/opentripplanner/transit/model/framework/TransitObject.java +++ b/src/main/java/org/opentripplanner/transit/model/framework/TransitObject.java @@ -1,7 +1,6 @@ package org.opentripplanner.transit.model.framework; import java.io.Serializable; -import javax.annotation.Nonnull; public interface TransitObject, T extends TransitBuilder> extends Serializable { @@ -10,7 +9,7 @@ public interface TransitObject, T extends TransitB * the same value. This is used to avoid creating new objects during transit model construction * and during RealTime updates. */ - boolean sameAs(@Nonnull E other); + boolean sameAs(E other); /** * The copy method is used to mutate the existing object by creating a builder and setting @@ -25,6 +24,5 @@ public interface TransitObject, T extends TransitB *

* TODO RTM - Document design "rules" in a package readme, when the design is set. */ - @Nonnull TransitBuilder copy(); } diff --git a/src/main/java/org/opentripplanner/transit/model/network/GroupOfRoutes.java b/src/main/java/org/opentripplanner/transit/model/network/GroupOfRoutes.java index c52e7ffe3e6..66cf57788c6 100644 --- a/src/main/java/org/opentripplanner/transit/model/network/GroupOfRoutes.java +++ b/src/main/java/org/opentripplanner/transit/model/network/GroupOfRoutes.java @@ -1,7 +1,6 @@ package org.opentripplanner.transit.model.network; import java.util.Objects; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.transit.model.framework.AbstractTransitEntity; import org.opentripplanner.transit.model.framework.FeedScopedId; @@ -34,13 +33,11 @@ public static GroupOfRoutesBuilder of(FeedScopedId id) { return new GroupOfRoutesBuilder(id); } - @Nonnull public String getName() { return logName(); } @Override - @Nonnull public String logName() { return name; } @@ -66,7 +63,7 @@ public GroupOfRoutesBuilder copy() { } @Override - public boolean sameAs(@Nonnull GroupOfRoutes other) { + public boolean sameAs(GroupOfRoutes other) { return ( getId().equals(other.getId()) && Objects.equals(name, other.name) && diff --git a/src/main/java/org/opentripplanner/transit/model/network/GroupOfRoutesBuilder.java b/src/main/java/org/opentripplanner/transit/model/network/GroupOfRoutesBuilder.java index 1080209f33c..c4fb7967a55 100644 --- a/src/main/java/org/opentripplanner/transit/model/network/GroupOfRoutesBuilder.java +++ b/src/main/java/org/opentripplanner/transit/model/network/GroupOfRoutesBuilder.java @@ -1,6 +1,5 @@ package org.opentripplanner.transit.model.network; -import javax.annotation.Nonnull; import org.opentripplanner.transit.model.framework.AbstractEntityBuilder; import org.opentripplanner.transit.model.framework.FeedScopedId; @@ -21,7 +20,7 @@ public class GroupOfRoutesBuilder super(id); } - GroupOfRoutesBuilder(@Nonnull GroupOfRoutes original) { + GroupOfRoutesBuilder(GroupOfRoutes original) { super(original); this.privateCode = original.getPrivateCode(); this.shortName = original.getShortName(); diff --git a/src/main/java/org/opentripplanner/transit/model/network/Route.java b/src/main/java/org/opentripplanner/transit/model/network/Route.java index 721c6098ac8..206e65f7af9 100644 --- a/src/main/java/org/opentripplanner/transit/model/network/Route.java +++ b/src/main/java/org/opentripplanner/transit/model/network/Route.java @@ -7,7 +7,6 @@ import java.util.List; import java.util.Locale; import java.util.Objects; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.framework.lang.IntUtils; @@ -65,12 +64,12 @@ public final class Route extends AbstractTransitEntity impl this.textColor = builder.getTextColor(); } - public static RouteBuilder of(@Nonnull FeedScopedId id) { + public static RouteBuilder of(FeedScopedId id) { return new RouteBuilder(id); } @Override - public boolean sameAs(@Nonnull Route other) { + public boolean sameAs(Route other) { return ( getId().equals(other.getId()) && Objects.equals(this.agency, other.agency) && @@ -101,7 +100,6 @@ public RouteBuilder copy() { * The 'agency' property represent a GTFS Agency and NeTEx the Authority. Note that Agency does * NOT map 1-1 to Authority, it is rather a mix between Authority and Operator. */ - @Nonnull public Agency getAgency() { return agency; } @@ -119,7 +117,6 @@ public Branding getBranding() { return branding; } - @Nonnull public List getGroupsOfRoutes() { return groupsOfRoutes; } @@ -134,7 +131,6 @@ public I18NString getLongName() { return longName; } - @Nonnull public TransitMode getMode() { return mode; } @@ -160,7 +156,6 @@ public Integer getGtfsSortOrder() { return gtfsSortOrder; } - @Nonnull public SubMode getNetexSubmode() { return netexSubmode; } @@ -180,7 +175,6 @@ public String getTextColor() { return textColor; } - @Nonnull public BikeAccess getBikesAllowed() { return bikesAllowed; } @@ -194,13 +188,11 @@ public String getFlexibleLineType() { } /** @return the route's short name, or the long name if the short name is null. */ - @Nonnull public String getName(Locale locale) { return shortName == null ? longName.toString(locale) : shortName; } /** @return the route's short name, or the long name if the short name is null. */ - @Nonnull public String getName() { return shortName == null ? longName.toString() : shortName; } diff --git a/src/main/java/org/opentripplanner/transit/model/network/StopPattern.java b/src/main/java/org/opentripplanner/transit/model/network/StopPattern.java index 3fc51cea0c6..7395d28419f 100644 --- a/src/main/java/org/opentripplanner/transit/model/network/StopPattern.java +++ b/src/main/java/org/opentripplanner/transit/model/network/StopPattern.java @@ -8,7 +8,6 @@ import java.util.Objects; import java.util.Optional; import java.util.function.Predicate; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.framework.lang.MemEfficientArrayBuilder; import org.opentripplanner.model.PickDrop; @@ -272,7 +271,7 @@ private int findStopPosition( * @param index Given index for stop * @return true if stop and next stop are equal on both stop patterns, else false */ - boolean sameStops(@Nonnull StopPattern other, int index) { + boolean sameStops(StopPattern other, int index) { var otherOrigin = other.getStop(index); var otherDestination = other.getStop(index + 1); var origin = getStop(index); @@ -289,7 +288,7 @@ boolean sameStops(@Nonnull StopPattern other, int index) { * @return true if the stops have the same stations, else false. If any station is null then * false. */ - boolean sameStations(@Nonnull StopPattern other, int index) { + boolean sameStations(StopPattern other, int index) { var otherOrigin = other.getStop(index).getParentStation(); var otherDestination = other.getStop(index + 1).getParentStation(); var origin = getStop(index).getParentStation(); diff --git a/src/main/java/org/opentripplanner/transit/model/network/TripPattern.java b/src/main/java/org/opentripplanner/transit/model/network/TripPattern.java index e7d7af45b6d..becf1686733 100644 --- a/src/main/java/org/opentripplanner/transit/model/network/TripPattern.java +++ b/src/main/java/org/opentripplanner/transit/model/network/TripPattern.java @@ -9,7 +9,6 @@ import java.util.Objects; import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.annotation.Nonnull; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.LineString; import org.opentripplanner.framework.geometry.CompactLineStringUtils; @@ -147,7 +146,7 @@ public final class TripPattern this.routingTripPattern = new RoutingTripPattern(this, builder); } - public static TripPatternBuilder of(@Nonnull FeedScopedId id) { + public static TripPatternBuilder of(FeedScopedId id) { return new TripPatternBuilder(id); } @@ -461,7 +460,7 @@ private static Coordinate coordinate(StopLocation s) { } @Override - public boolean sameAs(@Nonnull TripPattern other) { + public boolean sameAs(TripPattern other) { return ( getId().equals(other.getId()) && Objects.equals(this.route, other.route) && diff --git a/src/main/java/org/opentripplanner/transit/model/organization/Agency.java b/src/main/java/org/opentripplanner/transit/model/organization/Agency.java index d72aa6588f3..4d82ab05e57 100644 --- a/src/main/java/org/opentripplanner/transit/model/organization/Agency.java +++ b/src/main/java/org/opentripplanner/transit/model/organization/Agency.java @@ -5,7 +5,6 @@ import java.time.ZoneId; import java.util.Objects; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.transit.model.framework.AbstractTransitEntity; import org.opentripplanner.transit.model.framework.FeedScopedId; @@ -47,16 +46,14 @@ public final class Agency extends AbstractTransitEntity i this.brandingUrl = builder.getBrandingUrl(); } - public static AgencyBuilder of(@Nonnull FeedScopedId id) { + public static AgencyBuilder of(FeedScopedId id) { return new AgencyBuilder(id); } - @Nonnull public String getName() { return logName(); } - @Nonnull public ZoneId getTimezone() { return timezone; } @@ -87,19 +84,17 @@ public String getBrandingUrl() { } @Override - @Nonnull public AgencyBuilder copy() { return new AgencyBuilder(this); } @Override - @Nonnull public String logName() { return name; } @Override - public boolean sameAs(@Nonnull Agency other) { + public boolean sameAs(Agency other) { return ( getId().equals(other.getId()) && Objects.equals(name, other.name) && diff --git a/src/main/java/org/opentripplanner/transit/model/organization/AgencyBuilder.java b/src/main/java/org/opentripplanner/transit/model/organization/AgencyBuilder.java index 8411797f888..3cf24523c5d 100644 --- a/src/main/java/org/opentripplanner/transit/model/organization/AgencyBuilder.java +++ b/src/main/java/org/opentripplanner/transit/model/organization/AgencyBuilder.java @@ -1,6 +1,5 @@ package org.opentripplanner.transit.model.organization; -import javax.annotation.Nonnull; import org.opentripplanner.transit.model.framework.AbstractEntityBuilder; import org.opentripplanner.transit.model.framework.FeedScopedId; @@ -18,7 +17,7 @@ public class AgencyBuilder extends AbstractEntityBuilder super(id); } - AgencyBuilder(@Nonnull Agency original) { + AgencyBuilder(Agency original) { super(original); this.name = original.getName(); this.timezone = original.getTimezone().getId(); diff --git a/src/main/java/org/opentripplanner/transit/model/organization/Branding.java b/src/main/java/org/opentripplanner/transit/model/organization/Branding.java index b0599d31341..502c4a27cc7 100644 --- a/src/main/java/org/opentripplanner/transit/model/organization/Branding.java +++ b/src/main/java/org/opentripplanner/transit/model/organization/Branding.java @@ -1,7 +1,6 @@ package org.opentripplanner.transit.model.organization; import java.util.Objects; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.transit.model.framework.AbstractTransitEntity; import org.opentripplanner.transit.model.framework.FeedScopedId; @@ -30,7 +29,7 @@ public class Branding extends AbstractTransitEntity i this.image = builder.getImage(); } - public static BrandingBuilder of(@Nonnull FeedScopedId id) { + public static BrandingBuilder of(FeedScopedId id) { return new BrandingBuilder(id); } @@ -66,13 +65,12 @@ public String getDescription() { } @Override - @Nonnull public BrandingBuilder copy() { return new BrandingBuilder(this); } @Override - public boolean sameAs(@Nonnull Branding other) { + public boolean sameAs(Branding other) { return ( getId().equals(other.getId()) && Objects.equals(name, other.name) && diff --git a/src/main/java/org/opentripplanner/transit/model/organization/BrandingBuilder.java b/src/main/java/org/opentripplanner/transit/model/organization/BrandingBuilder.java index 1367d683058..77f35d86fa1 100644 --- a/src/main/java/org/opentripplanner/transit/model/organization/BrandingBuilder.java +++ b/src/main/java/org/opentripplanner/transit/model/organization/BrandingBuilder.java @@ -1,6 +1,5 @@ package org.opentripplanner.transit.model.organization; -import javax.annotation.Nonnull; import org.opentripplanner.transit.model.framework.AbstractEntityBuilder; import org.opentripplanner.transit.model.framework.FeedScopedId; @@ -16,7 +15,7 @@ public class BrandingBuilder extends AbstractEntityBuilder i this.phone = builder.getPhone(); } - public static OperatorBuilder of(@Nonnull FeedScopedId id) { + public static OperatorBuilder of(FeedScopedId id) { return new OperatorBuilder(id); } - @Nonnull public String getName() { return logName(); } @Override - @Nonnull public String logName() { return name; } @@ -60,13 +57,12 @@ public String getPhone() { } @Override - @Nonnull public OperatorBuilder copy() { return new OperatorBuilder(this); } @Override - public boolean sameAs(@Nonnull Operator other) { + public boolean sameAs(Operator other) { return ( getId().equals(other.getId()) && Objects.equals(name, other.name) && diff --git a/src/main/java/org/opentripplanner/transit/model/site/AreaStop.java b/src/main/java/org/opentripplanner/transit/model/site/AreaStop.java index 35576e0c42f..03844c80b77 100644 --- a/src/main/java/org/opentripplanner/transit/model/site/AreaStop.java +++ b/src/main/java/org/opentripplanner/transit/model/site/AreaStop.java @@ -3,7 +3,6 @@ import java.util.Objects; import java.util.Optional; import java.util.function.IntSupplier; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.locationtech.jts.geom.Geometry; import org.opentripplanner.framework.geometry.WgsCoordinate; @@ -69,7 +68,6 @@ public int getIndex() { * communication, eg. the name of the village where the service stops. */ @Override - @Nonnull public I18NString getName() { return name; } @@ -85,7 +83,6 @@ public I18NString getUrl() { return url; } - @Nonnull @Override public StopType getStopType() { return StopType.FLEXIBLE_AREA; @@ -97,7 +94,6 @@ public String getFirstZoneAsString() { } @Override - @Nonnull public WgsCoordinate getCoordinate() { return centroid; } @@ -137,7 +133,7 @@ public boolean hasFallbackName() { } @Override - public boolean sameAs(@Nonnull AreaStop other) { + public boolean sameAs(AreaStop other) { return ( getId().equals(other.getId()) && Objects.equals(name, other.getName()) && @@ -149,7 +145,6 @@ public boolean sameAs(@Nonnull AreaStop other) { } @Override - @Nonnull public AreaStopBuilder copy() { return new AreaStopBuilder(this); } diff --git a/src/main/java/org/opentripplanner/transit/model/site/AreaStopBuilder.java b/src/main/java/org/opentripplanner/transit/model/site/AreaStopBuilder.java index 8e29ad4acbf..51bbc06f427 100644 --- a/src/main/java/org/opentripplanner/transit/model/site/AreaStopBuilder.java +++ b/src/main/java/org/opentripplanner/transit/model/site/AreaStopBuilder.java @@ -2,7 +2,6 @@ import java.util.Objects; import java.util.function.IntSupplier; -import javax.annotation.Nonnull; import org.locationtech.jts.geom.Geometry; import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.I18NString; @@ -26,7 +25,7 @@ public class AreaStopBuilder extends AbstractEntityBuilder getChildStops() { return this.childStations.stream().flatMap(s -> s.getChildStops().stream()).toList(); } - @Nonnull public Collection getChildStations() { return this.childStations; } @@ -70,7 +66,7 @@ public GroupOfStationsPurpose getPurposeOfGrouping() { } @Override - public boolean sameAs(@Nonnull GroupOfStations other) { + public boolean sameAs(GroupOfStations other) { return ( getId().equals(other.getId()) && Objects.equals(name, other.getName()) && @@ -80,7 +76,6 @@ public boolean sameAs(@Nonnull GroupOfStations other) { ); } - @Nonnull @Override public GroupOfStationsBuilder copy() { return new GroupOfStationsBuilder(this); diff --git a/src/main/java/org/opentripplanner/transit/model/site/GroupOfStationsBuilder.java b/src/main/java/org/opentripplanner/transit/model/site/GroupOfStationsBuilder.java index 72da8921446..a9e87c4c022 100644 --- a/src/main/java/org/opentripplanner/transit/model/site/GroupOfStationsBuilder.java +++ b/src/main/java/org/opentripplanner/transit/model/site/GroupOfStationsBuilder.java @@ -2,7 +2,6 @@ import java.util.HashSet; import java.util.Set; -import javax.annotation.Nonnull; import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.transit.model.framework.AbstractEntityBuilder; @@ -20,7 +19,7 @@ public class GroupOfStationsBuilder super(id); } - GroupOfStationsBuilder(@Nonnull GroupOfStations original) { + GroupOfStationsBuilder(GroupOfStations original) { super(original); // Required fields this.name = I18NString.assertHasValue(original.getName()); diff --git a/src/main/java/org/opentripplanner/transit/model/site/GroupStop.java b/src/main/java/org/opentripplanner/transit/model/site/GroupStop.java index c674d588238..40618e60ace 100644 --- a/src/main/java/org/opentripplanner/transit/model/site/GroupStop.java +++ b/src/main/java/org/opentripplanner/transit/model/site/GroupStop.java @@ -4,7 +4,6 @@ import java.util.Objects; import java.util.Optional; import java.util.function.IntSupplier; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.GeometryCollection; @@ -65,7 +64,6 @@ public I18NString getUrl() { } @Override - @Nonnull public StopType getStopType() { return StopType.FLEXIBLE_GROUP; } @@ -79,7 +77,6 @@ public String getFirstZoneAsString() { * Returns the centroid of all stops and areas belonging to this location group. */ @Override - @Nonnull public WgsCoordinate getCoordinate() { return centroid; } @@ -116,13 +113,12 @@ public boolean isPartOfSameStationAs(StopLocation alternativeStop) { * Returns all the locations belonging to this location group. */ @Override - @Nonnull public List getChildLocations() { return stopLocations; } @Override - public boolean sameAs(@Nonnull GroupStop other) { + public boolean sameAs(GroupStop other) { return ( getId().equals(other.getId()) && Objects.equals(name, other.getName()) && @@ -131,7 +127,6 @@ public boolean sameAs(@Nonnull GroupStop other) { } @Override - @Nonnull public GroupStopBuilder copy() { return new GroupStopBuilder(this); } diff --git a/src/main/java/org/opentripplanner/transit/model/site/GroupStopBuilder.java b/src/main/java/org/opentripplanner/transit/model/site/GroupStopBuilder.java index 64cad9325d1..c51b704aa33 100644 --- a/src/main/java/org/opentripplanner/transit/model/site/GroupStopBuilder.java +++ b/src/main/java/org/opentripplanner/transit/model/site/GroupStopBuilder.java @@ -3,7 +3,6 @@ import java.util.ArrayList; import java.util.List; import java.util.function.IntSupplier; -import javax.annotation.Nonnull; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.GeometryCollection; import org.opentripplanner.framework.geometry.GeometryUtils; @@ -34,7 +33,7 @@ public class GroupStopBuilder extends AbstractEntityBuilder getFareZones() { return fareZones; } - @Nonnull public Collection getBoardingAreas() { return boardingAreas; } @Override - @Nonnull public RegularStopBuilder copy() { return new RegularStopBuilder(this); } @Override - public boolean sameAs(@Nonnull RegularStop other) { + public boolean sameAs(RegularStop other) { return ( super.sameAs(other) && Objects.equals(platformCode, other.platformCode) && diff --git a/src/main/java/org/opentripplanner/transit/model/site/Station.java b/src/main/java/org/opentripplanner/transit/model/site/Station.java index 6ce7e874fb5..c8d2558a5cd 100644 --- a/src/main/java/org/opentripplanner/transit/model/site/Station.java +++ b/src/main/java/org/opentripplanner/transit/model/site/Station.java @@ -9,7 +9,6 @@ import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.locationtech.jts.algorithm.ConvexHull; import org.locationtech.jts.geom.Geometry; @@ -79,12 +78,10 @@ public boolean includes(StopLocation stop) { return childStops.contains(stop); } - @Nonnull public I18NString getName() { return name; } - @Nonnull public Collection getChildStops() { return childStops; } @@ -99,7 +96,6 @@ public double getLon() { return coordinate.longitude(); } - @Nonnull public WgsCoordinate getCoordinate() { return coordinate; } @@ -142,7 +138,6 @@ public I18NString getUrl() { * that the {@link StopTransferPriority#ALLOWED} (which is default) should a nett-effect of adding * 0 - zero cost. */ - @Nonnull public StopTransferPriority getPriority() { return priority; } @@ -163,7 +158,6 @@ public boolean isTransfersNotAllowed() { * A geometry collection that contains the center point and the convex hull of all the child * stops. */ - @Nonnull public GeometryCollection getGeometry() { return geometry; } @@ -175,13 +169,12 @@ public String logName() { } @Override - @Nonnull public StationBuilder copy() { return new StationBuilder(this); } @Override - public boolean sameAs(@Nonnull Station other) { + public boolean sameAs(Station other) { return ( getId().equals(other.getId()) && Objects.equals(name, other.name) && diff --git a/src/main/java/org/opentripplanner/transit/model/site/StationElement.java b/src/main/java/org/opentripplanner/transit/model/site/StationElement.java index e0c6241ac1b..f1bef4d6c34 100644 --- a/src/main/java/org/opentripplanner/transit/model/site/StationElement.java +++ b/src/main/java/org/opentripplanner/transit/model/site/StationElement.java @@ -1,7 +1,6 @@ package org.opentripplanner.transit.model.site; import java.util.Objects; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.I18NString; @@ -50,7 +49,6 @@ public abstract class StationElement< /** * Name of the station element if provided. */ - @Nonnull public I18NString getName() { return name; } @@ -85,7 +83,6 @@ boolean isCoordinateSet() { * Center point/location for the station element. Returns the coordinate of the parent station, if * the coordinate is not defined for this station element. */ - @Nonnull public WgsCoordinate getCoordinate() { if (coordinate != null) { return coordinate; @@ -99,7 +96,6 @@ public WgsCoordinate getCoordinate() { /** * Returns whether this station element is accessible for wheelchair users. */ - @Nonnull public Accessibility getWheelchairAccessibility() { return wheelchairAccessibility; } @@ -145,7 +141,7 @@ public boolean isPartOfSameStationAs(StopLocation other) { } @Override - public boolean sameAs(@Nonnull E other) { + public boolean sameAs(E other) { return ( getId().equals(other.getId()) && Objects.equals(name, other.getName()) && diff --git a/src/main/java/org/opentripplanner/transit/model/site/StopLocation.java b/src/main/java/org/opentripplanner/transit/model/site/StopLocation.java index 9cb4411437c..d9c79732970 100644 --- a/src/main/java/org/opentripplanner/transit/model/site/StopLocation.java +++ b/src/main/java/org/opentripplanner/transit/model/site/StopLocation.java @@ -4,7 +4,6 @@ import java.util.Collection; import java.util.List; import java.util.Optional; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.locationtech.jts.geom.Geometry; import org.opentripplanner.framework.geometry.WgsCoordinate; @@ -44,7 +43,6 @@ public interface StopLocation extends LogInfo { @Nullable I18NString getUrl(); - @Nonnull StopType getStopType(); /** @@ -68,7 +66,6 @@ default TransitMode getGtfsVehicleType() { return null; } - @Nonnull default SubMode getNetexVehicleSubmode() { return SubMode.UNKNOWN; } @@ -86,12 +83,10 @@ default Station getParentStation() { return null; } - @Nonnull default Collection getFareZones() { return List.of(); } - @Nonnull default Accessibility getWheelchairAccessibility() { return Accessibility.NO_INFORMATION; } @@ -112,7 +107,6 @@ default String getFirstZoneAsString() { * Representative location for the StopLocation. Can either be the actual location of the stop, or * the centroid of an area or line. */ - @Nonnull WgsCoordinate getCoordinate(); /** @@ -140,7 +134,6 @@ default ZoneId getTimeZone() { boolean isPartOfStation(); - @Nonnull default StopTransferPriority getPriority() { return StopTransferPriority.defaultValue(); } diff --git a/src/main/java/org/opentripplanner/transit/model/timetable/StopTimeKey.java b/src/main/java/org/opentripplanner/transit/model/timetable/StopTimeKey.java index d110778a267..d3267804f70 100644 --- a/src/main/java/org/opentripplanner/transit/model/timetable/StopTimeKey.java +++ b/src/main/java/org/opentripplanner/transit/model/timetable/StopTimeKey.java @@ -1,6 +1,5 @@ package org.opentripplanner.transit.model.timetable; -import javax.annotation.Nonnull; import org.opentripplanner.transit.model.framework.AbstractTransitEntity; import org.opentripplanner.transit.model.framework.FeedScopedId; @@ -16,18 +15,17 @@ public class StopTimeKey extends AbstractTransitEntity impleme this.netexInternalPlanningCode = builder.getNetexInternalPlanningCode(); } - public static TripBuilder of(@Nonnull FeedScopedId id) { + public static TripBuilder of(FeedScopedId id) { return new TripBuilder(id); } @@ -93,7 +92,6 @@ public Operator getOperator() { return operator; } - @Nonnull public Route getRoute() { return route; } @@ -117,12 +115,10 @@ public String getShortName() { return shortName; } - @Nonnull public TransitMode getMode() { return mode; } - @Nonnull public SubMode getNetexSubMode() { return netexSubmode; } @@ -140,17 +136,14 @@ public FeedScopedId getShapeId() { /** * The direction for this Trip (and all other Trips in this TripPattern). */ - @Nonnull public Direction getDirection() { return direction; } - @Nonnull public BikeAccess getBikesAllowed() { return bikesAllowed; } - @Nonnull public Accessibility getWheelchairBoarding() { return wheelchairBoarding; } @@ -175,7 +168,6 @@ public String getNetexInternalPlanningCode() { *

* This is planned, by default (e.g. GTFS and if not set explicit). */ - @Nonnull public TripAlteration getNetexAlteration() { return netexAlteration; } @@ -198,7 +190,7 @@ public String logName() { } @Override - public boolean sameAs(@Nonnull Trip other) { + public boolean sameAs(Trip other) { return ( getId().equals(other.getId()) && Objects.equals(this.operator, other.operator) && diff --git a/src/main/java/org/opentripplanner/transit/model/timetable/TripOnServiceDate.java b/src/main/java/org/opentripplanner/transit/model/timetable/TripOnServiceDate.java index 1b4ecc964cf..ee520f9e0f0 100644 --- a/src/main/java/org/opentripplanner/transit/model/timetable/TripOnServiceDate.java +++ b/src/main/java/org/opentripplanner/transit/model/timetable/TripOnServiceDate.java @@ -3,7 +3,6 @@ import java.time.LocalDate; import java.util.List; import java.util.Objects; -import javax.annotation.Nonnull; import org.opentripplanner.transit.model.framework.AbstractTransitEntity; import org.opentripplanner.transit.model.framework.FeedScopedId; @@ -26,7 +25,7 @@ public class TripOnServiceDate this.replacementFor = builder.getReplacementFor(); } - public static TripOnServiceDateBuilder of(@Nonnull FeedScopedId id) { + public static TripOnServiceDateBuilder of(FeedScopedId id) { return new TripOnServiceDateBuilder(id); } @@ -51,7 +50,7 @@ public TripIdAndServiceDate getTripIdAndServiceDate() { } @Override - public boolean sameAs(@Nonnull TripOnServiceDate other) { + public boolean sameAs(TripOnServiceDate other) { return ( getId().equals(other.getId()) && Objects.equals(this.trip, other.trip) && @@ -61,7 +60,6 @@ public boolean sameAs(@Nonnull TripOnServiceDate other) { ); } - @Nonnull @Override public TripOnServiceDateBuilder copy() { return new TripOnServiceDateBuilder(this); diff --git a/src/main/java/org/opentripplanner/transit/service/TransitModel.java b/src/main/java/org/opentripplanner/transit/service/TransitModel.java index 84c7597d562..87380b66b1b 100644 --- a/src/main/java/org/opentripplanner/transit/service/TransitModel.java +++ b/src/main/java/org/opentripplanner/transit/service/TransitModel.java @@ -19,7 +19,6 @@ import java.util.Objects; import java.util.Optional; import java.util.Set; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.ext.flex.trip.FlexTrip; import org.opentripplanner.framework.lang.ObjectUtils; @@ -261,7 +260,7 @@ public void updateCalendarServiceData( * service period {@code null} is returned. */ @Nullable - public FeedScopedId getOrCreateServiceIdForDate(@Nonnull LocalDate serviceDate) { + public FeedScopedId getOrCreateServiceIdForDate(LocalDate serviceDate) { // Start of day ZonedDateTime time = ServiceDateUtils.asStartOfService(serviceDate, getTimeZone()); diff --git a/src/main/java/org/opentripplanner/updater/trip/TimetableSnapshotSource.java b/src/main/java/org/opentripplanner/updater/trip/TimetableSnapshotSource.java index 03ce9052331..b8ff20f9c02 100644 --- a/src/main/java/org/opentripplanner/updater/trip/TimetableSnapshotSource.java +++ b/src/main/java/org/opentripplanner/updater/trip/TimetableSnapshotSource.java @@ -35,7 +35,6 @@ import java.util.Objects; import java.util.Set; import java.util.function.Supplier; -import javax.annotation.Nonnull; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.framework.i18n.NonLocalizedString; import org.opentripplanner.framework.lang.StringUtils; @@ -513,7 +512,6 @@ private Result validateAndHandleAddedTrip( /** * Remove any stop that is not know in the static transit data. */ - @Nonnull private List removeUnknownStops(TripUpdate tripUpdate, FeedScopedId tripId) { return tripUpdate .getStopTimeUpdateList() diff --git a/src/main/java/org/opentripplanner/updater/trip/TripPatternCache.java b/src/main/java/org/opentripplanner/updater/trip/TripPatternCache.java index bf8e75418ae..f94d023c560 100644 --- a/src/main/java/org/opentripplanner/updater/trip/TripPatternCache.java +++ b/src/main/java/org/opentripplanner/updater/trip/TripPatternCache.java @@ -2,7 +2,6 @@ import java.util.HashMap; import java.util.Map; -import javax.annotation.Nonnull; import org.opentripplanner.gtfs.GenerateTripPatternsOperation; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.network.Route; @@ -47,8 +46,8 @@ public class TripPatternCache { * @return cached or newly created trip pattern */ public synchronized TripPattern getOrCreateTripPattern( - @Nonnull final StopPattern stopPattern, - @Nonnull final Trip trip, + final StopPattern stopPattern, + final Trip trip, final TripPattern originalTripPattern ) { Route route = trip.getRoute(); diff --git a/src/main/java/org/opentripplanner/updater/vehicle_position/RealtimeVehiclePatternMatcher.java b/src/main/java/org/opentripplanner/updater/vehicle_position/RealtimeVehiclePatternMatcher.java index fe29ef35b97..0723adc91b8 100644 --- a/src/main/java/org/opentripplanner/updater/vehicle_position/RealtimeVehiclePatternMatcher.java +++ b/src/main/java/org/opentripplanner/updater/vehicle_position/RealtimeVehiclePatternMatcher.java @@ -29,7 +29,6 @@ import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.annotation.Nonnull; import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.lang.StringUtils; import org.opentripplanner.framework.time.ServiceDateUtils; @@ -206,8 +205,8 @@ protected static LocalDate inferServiceDate( private RealtimeVehicle mapRealtimeVehicle( VehiclePosition vehiclePosition, List stopsOnVehicleTrip, - @Nonnull Trip trip, - @Nonnull Function stopIndexOfGtfsSequence + Trip trip, + Function stopIndexOfGtfsSequence ) { var newVehicle = RealtimeVehicle.builder(); diff --git a/src/main/java/org/opentripplanner/updater/vehicle_rental/GeofencingVertexUpdater.java b/src/main/java/org/opentripplanner/updater/vehicle_rental/GeofencingVertexUpdater.java index a024bac9629..60eaae3a8ed 100644 --- a/src/main/java/org/opentripplanner/updater/vehicle_rental/GeofencingVertexUpdater.java +++ b/src/main/java/org/opentripplanner/updater/vehicle_rental/GeofencingVertexUpdater.java @@ -7,7 +7,6 @@ import java.util.Set; import java.util.function.Function; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import org.locationtech.jts.geom.Envelope; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.LineString; @@ -142,7 +141,6 @@ private Map applyExtension( * When finding the edges near the business area border in Oslo this speeds up the computation * from ~25 seconds to ~3 seconds (on 2021 hardware). */ - @Nonnull private Set getEdgesAlongLineStrings(Collection lineStrings) { return lineStrings .stream() diff --git a/src/main/java/org/opentripplanner/updater/vehicle_rental/datasources/GbfsFreeVehicleStatusMapper.java b/src/main/java/org/opentripplanner/updater/vehicle_rental/datasources/GbfsFreeVehicleStatusMapper.java index 7fd884b7ab8..959521e017e 100644 --- a/src/main/java/org/opentripplanner/updater/vehicle_rental/datasources/GbfsFreeVehicleStatusMapper.java +++ b/src/main/java/org/opentripplanner/updater/vehicle_rental/datasources/GbfsFreeVehicleStatusMapper.java @@ -5,7 +5,6 @@ import java.time.Instant; import java.util.HashMap; import java.util.Map; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.mobilitydata.gbfs.v2_3.free_bike_status.GBFSBike; import org.mobilitydata.gbfs.v2_3.free_bike_status.GBFSRentalUris; @@ -20,7 +19,6 @@ public class GbfsFreeVehicleStatusMapper { private final VehicleRentalSystem system; - @Nonnull private final Map vehicleTypes; public GbfsFreeVehicleStatusMapper( diff --git a/src/main/java/org/opentripplanner/updater/vehicle_rental/datasources/params/GbfsVehicleRentalDataSourceParameters.java b/src/main/java/org/opentripplanner/updater/vehicle_rental/datasources/params/GbfsVehicleRentalDataSourceParameters.java index 99a5b48772c..7d7a6c75a5d 100644 --- a/src/main/java/org/opentripplanner/updater/vehicle_rental/datasources/params/GbfsVehicleRentalDataSourceParameters.java +++ b/src/main/java/org/opentripplanner/updater/vehicle_rental/datasources/params/GbfsVehicleRentalDataSourceParameters.java @@ -1,6 +1,5 @@ package org.opentripplanner.updater.vehicle_rental.datasources.params; -import javax.annotation.Nonnull; import org.opentripplanner.updater.spi.HttpHeaders; import org.opentripplanner.updater.vehicle_rental.VehicleRentalSourceType; @@ -14,7 +13,6 @@ public record GbfsVehicleRentalDataSourceParameters( boolean overloadingAllowed ) implements VehicleRentalDataSourceParameters { - @Nonnull @Override public VehicleRentalSourceType sourceType() { return VehicleRentalSourceType.GBFS; diff --git a/src/main/java/org/opentripplanner/updater/vehicle_rental/datasources/params/VehicleRentalDataSourceParameters.java b/src/main/java/org/opentripplanner/updater/vehicle_rental/datasources/params/VehicleRentalDataSourceParameters.java index abf7aa805cd..cdff994ab18 100644 --- a/src/main/java/org/opentripplanner/updater/vehicle_rental/datasources/params/VehicleRentalDataSourceParameters.java +++ b/src/main/java/org/opentripplanner/updater/vehicle_rental/datasources/params/VehicleRentalDataSourceParameters.java @@ -1,20 +1,16 @@ package org.opentripplanner.updater.vehicle_rental.datasources.params; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.updater.spi.HttpHeaders; import org.opentripplanner.updater.vehicle_rental.VehicleRentalSourceType; public interface VehicleRentalDataSourceParameters { - @Nonnull String url(); @Nullable String network(); - @Nonnull VehicleRentalSourceType sourceType(); - @Nonnull HttpHeaders httpHeaders(); } diff --git a/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java b/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java index 7cd9a0910b1..416ca6c364e 100644 --- a/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java +++ b/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java @@ -30,7 +30,6 @@ import java.util.Locale; import java.util.Set; import java.util.stream.Stream; -import javax.annotation.Nonnull; import org.glassfish.jersey.message.internal.OutboundJaxrsResponse; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.params.ParameterizedTest; @@ -385,7 +384,6 @@ void graphQL(Path path) throws IOException { assertEqualJson(expectedJson, actualJson); } - @Nonnull private static List getTransitAlert(EntitySelector.Stop entitySelector) { var alertWithoutDescription = TransitAlert .of(id("no-description")) @@ -406,7 +404,6 @@ private static List getTransitAlert(EntitySelector.Stop entitySele .toList(); } - @Nonnull private static WalkStepBuilder walkStep(String name) { return WalkStep .builder() @@ -415,7 +412,6 @@ private static WalkStepBuilder walkStep(String name) { .withAngle(10); } - @Nonnull private static FareProduct fareProduct(String name) { return new FareProduct( id(name), @@ -431,7 +427,6 @@ private static FareProduct fareProduct(String name) { * Locate 'expectations' relative to the given query input file. The 'expectations' and 'queries' * subdirectories are expected to be in the same directory. */ - @Nonnull private static Path getExpectation(Path path) { return path .getParent() diff --git a/src/test/java/org/opentripplanner/generate/doc/GraphQLTutorialDocTest.java b/src/test/java/org/opentripplanner/generate/doc/GraphQLTutorialDocTest.java index dc70e481653..3353d901f98 100644 --- a/src/test/java/org/opentripplanner/generate/doc/GraphQLTutorialDocTest.java +++ b/src/test/java/org/opentripplanner/generate/doc/GraphQLTutorialDocTest.java @@ -12,7 +12,6 @@ import java.io.File; import java.io.IOException; import java.nio.charset.StandardCharsets; -import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.opentripplanner.generate.doc.framework.GeneratesDocumentation; import org.opentripplanner.generate.doc.framework.TemplateUtil; @@ -47,7 +46,6 @@ public void updateTutorialDoc() throws IOException { assertFileEquals(original, OUT_FILE); } - @Nonnull private static String getGraphQlQuery(String resourceName) throws IOException { var url = Resources.getResource("org/opentripplanner/apis/gtfs/queries/" + resourceName); var query = TemplateUtil.graphQlExample(Resources.toString(url, StandardCharsets.UTF_8)); diff --git a/src/test/java/org/opentripplanner/graph_builder/module/GtfsFeedIdTest.java b/src/test/java/org/opentripplanner/graph_builder/module/GtfsFeedIdTest.java index 133ec71070a..f1d6f2e8e77 100644 --- a/src/test/java/org/opentripplanner/graph_builder/module/GtfsFeedIdTest.java +++ b/src/test/java/org/opentripplanner/graph_builder/module/GtfsFeedIdTest.java @@ -5,7 +5,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.stream.Stream; -import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -36,7 +35,6 @@ void keepUnderscore() { assertEquals("feed_id_", feedId("feed_id_")); } - @Nonnull private static String feedId(String input) { var id = new GtfsFeedId.Builder().id(input).build().getId(); assertNotNull(id); diff --git a/src/test/java/org/opentripplanner/graph_builder/module/geometry/CalculateWorldEnvelopeModuleTest.java b/src/test/java/org/opentripplanner/graph_builder/module/geometry/CalculateWorldEnvelopeModuleTest.java index fb7ae2b8a10..9157f8433b8 100644 --- a/src/test/java/org/opentripplanner/graph_builder/module/geometry/CalculateWorldEnvelopeModuleTest.java +++ b/src/test/java/org/opentripplanner/graph_builder/module/geometry/CalculateWorldEnvelopeModuleTest.java @@ -3,7 +3,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.List; -import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.street.model.vertex.Vertex; @@ -63,7 +62,6 @@ public VertexLabel getLabel() { return VertexLabel.string("%s/%s".formatted(getX(), getY())); } - @Nonnull @Override public I18NString getName() { return I18NString.of(getLabel().toString()); diff --git a/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java b/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java index 091652a2dbf..043dba98ba0 100644 --- a/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java +++ b/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java @@ -15,7 +15,6 @@ import java.util.Locale; import java.util.Set; import java.util.stream.Stream; -import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.opentripplanner.astar.model.GraphPath; import org.opentripplanner.framework.i18n.LocalizedString; @@ -323,7 +322,6 @@ void testBarrierAtEnd() { assertEquals(barrier.getBarrierPermissions(), ALL); } - @Nonnull private Graph buildParkingLots() { var graph = new Graph(); var providers = Stream diff --git a/src/test/java/org/opentripplanner/gtfs/mapping/FareTransferRuleMapperTest.java b/src/test/java/org/opentripplanner/gtfs/mapping/FareTransferRuleMapperTest.java index dc924f6f0aa..eda714257cd 100644 --- a/src/test/java/org/opentripplanner/gtfs/mapping/FareTransferRuleMapperTest.java +++ b/src/test/java/org/opentripplanner/gtfs/mapping/FareTransferRuleMapperTest.java @@ -6,7 +6,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.List; -import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.onebusaway.gtfs.model.AgencyAndId; import org.onebusaway.gtfs.model.FareProduct; @@ -65,7 +64,6 @@ void transferRuleWithLegGroup() { assertEquals(groupId2.getId(), transferRule.toLegGroup().getId()); } - @Nonnull private FareProduct fareProduct() { var fareProduct = new FareProduct(); fareProduct.setId(id); diff --git a/src/test/java/org/opentripplanner/gtfs/mapping/LocationGroupMapperTest.java b/src/test/java/org/opentripplanner/gtfs/mapping/LocationGroupMapperTest.java index 3a3c3f28649..67b18ead0c5 100644 --- a/src/test/java/org/opentripplanner/gtfs/mapping/LocationGroupMapperTest.java +++ b/src/test/java/org/opentripplanner/gtfs/mapping/LocationGroupMapperTest.java @@ -4,7 +4,6 @@ import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.onebusaway.gtfs.model.AgencyAndId; import org.onebusaway.gtfs.model.LocationGroup; @@ -45,7 +44,6 @@ void map() { ); } - @Nonnull private static AgencyAndId id(String id) { return new AgencyAndId("1", id); } diff --git a/src/test/java/org/opentripplanner/model/TimetableTest.java b/src/test/java/org/opentripplanner/model/TimetableTest.java index 9135abd96ee..dca4d3e828d 100644 --- a/src/test/java/org/opentripplanner/model/TimetableTest.java +++ b/src/test/java/org/opentripplanner/model/TimetableTest.java @@ -22,7 +22,6 @@ import java.util.HashMap; import java.util.Map; import java.util.function.BiConsumer; -import javax.annotation.Nonnull; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; @@ -975,7 +974,6 @@ private static void testInvalidStopTime( }); } - @Nonnull private static StopTimeUpdate emptyStopTime( int sequence, BiConsumer setEmptyEvent diff --git a/src/test/java/org/opentripplanner/netex/mapping/MappingSupport.java b/src/test/java/org/opentripplanner/netex/mapping/MappingSupport.java index 49f6d88c26b..cbabe19ad2d 100644 --- a/src/test/java/org/opentripplanner/netex/mapping/MappingSupport.java +++ b/src/test/java/org/opentripplanner/netex/mapping/MappingSupport.java @@ -1,7 +1,6 @@ package org.opentripplanner.netex.mapping; import jakarta.xml.bind.JAXBElement; -import javax.annotation.Nonnull; import javax.xml.namespace.QName; import org.opentripplanner.netex.mapping.support.FeedScopedIdFactory; import org.rutebanken.netex.model.VersionOfObjectRefStructure; @@ -54,7 +53,7 @@ public static T createRef(String id, Cla * @return the value wrapped in a JAXBElement */ @SuppressWarnings("unchecked") - public static JAXBElement createJaxbElement(@Nonnull T value) { + public static JAXBElement createJaxbElement(T value) { return new JAXBElement<>(new QName("x"), (Class) value.getClass(), value); } } diff --git a/src/test/java/org/opentripplanner/openstreetmap/wayproperty/WayPropertySetTest.java b/src/test/java/org/opentripplanner/openstreetmap/wayproperty/WayPropertySetTest.java index 24360539b6f..c9ec745d914 100644 --- a/src/test/java/org/opentripplanner/openstreetmap/wayproperty/WayPropertySetTest.java +++ b/src/test/java/org/opentripplanner/openstreetmap/wayproperty/WayPropertySetTest.java @@ -8,7 +8,6 @@ import static org.opentripplanner.street.model.StreetTraversalPermission.CAR; import static org.opentripplanner.street.model.StreetTraversalPermission.NONE; -import javax.annotation.Nonnull; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.opentripplanner.graph_builder.module.osm.StreetTraversalPermissionPair; @@ -84,7 +83,6 @@ void mixinLeftSide() { assertEquals(expected, wps.getDataForWay(cycleway).bicycleSafety()); } - @Nonnull private static WayPropertySet wps() { var wps = new WayPropertySet(); var source = new OsmTagMapper() { diff --git a/src/test/java/org/opentripplanner/raptor/_data/transit/TestTransitData.java b/src/test/java/org/opentripplanner/raptor/_data/transit/TestTransitData.java index 97ad09e3bfd..012bcfbe559 100644 --- a/src/test/java/org/opentripplanner/raptor/_data/transit/TestTransitData.java +++ b/src/test/java/org/opentripplanner/raptor/_data/transit/TestTransitData.java @@ -10,7 +10,6 @@ import java.util.Iterator; import java.util.List; import java.util.Set; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.model.transfer.ConstrainedTransfer; import org.opentripplanner.model.transfer.TransferConstraint; @@ -151,7 +150,6 @@ public RaptorConstrainedTransfer findConstrainedTransfer( }; } - @Nonnull @Override public RaptorStopNameResolver stopNameResolver() { // Index is translated: 1->'A', 2->'B', 3->'C' ... diff --git a/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/mappers/TripPatternForDateMapperTest.java b/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/mappers/TripPatternForDateMapperTest.java index 27f80062555..3f41c1d29c7 100644 --- a/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/mappers/TripPatternForDateMapperTest.java +++ b/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/mappers/TripPatternForDateMapperTest.java @@ -10,7 +10,6 @@ import java.time.LocalDate; import java.util.HashMap; import java.util.Map; -import javax.annotation.Nonnull; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.opentripplanner.model.Timetable; @@ -101,7 +100,6 @@ void testTimeTableWithServiceCodesRunningNotMatchingShouldReturnNull() { assertNull(mapper.map(timetable, SERVICE_DATE)); } - @Nonnull private static TIntHashSet tintHashSet(int... numbers) { var set = new TIntHashSet(); set.addAll(numbers); diff --git a/src/test/java/org/opentripplanner/routing/core/ItineraryFaresTest.java b/src/test/java/org/opentripplanner/routing/core/ItineraryFaresTest.java index 3ad3b918ce1..2e64952d351 100644 --- a/src/test/java/org/opentripplanner/routing/core/ItineraryFaresTest.java +++ b/src/test/java/org/opentripplanner/routing/core/ItineraryFaresTest.java @@ -15,7 +15,6 @@ import static org.opentripplanner.transit.model._data.TransitModelForTest.id; import java.util.List; -import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.opentripplanner.model.fare.FareProduct; import org.opentripplanner.model.fare.FareProductUse; @@ -65,7 +64,6 @@ void empty() { assertTrue(ItineraryFares.empty().isEmpty()); } - @Nonnull private static FareProduct fareProduct(String id) { return new FareProduct(id(id), id, Money.euros(10), null, null, null); } diff --git a/src/test/java/org/opentripplanner/routing/graph/SimpleConcreteEdge.java b/src/test/java/org/opentripplanner/routing/graph/SimpleConcreteEdge.java index 0a3fccccda7..f36300de9ef 100644 --- a/src/test/java/org/opentripplanner/routing/graph/SimpleConcreteEdge.java +++ b/src/test/java/org/opentripplanner/routing/graph/SimpleConcreteEdge.java @@ -1,6 +1,5 @@ package org.opentripplanner.routing.graph; -import javax.annotation.Nonnull; import org.locationtech.jts.geom.LineString; import org.opentripplanner.framework.geometry.SphericalDistanceLibrary; import org.opentripplanner.framework.i18n.I18NString; @@ -24,7 +23,6 @@ public static SimpleConcreteEdge createSimpleConcreteEdge(Vertex v1, Vertex v2) } @Override - @Nonnull public State[] traverse(State s0) { double d = getDistanceMeters(); TraverseMode mode = s0.currentMode(); diff --git a/src/test/java/org/opentripplanner/routing/graph/TemporaryConcreteEdge.java b/src/test/java/org/opentripplanner/routing/graph/TemporaryConcreteEdge.java index 44f6b6f7298..19020fc3f4f 100644 --- a/src/test/java/org/opentripplanner/routing/graph/TemporaryConcreteEdge.java +++ b/src/test/java/org/opentripplanner/routing/graph/TemporaryConcreteEdge.java @@ -1,6 +1,5 @@ package org.opentripplanner.routing.graph; -import javax.annotation.Nonnull; import org.opentripplanner.framework.geometry.SphericalDistanceLibrary; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.street.model.edge.Edge; @@ -36,7 +35,6 @@ public static TemporaryConcreteEdge createTemporaryConcreteEdge(Vertex v1, Tempo } @Override - @Nonnull public State[] traverse(State s0) { double d = getDistanceMeters(); TraverseMode mode = s0.currentMode(); diff --git a/src/test/java/org/opentripplanner/service/vehiclerental/model/TestFreeFloatingRentalVehicleBuilder.java b/src/test/java/org/opentripplanner/service/vehiclerental/model/TestFreeFloatingRentalVehicleBuilder.java index c3837942426..a9b2398f686 100644 --- a/src/test/java/org/opentripplanner/service/vehiclerental/model/TestFreeFloatingRentalVehicleBuilder.java +++ b/src/test/java/org/opentripplanner/service/vehiclerental/model/TestFreeFloatingRentalVehicleBuilder.java @@ -1,6 +1,5 @@ package org.opentripplanner.service.vehiclerental.model; -import javax.annotation.Nonnull; import org.opentripplanner.framework.i18n.NonLocalizedString; import org.opentripplanner.street.model.RentalFormFactor; import org.opentripplanner.transit.model.framework.FeedScopedId; @@ -65,7 +64,6 @@ public TestFreeFloatingRentalVehicleBuilder withVehicleCar() { return buildVehicleType(RentalFormFactor.CAR); } - @Nonnull private TestFreeFloatingRentalVehicleBuilder buildVehicleType(RentalFormFactor rentalFormFactor) { this.vehicleType = new RentalVehicleType( diff --git a/src/test/java/org/opentripplanner/service/vehiclerental/model/TestVehicleRentalStationBuilder.java b/src/test/java/org/opentripplanner/service/vehiclerental/model/TestVehicleRentalStationBuilder.java index 0fb9f8b620f..ea8af5ade6f 100644 --- a/src/test/java/org/opentripplanner/service/vehiclerental/model/TestVehicleRentalStationBuilder.java +++ b/src/test/java/org/opentripplanner/service/vehiclerental/model/TestVehicleRentalStationBuilder.java @@ -2,7 +2,6 @@ import java.util.HashMap; import java.util.Map; -import javax.annotation.Nonnull; import org.opentripplanner.framework.i18n.NonLocalizedString; import org.opentripplanner.street.model.RentalFormFactor; import org.opentripplanner.transit.model.framework.FeedScopedId; @@ -105,7 +104,6 @@ public TestVehicleRentalStationBuilder withVehicleTypeCar(int numAvailable, int ); } - @Nonnull private TestVehicleRentalStationBuilder buildVehicleType( RentalFormFactor rentalFormFactor, RentalVehicleType.PropulsionType propulsionType, diff --git a/src/test/java/org/opentripplanner/standalone/server/EtagRequestFilterTest.java b/src/test/java/org/opentripplanner/standalone/server/EtagRequestFilterTest.java index ae19643db72..100edd8f5ae 100644 --- a/src/test/java/org/opentripplanner/standalone/server/EtagRequestFilterTest.java +++ b/src/test/java/org/opentripplanner/standalone/server/EtagRequestFilterTest.java @@ -7,7 +7,6 @@ import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.stream.Stream; -import javax.annotation.Nonnull; import org.glassfish.jersey.message.internal.OutboundJaxrsResponse; import org.glassfish.jersey.message.internal.OutboundMessageContext; import org.glassfish.jersey.message.internal.Statuses; @@ -84,7 +83,6 @@ void ifNoneMatch(String ifNoneMatch, int expectedStatus, byte[] expectedEntity) assertArrayEquals(expectedEntity, (byte[]) response.getEntity()); } - @Nonnull private static ContainerResponse response(int status, ContainerRequest request) { return new ContainerResponse( request, @@ -92,7 +90,6 @@ private static ContainerResponse response(int status, ContainerRequest request) ); } - @Nonnull private static byte[] bytes(String input) { return input.getBytes(StandardCharsets.UTF_8); } diff --git a/src/test/java/org/opentripplanner/street/model/_data/StreetModelForTest.java b/src/test/java/org/opentripplanner/street/model/_data/StreetModelForTest.java index 4a0a0d1b848..a57e4227a6b 100644 --- a/src/test/java/org/opentripplanner/street/model/_data/StreetModelForTest.java +++ b/src/test/java/org/opentripplanner/street/model/_data/StreetModelForTest.java @@ -2,7 +2,6 @@ import static org.opentripplanner.transit.model._data.TransitModelForTest.id; -import javax.annotation.Nonnull; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.LineString; import org.opentripplanner.framework.geometry.GeometryUtils; @@ -42,7 +41,6 @@ public static IntersectionVertex intersectionVertex(String label, double lat, do return new LabelledIntersectionVertex(label, lon, lat, false, false); } - @Nonnull public static TransitEntranceVertex transitEntranceVertex(String id, double lat, double lon) { var entrance = Entrance .of(id(id)) diff --git a/src/test/java/org/opentripplanner/street/model/edge/PathwayEdgeTest.java b/src/test/java/org/opentripplanner/street/model/edge/PathwayEdgeTest.java index 6929f665938..6d5574b8027 100644 --- a/src/test/java/org/opentripplanner/street/model/edge/PathwayEdgeTest.java +++ b/src/test/java/org/opentripplanner/street/model/edge/PathwayEdgeTest.java @@ -7,7 +7,6 @@ import java.util.Optional; import java.util.stream.Stream; -import javax.annotation.Nonnull; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -241,7 +240,6 @@ void emptySignpostedAs() { assertEquals(PathwayEdge.DEFAULT_NAME, edge.getName()); } - @Nonnull private PathwayEdge pathwayEdge(I18NString sign) { return PathwayEdge.createPathwayEdge( from, diff --git a/src/test/java/org/opentripplanner/street/model/edge/RentalRestrictionExtensionTest.java b/src/test/java/org/opentripplanner/street/model/edge/RentalRestrictionExtensionTest.java index 2a5589d58bf..41b648cea64 100644 --- a/src/test/java/org/opentripplanner/street/model/edge/RentalRestrictionExtensionTest.java +++ b/src/test/java/org/opentripplanner/street/model/edge/RentalRestrictionExtensionTest.java @@ -13,7 +13,6 @@ import static org.opentripplanner.street.search.state.VehicleRentalState.RENTING_FLOATING; import java.util.Set; -import javax.annotation.Nonnull; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.opentripplanner.routing.api.request.StreetMode; @@ -167,7 +166,6 @@ private State[] traverse(StreetEdge edge) { return edge.traverse(state); } - @Nonnull private State state(String network) { var req = StreetSearchRequest.of().withMode(StreetMode.SCOOTER_RENTAL).build(); var editor = new StateEditor(V1, req); diff --git a/src/test/java/org/opentripplanner/street/model/edge/StreetEdgeGeofencingTest.java b/src/test/java/org/opentripplanner/street/model/edge/StreetEdgeGeofencingTest.java index cc38b04230a..3375d94f5af 100644 --- a/src/test/java/org/opentripplanner/street/model/edge/StreetEdgeGeofencingTest.java +++ b/src/test/java/org/opentripplanner/street/model/edge/StreetEdgeGeofencingTest.java @@ -14,7 +14,6 @@ import static org.opentripplanner.street.search.state.VehicleRentalState.RENTING_FLOATING; import java.util.Set; -import javax.annotation.Nonnull; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.opentripplanner.routing.api.request.StreetMode; @@ -297,7 +296,6 @@ private static StreetSearchRequest defaultArriveByRequest() { } } - @Nonnull private static GeofencingZoneExtension noDropOffRestriction(String networkTier) { return new GeofencingZoneExtension( new GeofencingZone(new FeedScopedId(networkTier, "a-park"), null, true, false) @@ -309,12 +307,10 @@ private State[] traverseFromV1(StreetEdge edge) { return edge.traverse(state); } - @Nonnull private State forwardState(String network) { return initialState(V1, network, false); } - @Nonnull private State initialState(Vertex startVertex, String network, boolean arriveBy) { var req = StreetSearchRequest .of() diff --git a/src/test/java/org/opentripplanner/street/model/edge/StreetEdgeRentalTraversalTest.java b/src/test/java/org/opentripplanner/street/model/edge/StreetEdgeRentalTraversalTest.java index 44de661f327..e2187acad18 100644 --- a/src/test/java/org/opentripplanner/street/model/edge/StreetEdgeRentalTraversalTest.java +++ b/src/test/java/org/opentripplanner/street/model/edge/StreetEdgeRentalTraversalTest.java @@ -14,7 +14,6 @@ import static org.opentripplanner.street.model._data.StreetModelForTest.streetEdge; import java.util.stream.Stream; -import javax.annotation.Nonnull; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -31,7 +30,6 @@ public class StreetEdgeRentalTraversalTest { StreetVertex v0 = intersectionVertex(0.0, 0.0); StreetVertex v1 = intersectionVertex(2.0, 2.0); - @Nonnull private static Stream baseCases(StreetTraversalPermission p) { return Stream.of( of(SCOOTER, SCOOTER_RENTAL, p), diff --git a/src/test/java/org/opentripplanner/street/model/edge/VehicleRentalEdgeTest.java b/src/test/java/org/opentripplanner/street/model/edge/VehicleRentalEdgeTest.java index a3fbfcb018e..e8a1282327c 100644 --- a/src/test/java/org/opentripplanner/street/model/edge/VehicleRentalEdgeTest.java +++ b/src/test/java/org/opentripplanner/street/model/edge/VehicleRentalEdgeTest.java @@ -6,7 +6,6 @@ import static org.junit.jupiter.api.Assertions.fail; import java.util.Set; -import javax.annotation.Nonnull; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.opentripplanner.routing.api.request.StreetMode; @@ -254,7 +253,6 @@ void startedOutsideNoDropOffZone() { assertEquals(VehicleRentalState.BEFORE_RENTING, afterTraversal.getVehicleRentalState()); } - @Nonnull private GeofencingZoneExtension noDropOffZone() { return new GeofencingZoneExtension( new GeofencingZone(new FeedScopedId(NETWORK, "zone"), null, true, false) diff --git a/src/test/java/org/opentripplanner/street/model/vertex/OsmVertexTest.java b/src/test/java/org/opentripplanner/street/model/vertex/OsmVertexTest.java index b3a2b0baebb..61da00ed2c6 100644 --- a/src/test/java/org/opentripplanner/street/model/vertex/OsmVertexTest.java +++ b/src/test/java/org/opentripplanner/street/model/vertex/OsmVertexTest.java @@ -5,7 +5,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.List; -import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.opentripplanner.transit.model._data.TransitModelForTest; import org.opentripplanner.transit.model.site.AreaStop; @@ -38,7 +37,6 @@ void addAreaStop() { assertEquals(2, vertex.areaStops().size()); } - @Nonnull private static OsmVertex vertex() { return new OsmVertex(1, 2, 1); } diff --git a/src/test/java/org/opentripplanner/street/model/vertex/SimpleVertex.java b/src/test/java/org/opentripplanner/street/model/vertex/SimpleVertex.java index 294bed335cc..b2df8bc6d16 100644 --- a/src/test/java/org/opentripplanner/street/model/vertex/SimpleVertex.java +++ b/src/test/java/org/opentripplanner/street/model/vertex/SimpleVertex.java @@ -1,6 +1,5 @@ package org.opentripplanner.street.model.vertex; -import javax.annotation.Nonnull; import org.opentripplanner.framework.i18n.I18NString; public class SimpleVertex extends StreetVertex { @@ -12,7 +11,6 @@ public SimpleVertex(String label, double lat, double lon) { this.label = label; } - @Nonnull @Override public I18NString getName() { return I18NString.of(label); diff --git a/src/test/java/org/opentripplanner/street/model/vertex/TemporaryVertexDisposeTest.java b/src/test/java/org/opentripplanner/street/model/vertex/TemporaryVertexDisposeTest.java index 7f559f2ad35..e4880f891e2 100644 --- a/src/test/java/org/opentripplanner/street/model/vertex/TemporaryVertexDisposeTest.java +++ b/src/test/java/org/opentripplanner/street/model/vertex/TemporaryVertexDisposeTest.java @@ -2,7 +2,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; -import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.street.model.edge.FreeEdge; @@ -232,7 +231,6 @@ public String toString() { return getLabelString(); } - @Nonnull @Override public I18NString getName() { return NO_NAME; diff --git a/src/test/java/org/opentripplanner/street/search/state/TestStateBuilder.java b/src/test/java/org/opentripplanner/street/search/state/TestStateBuilder.java index 3750c4619b9..1b66152ec09 100644 --- a/src/test/java/org/opentripplanner/street/search/state/TestStateBuilder.java +++ b/src/test/java/org/opentripplanner/street/search/state/TestStateBuilder.java @@ -8,7 +8,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.List; -import javax.annotation.Nonnull; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.framework.i18n.NonLocalizedString; import org.opentripplanner.routing.algorithm.raptoradapter.router.street.AccessEgressType; @@ -277,7 +276,6 @@ public TestStateBuilder pathway(String s) { return this; } - @Nonnull private TestStateBuilder arriveAtStop(RegularStop stop) { var from = (StreetVertex) currentState.vertex; var to = TransitStopVertex.of().withStop(stop).build(); @@ -296,7 +294,6 @@ private TestStateBuilder arriveAtStop(RegularStop stop) { return this; } - @Nonnull private static ElevatorOffboardVertex elevatorOffBoard(int count, String suffix) { return new ElevatorOffboardVertex( StreetModelForTest.intersectionVertex(count, count), @@ -305,7 +302,6 @@ private static ElevatorOffboardVertex elevatorOffBoard(int count, String suffix) ); } - @Nonnull private static ElevatorOnboardVertex elevatorOnBoard(int count, String suffix) { return new ElevatorOnboardVertex( StreetModelForTest.intersectionVertex(count, count), diff --git a/src/test/java/org/opentripplanner/transit/model/framework/EntityByIdTest.java b/src/test/java/org/opentripplanner/transit/model/framework/EntityByIdTest.java index 146c2c9e5ae..f7f1aed4666 100644 --- a/src/test/java/org/opentripplanner/transit/model/framework/EntityByIdTest.java +++ b/src/test/java/org/opentripplanner/transit/model/framework/EntityByIdTest.java @@ -5,7 +5,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Collections; -import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.opentripplanner.transit.model._data.TransitModelForTest; @@ -84,11 +83,10 @@ public static TestEntityBuilder of(FeedScopedId id) { } @Override - public boolean sameAs(@Nonnull TestEntity other) { + public boolean sameAs(TestEntity other) { return getId().equals(other.getId()); } - @Nonnull @Override public TransitBuilder copy() { return new TestEntityBuilder(this); diff --git a/src/test/java/org/opentripplanner/updater/trip/TimetableSnapshotSourceTest.java b/src/test/java/org/opentripplanner/updater/trip/TimetableSnapshotSourceTest.java index e53ba07cbcf..21d6591485c 100644 --- a/src/test/java/org/opentripplanner/updater/trip/TimetableSnapshotSourceTest.java +++ b/src/test/java/org/opentripplanner/updater/trip/TimetableSnapshotSourceTest.java @@ -19,7 +19,6 @@ import java.time.Duration; import java.time.LocalDate; import java.util.List; -import javax.annotation.Nonnull; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.opentripplanner.ConstantsForTests; @@ -282,7 +281,6 @@ public void testHandleModifiedTrip() { } } - @Nonnull private TimetableSnapshotSource defaultUpdater() { return new TimetableSnapshotSource( new TimetableSnapshotSourceParameters(Duration.ZERO, true), diff --git a/src/test/java/org/opentripplanner/updater/vehicle_rental/VehicleRentalUpdaterTest.java b/src/test/java/org/opentripplanner/updater/vehicle_rental/VehicleRentalUpdaterTest.java index 0016bf4c00c..17eb3fb3c63 100644 --- a/src/test/java/org/opentripplanner/updater/vehicle_rental/VehicleRentalUpdaterTest.java +++ b/src/test/java/org/opentripplanner/updater/vehicle_rental/VehicleRentalUpdaterTest.java @@ -9,7 +9,6 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.junit.jupiter.api.Test; import org.opentripplanner.routing.graph.Graph; @@ -81,7 +80,6 @@ private boolean hasFailed() { static class FakeParams implements VehicleRentalDataSourceParameters { - @Nonnull @Override public String url() { return "https://example.com"; @@ -93,13 +91,11 @@ public String network() { return "Test"; } - @Nonnull @Override public VehicleRentalSourceType sourceType() { return VehicleRentalSourceType.GBFS; } - @Nonnull @Override public HttpHeaders httpHeaders() { return HttpHeaders.empty();