-
Subject: [PATCH] General
---
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTask.java b/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTask.java
a
|
b
|
|
130 | 130 | } else if (o instanceof Exception) { |
131 | 131 | return ExceptionUtil.explainException((Exception) o).replace("<html>", "").replace("</html>", ""); |
132 | 132 | } else { |
133 | | return (String) null; |
| 133 | return null; |
134 | 134 | } |
135 | 135 | }).filter(Objects::nonNull).collect(Collectors.toList()); |
136 | 136 | } |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java b/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java
a
|
b
|
|
291 | 291 | |
292 | 292 | final String url = wms.buildGetMapUrl( |
293 | 293 | selection.layers.stream().map(LayerDetails::getName).collect(Collectors.toList()), |
294 | | (List<String>) null, |
| 294 | null, |
295 | 295 | selection.format, |
296 | 296 | selection.transparent |
297 | 297 | ); |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/data/osm/visitor/paint/MapRendererFactory.java b/src/org/openstreetmap/josm/data/osm/visitor/paint/MapRendererFactory.java
a
|
b
|
|
292 | 292 | public AbstractMapRenderer createActiveRenderer(Graphics2D g, NavigatableComponent viewport, boolean isInactiveMode) { |
293 | 293 | try { |
294 | 294 | Constructor<?> c = activeRenderer.getConstructor(Graphics2D.class, NavigatableComponent.class, boolean.class); |
295 | | return AbstractMapRenderer.class.cast(c.newInstance(g, viewport, isInactiveMode)); |
| 295 | return (AbstractMapRenderer) c.newInstance(g, viewport, isInactiveMode); |
296 | 296 | } catch (ReflectiveOperationException | IllegalArgumentException e) { |
297 | 297 | throw new MapRendererFactoryException(e); |
298 | 298 | } |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/data/ImageData.java b/src/org/openstreetmap/josm/data/ImageData.java
a
|
b
|
|
247 | 247 | */ |
248 | 248 | public void removeImageToSelection(ImageEntry image) { |
249 | 249 | int index = data.indexOf(image); |
250 | | selectedImagesIndex.remove(selectedImagesIndex.indexOf(index)); |
| 250 | selectedImagesIndex.remove((Integer) index); |
251 | 251 | if (selectedImagesIndex.isEmpty()) { |
252 | 252 | selectedImagesIndex.add(-1); |
253 | 253 | } |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java b/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
a
|
b
|
|
417 | 417 | this.data.mergeFrom(l.getImageData()); |
418 | 418 | |
419 | 419 | setName(l.getName()); |
420 | | thumbsLoaded &= l.thumbsLoaded; |
| 420 | synchronized (l) { |
| 421 | thumbsLoaded &= l.thumbsLoaded; |
| 422 | } |
421 | 423 | } |
422 | 424 | |
423 | 425 | private static Dimension scaledDimension(Image thumb) { |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/layer/AutosaveTask.java b/src/org/openstreetmap/josm/gui/layer/AutosaveTask.java
a
|
b
|
|
394 | 394 | public List<File> getUnsavedLayersFiles() { |
395 | 395 | List<File> result = new ArrayList<>(); |
396 | 396 | try { |
397 | | File[] files = autosaveDir.listFiles((FileFilter) |
| 397 | File[] files = autosaveDir.listFiles( |
398 | 398 | pathname -> OsmImporter.FILE_FILTER.accept(pathname) || NoteImporter.FILE_FILTER.accept(pathname)); |
399 | 399 | if (files == null) |
400 | 400 | return result; |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionFactory.java b/src/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionFactory.java
a
|
b
|
|
829 | 829 | * @return {@code true} if the object is an unclosed multipolygon |
830 | 830 | */ |
831 | 831 | static boolean unclosed_multipolygon(Environment e) { |
832 | | return e.osm instanceof Relation && ((Relation) e.osm).isMultipolygon() && |
| 832 | return e.osm instanceof Relation && e.osm.isMultipolygon() && |
833 | 833 | !e.osm.isIncomplete() && !((Relation) e.osm).hasIncompleteMembers() && |
834 | 834 | !MultipolygonCache.getInstance().get((Relation) e.osm).getOpenEnds().isEmpty(); |
835 | 835 | } |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java b/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
a
|
b
|
|
453 | 453 | public Object evaluate(final Environment env) { |
454 | 454 | List<?> l = Cascade.convertTo(args.get(0).evaluate(env), List.class); |
455 | 455 | if (args.size() != 1 || l == null) |
456 | | l = Utils.transform(args, (Function<Expression, Object>) x -> x.evaluate(env)); |
| 456 | l = Utils.transform(args, x -> x.evaluate(env)); |
457 | 457 | return aggregateList(l); |
458 | 458 | } |
459 | 459 | } |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java b/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java
a
|
b
|
|
155 | 155 | if (wms != null && wms.buildRootUrl() != null) { |
156 | 156 | wmsUrl.setText(wms.buildGetMapUrl( |
157 | 157 | tree.getSelectedLayers().stream().map(LayerDetails::getName).collect(Collectors.toList()), |
158 | | (List<String>) null, |
| 158 | null, |
159 | 159 | (String) formats.getSelectedItem(), |
160 | 160 | true // TODO: ask user about transparency |
161 | 161 | ) |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/preferences/projection/GaussKruegerProjectionChoice.java b/src/org/openstreetmap/josm/gui/preferences/projection/GaussKruegerProjectionChoice.java
a
|
b
|
|
26 | 26 | |
27 | 27 | @Override |
28 | 28 | public String getCurrentCode() { |
29 | | return "EPSG:"+Integer.toString(31466 + index); |
| 29 | return "EPSG:"+ (31466 + index); |
30 | 30 | } |
31 | 31 | |
32 | 32 | @Override |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/preferences/projection/LambertCC9ZonesProjectionChoice.java b/src/org/openstreetmap/josm/gui/preferences/projection/LambertCC9ZonesProjectionChoice.java
a
|
b
|
|
56 | 56 | |
57 | 57 | @Override |
58 | 58 | public String getCurrentCode() { |
59 | | return "EPSG:" + Integer.toString(3942+index); //CC42 is EPSG:3942 (up to EPSG:3950 for CC50) |
| 59 | return "EPSG:" + (3942 + index); //CC42 is EPSG:3942 (up to EPSG:3950 for CC50) |
60 | 60 | } |
61 | 61 | |
62 | 62 | @Override |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/preferences/projection/LambertProjectionChoice.java b/src/org/openstreetmap/josm/gui/preferences/projection/LambertProjectionChoice.java
a
|
b
|
|
51 | 51 | |
52 | 52 | @Override |
53 | 53 | public String getCurrentCode() { |
54 | | return "EPSG:" + Integer.toString(27561+index); |
| 54 | return "EPSG:" + (27561 + index); |
55 | 55 | } |
56 | 56 | |
57 | 57 | @Override |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManager.java b/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManager.java
a
|
b
|
|
14 | 14 | import java.util.Map.Entry; |
15 | 15 | import java.util.Objects; |
16 | 16 | import java.util.Set; |
17 | | import java.util.function.Function; |
18 | 17 | import java.util.stream.Collectors; |
19 | 18 | |
20 | 19 | import org.openstreetmap.josm.data.osm.DataSet; |
… |
… |
|
41 | 40 | import org.openstreetmap.josm.gui.layer.OsmDataLayer; |
42 | 41 | import org.openstreetmap.josm.gui.tagging.presets.TaggingPreset; |
43 | 42 | import org.openstreetmap.josm.gui.tagging.presets.TaggingPresets; |
44 | | import org.openstreetmap.josm.gui.tagging.presets.items.Roles.Role; |
45 | 43 | import org.openstreetmap.josm.tools.CheckParameterUtil; |
46 | 44 | import org.openstreetmap.josm.tools.MultiMap; |
47 | 45 | import org.openstreetmap.josm.tools.Utils; |
… |
… |
|
293 | 291 | if (r != null && !Utils.isEmpty(presets)) { |
294 | 292 | for (TaggingPreset tp : presets) { |
295 | 293 | if (tp.roles != null) { |
296 | | list.add(Utils.transform(tp.roles.roles, (Function<Role, String>) x -> x.key), AutoCompletionPriority.IS_IN_STANDARD); |
| 294 | list.add(Utils.transform(tp.roles.roles, x -> x.key), AutoCompletionPriority.IS_IN_STANDARD); |
297 | 295 | } |
298 | 296 | } |
299 | 297 | list.add(r.getMemberRoles(), AutoCompletionPriority.IS_IN_DATASET); |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/tagging/presets/items/Text.java b/src/org/openstreetmap/josm/gui/tagging/presets/items/Text.java
a
|
b
|
|
78 | 78 | List<String> keys = new ArrayList<>(); |
79 | 79 | keys.add(key); |
80 | 80 | if (alternative_autocomplete_keys != null) { |
81 | | for (String k : alternative_autocomplete_keys.split(",", -1)) { |
82 | | keys.add(k); |
83 | | } |
| 81 | Collections.addAll(keys, alternative_autocomplete_keys.split(",", -1)); |
84 | 82 | } |
85 | 83 | getAllForKeys(keys).forEach(model::addElement); |
86 | 84 | |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/tools/HiDPISupport.java b/src/org/openstreetmap/josm/tools/HiDPISupport.java
a
|
b
|
|
223 | 223 | return processor.apply(imgs); |
224 | 224 | } |
225 | 225 | List<List<Image>> allVars = imgs.stream().map(HiDPISupport::getResolutionVariants).collect(Collectors.toList()); |
226 | | int maxVariants = allVars.stream().mapToInt(List<Image>::size).max().getAsInt(); |
| 226 | int maxVariants = allVars.stream().mapToInt(List::size).max().getAsInt(); |
227 | 227 | if (maxVariants == 1) |
228 | 228 | return processor.apply(imgs); |
229 | 229 | List<Image> imgsProcessed = IntStream.range(0, maxVariants) |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/tools/Territories.java b/src/org/openstreetmap/josm/tools/Territories.java
a
|
b
|
|
199 | 199 | if (event == Event.START_OBJECT) { |
200 | 200 | for (JsonValue feature : json.getObject().getJsonArray("features")) { |
201 | 201 | ofNullable(feature.asJsonObject().getJsonObject("properties")).ifPresent(props -> |
202 | | ofNullable(props.getJsonObject("urls")).ifPresent(urls -> |
203 | | ofNullable(urls.getString(TAGINFO)).ifPresent(taginfo -> { |
| 202 | ofNullable(props.getJsonObject("urls")).flatMap(urls -> |
| 203 | ofNullable(urls.getString(TAGINFO))).ifPresent(taginfo -> { |
204 | 204 | JsonArray iso1 = props.getJsonArray(ISO3166_1_LC); |
205 | 205 | JsonArray iso2 = props.getJsonArray(ISO3166_2_LC); |
206 | 206 | if (iso1 != null) { |
… |
… |
|
208 | 208 | } else if (iso2 != null) { |
209 | 209 | readExternalTaginfo(taginfoGeofabrikCache, taginfo, iso2, source); |
210 | 210 | } |
211 | | }))); |
| 211 | })); |
212 | 212 | } |
213 | 213 | } |
214 | 214 | } |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/test/unit/org/openstreetmap/josm/testutils/mockers/ExtendedDialogMocker.java b/test/unit/org/openstreetmap/josm/testutils/mockers/ExtendedDialogMocker.java
a
|
b
|
|
12 | 12 | import java.util.Optional; |
13 | 13 | import java.util.WeakHashMap; |
14 | 14 | |
| 15 | import mockit.Invocation; |
| 16 | import mockit.Mock; |
15 | 17 | import org.junit.platform.commons.util.ReflectionUtils; |
16 | 18 | import org.openstreetmap.josm.TestUtils; |
17 | 19 | import org.openstreetmap.josm.gui.ExtendedDialog; |
18 | 20 | import org.openstreetmap.josm.tools.Logging; |
19 | 21 | |
20 | | import mockit.Invocation; |
21 | | import mockit.Mock; |
22 | | |
23 | 22 | /** |
24 | 23 | * MockUp for {@link ExtendedDialog} allowing a test to pre-seed uses of {@link ExtendedDialog} |
25 | 24 | * with mock "responses". This works best with {@link ExtendedDialog}s which have their contents set |
… |
… |
|
214 | 213 | final ExtendedDialog retval = invocation.proceed(message); |
215 | 214 | // must set this *after* the regular invocation else that will fall through to |
216 | 215 | // setContent(Component, boolean) which would overwrite it (with null) |
217 | | this.simpleStringContentMemo.put((ExtendedDialog) invocation.getInvokedInstance(), message); |
| 216 | this.simpleStringContentMemo.put(invocation.getInvokedInstance(), message); |
218 | 217 | return retval; |
219 | 218 | } |
220 | 219 | |
221 | 220 | @Mock |
222 | 221 | private ExtendedDialog setContent(final Invocation invocation, final Component content, final boolean placeContentInScrollPane) { |
223 | | this.simpleStringContentMemo.put((ExtendedDialog) invocation.getInvokedInstance(), null); |
| 222 | this.simpleStringContentMemo.put(invocation.getInvokedInstance(), null); |
224 | 223 | return invocation.proceed(content, placeContentInScrollPane); |
225 | 224 | } |
226 | 225 | } |