Skip to content

Commit 117b4c2

Browse files
Validate filter factor value
1 parent 99e52be commit 117b4c2

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/filters/transit/group/RemoveOtherThanSameLegsMaxGeneralizedCost.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ public class RemoveOtherThanSameLegsMaxGeneralizedCost implements RemoveItinerar
2626
private final double maxCostOtherLegsFactor;
2727

2828
public RemoveOtherThanSameLegsMaxGeneralizedCost(double maxCostOtherLegsFactor) {
29+
if (maxCostOtherLegsFactor < 1.0) {
30+
throw new IllegalArgumentException("maxCostOtherLegsFactor must be >= 1.0");
31+
}
2932
this.maxCostOtherLegsFactor = maxCostOtherLegsFactor;
3033
}
3134

0 commit comments

Comments
 (0)