Skip to content

Commit e8e9a77

Browse files
committed
Run formatting with newer prettier java version
1 parent 060d779 commit e8e9a77

File tree

1,203 files changed

+10888
-13426
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,203 files changed

+10888
-13426
lines changed

application/src/ext-test/java/org/opentripplanner/ext/accessibilityscore/DecorateWithAccessibilityScoreTest.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@
1919
class DecorateWithAccessibilityScoreTest implements PlanTestConstants {
2020

2121
private static final int ID = 1;
22-
private static final DecorateWithAccessibilityScore DECORATOR = new DecorateWithAccessibilityScore(
23-
WheelchairPreferences.DEFAULT.maxSlope()
24-
);
22+
private static final DecorateWithAccessibilityScore DECORATOR =
23+
new DecorateWithAccessibilityScore(WheelchairPreferences.DEFAULT.maxSlope());
2524

2625
static List<Arguments> accessibilityScoreTestCase() {
2726
return List.of(

application/src/ext-test/java/org/opentripplanner/ext/emissions/EmissionsModuleTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ public class EmissionsModuleTest {
3737
void testMultipleGtfsDataReading() {
3838
inputData.put(GTFS, new FileDataSource(CO2_GTFS_ZIP, GTFS));
3939
inputData.put(GTFS, new FileDataSource(CO2_GTFS, GTFS));
40-
Iterable<ConfiguredDataSource<GtfsFeedParameters>> configuredDataSource = getGtfsConfiguredDatasource();
40+
Iterable<ConfiguredDataSource<GtfsFeedParameters>> configuredDataSource =
41+
getGtfsConfiguredDatasource();
4142
EmissionsDataModel emissionsDataModel = new EmissionsDataModel();
4243
EmissionsModule emissionsModule = new EmissionsModule(
4344
configuredDataSource,

application/src/ext-test/java/org/opentripplanner/ext/emissions/EmissionsTest.java

+15-18
Original file line numberDiff line numberDiff line change
@@ -35,27 +35,26 @@ class EmissionsTest {
3535
private static DefaultEmissionsService eService;
3636
private static DecorateWithEmission decorateWithEmission;
3737

38-
static final ZonedDateTime TIME = OffsetDateTime
39-
.parse("2023-07-20T17:49:06+03:00")
40-
.toZonedDateTime();
38+
static final ZonedDateTime TIME = OffsetDateTime.parse(
39+
"2023-07-20T17:49:06+03:00"
40+
).toZonedDateTime();
4141

42-
private static final StreetLeg STREET_LEG = StreetLeg
43-
.create()
42+
private static final StreetLeg STREET_LEG = StreetLeg.create()
4443
.withMode(TraverseMode.CAR)
4544
.withDistanceMeters(214.4)
4645
.withStartTime(TIME)
4746
.withEndTime(TIME.plusHours(1))
4847
.build();
4948

50-
private static final Route ROUTE_WITH_EMISSIONS = TimetableRepositoryForTest
51-
.route(id("1"))
52-
.build();
53-
private static final Route ROUTE_WITH_ZERO_EMISSIONS = TimetableRepositoryForTest
54-
.route(id("2"))
55-
.build();
56-
private static final Route ROUTE_WITHOUT_EMISSIONS_CONFIGURED = TimetableRepositoryForTest
57-
.route(id("3"))
58-
.build();
49+
private static final Route ROUTE_WITH_EMISSIONS = TimetableRepositoryForTest.route(
50+
id("1")
51+
).build();
52+
private static final Route ROUTE_WITH_ZERO_EMISSIONS = TimetableRepositoryForTest.route(
53+
id("2")
54+
).build();
55+
private static final Route ROUTE_WITHOUT_EMISSIONS_CONFIGURED = TimetableRepositoryForTest.route(
56+
id("3")
57+
).build();
5958

6059
@BeforeAll
6160
static void SetUp() {
@@ -129,12 +128,10 @@ private ScheduledTransitLeg createTransitLeg(Route route) {
129128
var stopTwo = testModel.stop("1:stop1", 61, 25).build();
130129
var stopThree = testModel.stop("1:stop1", 62, 25).build();
131130
var stopPattern = TimetableRepositoryForTest.stopPattern(stopOne, stopTwo, stopThree);
132-
var pattern = TimetableRepositoryForTest
133-
.tripPattern("1", route)
131+
var pattern = TimetableRepositoryForTest.tripPattern("1", route)
134132
.withStopPattern(stopPattern)
135133
.build();
136-
var trip = Trip
137-
.of(FeedScopedId.parse("FOO:BAR"))
134+
var trip = Trip.of(FeedScopedId.parse("FOO:BAR"))
138135
.withMode(TransitMode.BUS)
139136
.withRoute(route)
140137
.build();

application/src/ext-test/java/org/opentripplanner/ext/fares/FareRuleSetTest.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ class FareRuleSetTest {
2020
@BeforeEach
2121
void setUp() {
2222
FeedScopedId id = new FeedScopedId("feed", "fare1");
23-
FareAttribute fareAttribute = FareAttribute
24-
.of(id)
23+
FareAttribute fareAttribute = FareAttribute.of(id)
2524
.setPrice(TWO_FIFTY)
2625
.setPaymentMethod(1)
2726
.setTransfers(1)
@@ -175,8 +174,7 @@ void testMatchesWithTransferDuration() {
175174

176175
@Test
177176
void testMatchesWithJourneyDuration() {
178-
FareAttribute journeyFare = FareAttribute
179-
.of(new FeedScopedId("feed", "journey"))
177+
FareAttribute journeyFare = FareAttribute.of(new FeedScopedId("feed", "journey"))
180178
.setPrice(Money.usDollars(3.00f))
181179
.setPaymentMethod(1)
182180
.setJourneyDuration(7200)

application/src/ext-test/java/org/opentripplanner/ext/fares/impl/AtlantaFareServiceTest.java

+48-57
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,11 @@ void fromCobbTransfers() {
9595
calculateFare(rides, DEFAULT_TEST_RIDE_PRICE.plus(DEFAULT_TEST_RIDE_PRICE).plus(usDollars(3)));
9696

9797
// Local to circulator to express
98-
rides =
99-
List.of(
100-
getLeg(COBB_AGENCY_ID, 0),
101-
getLeg(COBB_AGENCY_ID, "BLUE", 1),
102-
getLeg(COBB_AGENCY_ID, "101", 1)
103-
);
98+
rides = List.of(
99+
getLeg(COBB_AGENCY_ID, 0),
100+
getLeg(COBB_AGENCY_ID, "BLUE", 1),
101+
getLeg(COBB_AGENCY_ID, "101", 1)
102+
);
104103
calculateFare(rides, DEFAULT_TEST_RIDE_PRICE.plus(usDollars(1)));
105104
}
106105

@@ -122,45 +121,41 @@ void tooManyLegs() {
122121
);
123122
calculateFare(rides, DEFAULT_TEST_RIDE_PRICE.plus(DEFAULT_TEST_RIDE_PRICE));
124123

125-
rides =
126-
List.of(
127-
getLeg(MARTA_AGENCY_ID, 0),
128-
getLeg(MARTA_AGENCY_ID, 1),
129-
getLeg(GCT_AGENCY_ID, 2),
130-
getLeg(GCT_AGENCY_ID, 3),
131-
getLeg(MARTA_AGENCY_ID, 4),
132-
getLeg(COBB_AGENCY_ID, 5)
133-
);
124+
rides = List.of(
125+
getLeg(MARTA_AGENCY_ID, 0),
126+
getLeg(MARTA_AGENCY_ID, 1),
127+
getLeg(GCT_AGENCY_ID, 2),
128+
getLeg(GCT_AGENCY_ID, 3),
129+
getLeg(MARTA_AGENCY_ID, 4),
130+
getLeg(COBB_AGENCY_ID, 5)
131+
);
134132
calculateFare(rides, DEFAULT_TEST_RIDE_PRICE.plus(DEFAULT_TEST_RIDE_PRICE));
135133

136-
rides =
137-
List.of(
138-
getLeg(GCT_AGENCY_ID, 0),
139-
getLeg(MARTA_AGENCY_ID, 1),
140-
getLeg(MARTA_AGENCY_ID, 2),
141-
getLeg(MARTA_AGENCY_ID, 3)
142-
);
134+
rides = List.of(
135+
getLeg(GCT_AGENCY_ID, 0),
136+
getLeg(MARTA_AGENCY_ID, 1),
137+
getLeg(MARTA_AGENCY_ID, 2),
138+
getLeg(MARTA_AGENCY_ID, 3)
139+
);
143140
calculateFare(rides, DEFAULT_TEST_RIDE_PRICE);
144141

145-
rides =
146-
List.of(
147-
getLeg(GCT_AGENCY_ID, 0),
148-
getLeg(MARTA_AGENCY_ID, 1),
149-
getLeg(MARTA_AGENCY_ID, 2),
150-
getLeg(MARTA_AGENCY_ID, 3),
151-
// new transfer - only got 3 from GCT
152-
getLeg(MARTA_AGENCY_ID, 4)
153-
);
142+
rides = List.of(
143+
getLeg(GCT_AGENCY_ID, 0),
144+
getLeg(MARTA_AGENCY_ID, 1),
145+
getLeg(MARTA_AGENCY_ID, 2),
146+
getLeg(MARTA_AGENCY_ID, 3),
147+
// new transfer - only got 3 from GCT
148+
getLeg(MARTA_AGENCY_ID, 4)
149+
);
154150
calculateFare(rides, DEFAULT_TEST_RIDE_PRICE.plus(DEFAULT_TEST_RIDE_PRICE));
155151

156-
rides =
157-
List.of(
158-
getLeg(MARTA_AGENCY_ID, 0),
159-
getLeg(MARTA_AGENCY_ID, 1),
160-
getLeg(MARTA_AGENCY_ID, 2),
161-
getLeg(GCT_AGENCY_ID, 3),
162-
getLeg(GCT_AGENCY_ID, 4)
163-
);
152+
rides = List.of(
153+
getLeg(MARTA_AGENCY_ID, 0),
154+
getLeg(MARTA_AGENCY_ID, 1),
155+
getLeg(MARTA_AGENCY_ID, 2),
156+
getLeg(GCT_AGENCY_ID, 3),
157+
getLeg(GCT_AGENCY_ID, 4)
158+
);
164159
calculateFare(rides, DEFAULT_TEST_RIDE_PRICE);
165160
}
166161

@@ -174,14 +169,13 @@ void expiredTransfer() {
174169
);
175170
calculateFare(rides, DEFAULT_TEST_RIDE_PRICE.plus(DEFAULT_TEST_RIDE_PRICE));
176171

177-
rides =
178-
List.of(
179-
getLeg(MARTA_AGENCY_ID, 0),
180-
getLeg(GCT_AGENCY_ID, 1),
181-
getLeg(GCT_AGENCY_ID, 181),
182-
getLeg(MARTA_AGENCY_ID, 181 + 178),
183-
getLeg(MARTA_AGENCY_ID, 181 + 179)
184-
);
172+
rides = List.of(
173+
getLeg(MARTA_AGENCY_ID, 0),
174+
getLeg(GCT_AGENCY_ID, 1),
175+
getLeg(GCT_AGENCY_ID, 181),
176+
getLeg(MARTA_AGENCY_ID, 181 + 178),
177+
getLeg(MARTA_AGENCY_ID, 181 + 179)
178+
);
185179
calculateFare(rides, DEFAULT_TEST_RIDE_PRICE.plus(DEFAULT_TEST_RIDE_PRICE));
186180
}
187181

@@ -197,12 +191,11 @@ void useStreetcar() {
197191
);
198192
calculateFare(rides, DEFAULT_TEST_RIDE_PRICE.plus(STREETCAR_PRICE));
199193

200-
rides =
201-
List.of(
202-
getLeg(COBB_AGENCY_ID, 0),
203-
getLeg(MARTA_AGENCY_ID, "atlsc", 1),
204-
getLeg(COBB_AGENCY_ID, "101", 2)
205-
);
194+
rides = List.of(
195+
getLeg(COBB_AGENCY_ID, 0),
196+
getLeg(MARTA_AGENCY_ID, "atlsc", 1),
197+
getLeg(COBB_AGENCY_ID, "101", 2)
198+
);
206199
calculateFare(rides, DEFAULT_TEST_RIDE_PRICE.plus(usDollars(1)).plus(STREETCAR_PRICE));
207200
}
208201

@@ -263,8 +256,7 @@ private static Leg createLeg(String agencyId, String shortName, long startTimeMi
263256

264257
private static Itinerary createItinerary(String agencyId, String shortName, long startTimeMins) {
265258
var siteRepositoryBuilder = SiteRepository.of();
266-
Agency agency = Agency
267-
.of(new FeedScopedId(FEED_ID, agencyId))
259+
Agency agency = Agency.of(new FeedScopedId(FEED_ID, agencyId))
268260
.withName(agencyId)
269261
.withTimezone(ZoneIds.NEW_YORK.getId())
270262
.build();
@@ -282,8 +274,7 @@ private static Itinerary createItinerary(String agencyId, String shortName, long
282274
.build();
283275

284276
FeedScopedId routeFeedScopeId = new FeedScopedId(FEED_ID, "123");
285-
Route route = Route
286-
.of(routeFeedScopeId)
277+
Route route = Route.of(routeFeedScopeId)
287278
.withAgency(agency)
288279
.withShortName(shortName)
289280
.withLongName(new NonLocalizedString("123"))

application/src/ext-test/java/org/opentripplanner/ext/fares/impl/DefaultFareServiceTest.java

+15-13
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,16 @@
3030
class DefaultFareServiceTest implements PlanTestConstants {
3131

3232
private static final Money TEN_DOLLARS = Money.usDollars(10);
33-
private static final FareProduct OTHER_FEED_PRODUCT = FareProduct
34-
.of(OTHER_FEED_ATTRIBUTE.getId(), "regular", TEN_DOLLARS)
35-
.build();
36-
private static final FareProduct AIRPORT_TO_CITY_CENTER_PRODUCT = FareProduct
37-
.of(AIRPORT_TO_CITY_CENTER_SET.getFareAttribute().getId(), "regular", TEN_DOLLARS)
38-
.build();
33+
private static final FareProduct OTHER_FEED_PRODUCT = FareProduct.of(
34+
OTHER_FEED_ATTRIBUTE.getId(),
35+
"regular",
36+
TEN_DOLLARS
37+
).build();
38+
private static final FareProduct AIRPORT_TO_CITY_CENTER_PRODUCT = FareProduct.of(
39+
AIRPORT_TO_CITY_CENTER_SET.getFareAttribute().getId(),
40+
"regular",
41+
TEN_DOLLARS
42+
).build();
3943

4044
@Test
4145
void noRules() {
@@ -92,13 +96,11 @@ void applyToSeveralLegs() {
9296
List.of(
9397
new FareProductUse(
9498
"ddbf1572-18bc-3724-8b64-e1c7d5c8b6c6",
95-
FareProduct
96-
.of(
97-
FREE_TRANSFERS_IN_CITY_SET.getFareAttribute().getId(),
98-
"regular",
99-
TEN_DOLLARS.plus(TEN_DOLLARS)
100-
)
101-
.build()
99+
FareProduct.of(
100+
FREE_TRANSFERS_IN_CITY_SET.getFareAttribute().getId(),
101+
"regular",
102+
TEN_DOLLARS.plus(TEN_DOLLARS)
103+
).build()
102104
)
103105
),
104106
firstProducts

application/src/ext-test/java/org/opentripplanner/ext/fares/impl/FareModelForTest.java

+23-23
Original file line numberDiff line numberDiff line change
@@ -24,63 +24,64 @@ public class FareModelForTest {
2424
public static final FareZone AIRPORT_ZONE = FareZone.of(id("airport-zone")).build();
2525
public static final FareZone CITY_CENTER_ZONE = FareZone.of(id("city-center")).build();
2626

27-
public static final FareZone OTHER_FEED_ZONE = FareZone
28-
.of(FeedScopedId.ofNullable("F2", "other-feed-zone"))
29-
.build();
27+
public static final FareZone OTHER_FEED_ZONE = FareZone.of(
28+
FeedScopedId.ofNullable("F2", "other-feed-zone")
29+
).build();
3030

3131
private static final SiteRepositoryBuilder SITE_REPOSITORY_BUILDER = SiteRepository.of();
3232

33-
static final RegularStop AIRPORT_STOP = SITE_REPOSITORY_BUILDER
34-
.regularStop(id("airport"))
33+
static final RegularStop AIRPORT_STOP = SITE_REPOSITORY_BUILDER.regularStop(id("airport"))
3534
.withCoordinate(new WgsCoordinate(1, 1))
3635
.addFareZones(AIRPORT_ZONE)
3736
.withName(I18NString.of("Airport"))
3837
.build();
3938

40-
static final RegularStop CITY_CENTER_A_STOP = SITE_REPOSITORY_BUILDER
41-
.regularStop(id("city-center-a"))
39+
static final RegularStop CITY_CENTER_A_STOP = SITE_REPOSITORY_BUILDER.regularStop(
40+
id("city-center-a")
41+
)
4242
.withCoordinate(new WgsCoordinate(1, 2))
4343
.addFareZones(CITY_CENTER_ZONE)
4444
.withName(I18NString.of("City center: stop A"))
4545
.build();
46-
static final RegularStop CITY_CENTER_B_STOP = SITE_REPOSITORY_BUILDER
47-
.regularStop(id("city-center-b"))
46+
static final RegularStop CITY_CENTER_B_STOP = SITE_REPOSITORY_BUILDER.regularStop(
47+
id("city-center-b")
48+
)
4849
.withCoordinate(new WgsCoordinate(1, 3))
4950
.addFareZones(CITY_CENTER_ZONE)
5051
.withName(I18NString.of("City center: stop B"))
5152
.build();
52-
static final RegularStop CITY_CENTER_C_STOP = SITE_REPOSITORY_BUILDER
53-
.regularStop(id("city-center-c"))
53+
static final RegularStop CITY_CENTER_C_STOP = SITE_REPOSITORY_BUILDER.regularStop(
54+
id("city-center-c")
55+
)
5456
.withCoordinate(new WgsCoordinate(1, 4))
5557
.addFareZones(CITY_CENTER_ZONE)
5658
.withName(I18NString.of("City center: stop C"))
5759
.build();
58-
static final RegularStop SUBURB_STOP = SITE_REPOSITORY_BUILDER
59-
.regularStop(id("suburb"))
60+
static final RegularStop SUBURB_STOP = SITE_REPOSITORY_BUILDER.regularStop(id("suburb"))
6061
.withCoordinate(new WgsCoordinate(1, 4))
6162
.withName(I18NString.of("Suburb"))
6263
.build();
6364

64-
static final RegularStop OTHER_FEED_STOP = SITE_REPOSITORY_BUILDER
65-
.regularStop(FeedScopedId.ofNullable("F2", "other-feed-stop"))
65+
static final RegularStop OTHER_FEED_STOP = SITE_REPOSITORY_BUILDER.regularStop(
66+
FeedScopedId.ofNullable("F2", "other-feed-stop")
67+
)
6668
.withCoordinate(new WgsCoordinate(1, 5))
6769
.withName(I18NString.of("Other feed stop"))
6870
.addFareZones(OTHER_FEED_ZONE)
6971
.build();
70-
static final FareAttribute TEN_DOLLARS = FareAttribute
71-
.of(id("airport-to-city-center"))
72+
static final FareAttribute TEN_DOLLARS = FareAttribute.of(id("airport-to-city-center"))
7273
.setPrice(Money.usDollars(10))
7374
.setTransfers(0)
7475
.build();
7576

76-
static final FareAttribute FREE_TRANSFERS = FareAttribute
77-
.of(id("free-transfers"))
77+
static final FareAttribute FREE_TRANSFERS = FareAttribute.of(id("free-transfers"))
7878
.setPrice(Money.usDollars(20))
7979
.setTransfers(10)
8080
.build();
8181

82-
static final FareAttribute OTHER_FEED_ATTRIBUTE = FareAttribute
83-
.of(FeedScopedId.ofNullable("F2", "other-feed-attribute"))
82+
static final FareAttribute OTHER_FEED_ATTRIBUTE = FareAttribute.of(
83+
FeedScopedId.ofNullable("F2", "other-feed-attribute")
84+
)
8485
.setPrice(Money.usDollars(10))
8586
.setTransfers(1)
8687
.setAgency(OTHER_FEED_AGENCY.getId())
@@ -124,8 +125,7 @@ public class FareModelForTest {
124125
);
125126
}
126127

127-
static Route OTHER_FEED_ROUTE = Route
128-
.of(new FeedScopedId("F2", "other-feed-route"))
128+
static Route OTHER_FEED_ROUTE = Route.of(new FeedScopedId("F2", "other-feed-route"))
129129
.withAgency(OTHER_FEED_AGENCY)
130130
.withLongName(I18NString.of("other-feed-route"))
131131
.withMode(TransitMode.BUS)

0 commit comments

Comments
 (0)