Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enturno] Remove org.apache.commons #14406

Merged
merged 14 commits into from
Oct 27, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import java.util.concurrent.TimeoutException;
import java.util.stream.Collectors;

import org.apache.commons.lang3.StringUtils;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.jetty.client.HttpClient;
Expand Down Expand Up @@ -189,10 +188,8 @@ private String getRequestBody(Map<String, String> params) throws IOException {
}

private List<DisplayData> processData(StopPlace stopPlace, String lineCode) {
Map<String, List<EstimatedCalls>> departures = stopPlace.estimatedCalls.stream()
.filter(call -> StringUtils.equalsIgnoreCase(
StringUtils.trimToEmpty(call.serviceJourney.journeyPattern.line.publicCode),
StringUtils.trimToEmpty(lineCode)))
Map<String, List<EstimatedCalls>> departures = stopPlace.estimatedCalls.stream().filter(
call -> call.serviceJourney.journeyPattern.line.publicCode.strip().equalsIgnoreCase(lineCode.strip()))
.collect(groupingBy(call -> call.quay.id));

List<DisplayData> processedData = new ArrayList<>();
Expand Down Expand Up @@ -235,11 +232,10 @@ private DisplayData getDisplayData(StopPlace stopPlace, Map<String, List<Estimat
}

private String getIsoDateTime(String dateTimeWithoutColonInZone) {
String dateTime = StringUtils.substringBeforeLast(dateTimeWithoutColonInZone, "+");
String offset = StringUtils.substringAfterLast(dateTimeWithoutColonInZone, "+");
String dateTime = dateTimeWithoutColonInZone.substring(0, dateTimeWithoutColonInZone.lastIndexOf("+"));
lsiepel marked this conversation as resolved.
Show resolved Hide resolved
String offset = dateTimeWithoutColonInZone.substring(dateTimeWithoutColonInZone.lastIndexOf("+") + 1);

StringBuilder builder = new StringBuilder();
return builder.append(dateTime).append("+").append(StringUtils.substring(offset, 0, 2)).append(":00")
.toString();
return builder.append(dateTime).append("+").append(offset.substring(0, 2)).append(":00").toString();
}
}