Cleanup: use stream.toList().

This commit is contained in:
Dennis Guse
2023-10-01 20:10:50 +02:00
parent 2e76458b62
commit 8c8a7d9496
10 changed files with 15 additions and 23 deletions
@@ -724,7 +724,7 @@ public class PreferencesUtils {
R.array.stats_custom_layout_fields_default_value_16,
R.array.stats_custom_layout_fields_default_value_17,
R.array.stats_custom_layout_fields_default_value_18
).map(id -> resources.obtainTypedArray(id)).collect(Collectors.toList());
).map(id -> resources.obtainTypedArray(id)).toList();
}
@SuppressLint("ResourceType")
@@ -799,7 +799,7 @@ public class PreferencesUtils {
}
public static List<String> getAllCustomLayoutNames() {
return getAllCustomLayouts().stream().map(RecordingLayout::getName).collect(Collectors.toList());
return getAllCustomLayouts().stream().map(RecordingLayout::getName).toList();
}
public static void resetCustomLayoutPreferences() {
@@ -23,7 +23,6 @@ import androidx.vectordrawable.graphics.drawable.AnimatedVectorDrawableCompat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import de.dennisguse.opentracks.R;
import de.dennisguse.opentracks.sensors.BluetoothUtils;
@@ -136,7 +135,7 @@ public abstract class BluetoothLeSensorPreference extends DialogPreference {
b.putParcelableArrayList(ARG_BLE_SERVICE_UUIDS, new ArrayList<>(sensorUUIDs.stream()
.map(ServiceMeasurementUUID::serviceUUID)
.map(ParcelUuid::new)
.collect(Collectors.toList())));
.toList()));
fragment.setArguments(b);
return fragment;
}
@@ -202,7 +201,7 @@ public abstract class BluetoothLeSensorPreference extends DialogPreference {
if (PreferencesUtils.getBluetoothFilterEnabled()) {
scanFilter = serviceUUIDs.stream()
.map(it -> new ScanFilter.Builder().setServiceUuid(it).build())
.collect(Collectors.toList());
.toList();
}
ScanSettings.Builder scanSettingsBuilder = new ScanSettings.Builder();