Skip to content

Commit dedcc04

Browse files
committed
Address GitHub Copilot comments
1 parent 3616b27 commit dedcc04

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/main/java/com/cta4j/alert/routestatus/RouteStatusApi.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ default List<RouteStatus> findByType(ServiceType type) {
6262
* @return a {@link List} of {@link RouteStatus}es associated with the bus route IDs, or an empty {@link List} if
6363
* no route statuses are found for the bus route IDs
6464
* @throws NullPointerException if {@code routeIds} is {@code null} or contains {@code null} elements
65+
* @throws IllegalArgumentException if any of the {@code routeIds} matches a train line code (e.g. {@code "Red"});
66+
* use {@link #findByLines(Collection)} instead
6567
* @throws Cta4jRouteStatusException if the API returns an error response or the response cannot be parsed
6668
*/
6769
List<RouteStatus> findByBusRouteIds(Collection<String> routeIds);
@@ -73,6 +75,8 @@ default List<RouteStatus> findByType(ServiceType type) {
7375
* @return a {@link List} of {@link RouteStatus}es associated with the bus route ID, or an empty {@link List} if
7476
* no route statuses are found for the bus route ID
7577
* @throws NullPointerException if {@code routeId} is {@code null}
78+
* @throws IllegalArgumentException if {@code routeId} matches a train line code (e.g. {@code "Red"}); use
79+
* {@link #findByLine(TrainLine)} instead
7680
* @throws Cta4jRouteStatusException if the API returns an error response or the response cannot be parsed
7781
*/
7882
default List<RouteStatus> findByBusRouteId(String routeId) {

src/main/java/com/cta4j/alert/routestatus/internal/impl/RouteStatusApiImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public final class RouteStatusApiImpl implements RouteStatusApi {
4040
private final AlertApiConfig config;
4141

4242
public RouteStatusApiImpl(AlertApiConfig config) {
43-
this.config = config;
43+
this.config = Objects.requireNonNull(config);
4444
}
4545

4646
@Override

0 commit comments

Comments
 (0)