Skip to content

Commit a4660cc

Browse files
Apply suggestions from code review
Co-authored-by: Thomas Gran <[email protected]>
1 parent 26d34f0 commit a4660cc

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

src/main/java/org/opentripplanner/model/fare/FareProduct.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,9 @@ public String toString() {
4848
.of(FareProduct.class)
4949
.addStr("id", id.toString())
5050
.addObj("amount", amount);
51-
if (duration != null) {
52-
builder.addDuration("duration", duration);
53-
}
54-
if (category != null) {
55-
builder.addObj("category", category);
56-
}
57-
if (medium != null) {
58-
builder.addObj("medium", medium);
59-
}
51+
builder.addDuration("duration", duration);
52+
builder.addObj("category", category);
53+
builder.addObj("medium", medium);
6054

6155
return builder.toString();
6256
}

src/main/java/org/opentripplanner/model/plan/UnknownTransitPathLeg.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,7 @@ public int getGeneralizedCost() {
8585

8686
@Override
8787
public void setFareProducts(List<FareProductUse> products) {
88-
throw new UnsupportedOperationException(
89-
"Setting the fare products on a leg of type %s is unsupported.".formatted(
90-
this.getClass().getSimpleName()
91-
)
92-
);
88+
throw new UnsupportedOperationException();
9389
}
9490

9591
@Override

0 commit comments

Comments
 (0)