Changeset 36248 in osm
- Timestamp:
- 2024-04-16T15:58:38+02:00 (7 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/FIT/src/main/java/org/openstreetmap/josm/plugins/fit/FitPlugin.java
r36158 r36248 11 11 import java.util.Arrays; 12 12 import java.util.Collections; 13 import java.util.HashMap; 13 14 import java.util.TreeMap; 14 15 import java.util.concurrent.TimeUnit; … … 55 56 @Override 56 57 public void importData(File file, ProgressMonitor progressMonitor) throws IOException { 58 final var fieldMap = new HashMap<Class<? extends Record>, RecordComponent[]>(1); 57 59 try (var inputStream = Files.newInputStream(file.toPath())) { 58 60 final var records = FitReader.read(inputStream, FitReaderOptions.TRY_TO_FINISH); … … 73 75 // Use a sorted map for consistency 74 76 final var map = new TreeMap<String, Object>(); 75 for (RecordComponent component : HeartRateCadenceDistanceSpeed.class76 .getRecordComponents()) {77 for (RecordComponent component : fieldMap.computeIfAbsent(HeartRateCadenceDistanceSpeed.class, 78 Class::getRecordComponents)) { 77 79 if (Arrays.asList("lat", "lon", "timestamp", "unknown").contains(component.getName())) { 78 80 continue; // skip information that has specific fields
Note:
See TracChangeset
for help on using the changeset viewer.