VrsProvider: Use generic type inference for constructing objects.

This commit is contained in:
Andreas Schildbach 2019-10-16 00:04:01 +02:00
parent 49f6572fe4
commit f5c475cf0b

View file

@ -460,11 +460,11 @@ public class VrsProvider extends AbstractNetworkProvider {
return new QueryDeparturesResult(header, QueryDeparturesResult.Status.INVALID_STATION);
}
for (int iStation = 0; iStation < timetable.length(); iStation++) {
final List<Departure> departures = new ArrayList<Departure>();
final List<Departure> departures = new ArrayList<>();
final JSONObject station = timetable.getJSONObject(iStation);
final Location location = parseLocationAndPosition(station.getJSONObject("stop")).location;
final JSONArray events = station.getJSONArray("events");
final List<LineDestination> lines = new ArrayList<LineDestination>();
final List<LineDestination> lines = new ArrayList<>();
// for all departures
for (int iEvent = 0; iEvent < events.length(); iEvent++) {
final JSONObject event = events.getJSONObject(iEvent);
@ -518,7 +518,7 @@ public class VrsProvider extends AbstractNetworkProvider {
}
private void queryLinesForStation(String stationId, List<LineDestination> lineDestinations) throws IOException {
Set<String> lineNumbersAlreadyKnown = new HashSet<String>();
Set<String> lineNumbersAlreadyKnown = new HashSet<>();
for (LineDestination lineDestionation : lineDestinations) {
lineNumbersAlreadyKnown.add(lineDestionation.line.label);
}