-
Subject: [PATCH] Minor fixes
---
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/actions/corrector/ReverseWayTagCorrector.java b/src/org/openstreetmap/josm/actions/corrector/ReverseWayTagCorrector.java
|
a
|
b
|
|
| 98 | 98 | String leftRight = m.group(2).toLowerCase(Locale.ENGLISH); |
| 99 | 99 | |
| 100 | 100 | StringBuilder result = new StringBuilder(); |
| 101 | | result.append(text.substring(0, m.start(2))) |
| | 101 | result.append(text, 0, m.start(2)) |
| 102 | 102 | .append(leftRight.equals(a) ? b : a) |
| 103 | 103 | .append(text.substring(m.end(2))); |
| 104 | 104 | |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java b/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
|
a
|
b
|
|
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | 143 | text.format("Locale info: %s%n", Locale.getDefault().toString()); |
| 144 | | text.format("Numbers with default locale: %s -> %d%n", Integer.toString(1_234_567_890), 1_234_567_890); |
| | 144 | text.format("Numbers with default locale: %s -> %d%n", 1_234_567_890, 1_234_567_890); |
| 145 | 145 | |
| 146 | 146 | if (PlatformManager.isPlatformUnixoid()) { |
| 147 | 147 | PlatformHookUnixoid platform = (PlatformHookUnixoid) PlatformManager.getPlatform(); |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/actions/UnJoinNodeWayAction.java b/src/org/openstreetmap/josm/actions/UnJoinNodeWayAction.java
|
a
|
b
|
|
| 156 | 156 | // Remove broken ways |
| 157 | 157 | result.removeIf(way -> way.getNodesCount() <= 2); |
| 158 | 158 | |
| 159 | | if (selectedWays.isEmpty()) |
| 160 | | return result; |
| 161 | | else { |
| 162 | | // Return only selected ways |
| | 159 | // Remove selected ways |
| | 160 | if (!selectedWays.isEmpty()) { |
| 163 | 161 | result.removeIf(way -> !selectedWays.contains(way)); |
| 164 | | return result; |
| 165 | | } |
| | 162 | } |
| | 163 | return result; |
| 166 | 164 | } |
| 167 | 165 | |
| 168 | 166 | @Override |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/command/AddPrimitivesCommand.java b/src/org/openstreetmap/josm/command/AddPrimitivesCommand.java
|
a
|
b
|
|
| 102 | 102 | if (preExistingData.stream().anyMatch(pd -> pd.getPrimitiveId().equals(osm.getPrimitiveId()))) { |
| 103 | 103 | Optional<PrimitiveData> o = data.stream() |
| 104 | 104 | .filter(pd -> pd.getPrimitiveId().equals(osm.getPrimitiveId())).findAny(); |
| 105 | | if (o.isPresent()) { |
| 106 | | osm.load(o.get()); |
| 107 | | } |
| | 105 | o.ifPresent(osm::load); |
| 108 | 106 | } else { |
| 109 | 107 | ds.addPrimitive(osm); |
| 110 | 108 | } |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java b/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java
|
a
|
b
|
|
| 110 | 110 | |
| 111 | 111 | try { |
| 112 | 112 | if (!cacheDir.exists() && !cacheDir.mkdirs()) { |
| 113 | | Logging.warn("Cache directory " + cacheDir.toString() + " does not exists and could not create it"); |
| | 113 | Logging.warn("Cache directory " + cacheDir + " does not exists and could not create it"); |
| 114 | 114 | } else { |
| 115 | 115 | File cacheDirLockPath = new File(cacheDir, ".lock"); |
| 116 | 116 | try { |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/Layers.java b/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/Layers.java
|
a
|
b
|
|
| 478 | 478 | } else { |
| 479 | 479 | zoomSelector = EMPTY_STRING; |
| 480 | 480 | } |
| 481 | | final String commonData = zoomSelector + this.filter.toString() + "::" + this.id + "{" + this.paintProperties + "}"; |
| | 481 | final String commonData = zoomSelector + this.filter + "::" + this.id + "{" + this.paintProperties + "}"; |
| 482 | 482 | |
| 483 | 483 | if (this.type == Type.CIRCLE || this.type == Type.SYMBOL) { |
| 484 | 484 | return "node" + commonData; |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/data/osm/DefaultNameFormatter.java b/src/org/openstreetmap/josm/data/osm/DefaultNameFormatter.java
|
a
|
b
|
|
| 618 | 618 | } |
| 619 | 619 | } |
| 620 | 620 | if (nameTag == null) { |
| 621 | | sb.append(Long.toString(relation.getId())).append(", "); |
| | 621 | sb.append(relation.getId()).append(", "); |
| 622 | 622 | } else { |
| 623 | 623 | sb.append('\"').append(nameTag).append("\", "); |
| 624 | 624 | } |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/data/osm/Node.java b/src/org/openstreetmap/josm/data/osm/Node.java
|
a
|
b
|
|
| 202 | 202 | void setDataset(DataSet dataSet) { |
| 203 | 203 | super.setDataset(dataSet); |
| 204 | 204 | if (!isIncomplete() && isVisible() && !isLatLonKnown()) |
| 205 | | throw new DataIntegrityProblemException("Complete node with null coordinates: " + toString()); |
| | 205 | throw new DataIntegrityProblemException("Complete node with null coordinates: " + this); |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | @Override |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/data/osm/OsmDataManager.java b/src/org/openstreetmap/josm/data/osm/OsmDataManager.java
|
a
|
b
|
|
| 70 | 70 | public void setActiveDataSet(DataSet ds) { |
| 71 | 71 | Optional<OsmDataLayer> layer = MainApplication.getLayerManager().getLayersOfType(OsmDataLayer.class).stream() |
| 72 | 72 | .filter(l -> l.data.equals(ds)).findFirst(); |
| 73 | | if (layer.isPresent()) { |
| 74 | | MainApplication.getLayerManager().setActiveLayer(layer.get()); |
| 75 | | } |
| | 73 | layer.ifPresent(osmDataLayer -> MainApplication.getLayerManager().setActiveLayer(osmDataLayer)); |
| 76 | 74 | } |
| 77 | 75 | |
| 78 | 76 | @Override |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java b/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
|
a
|
b
|
|
| 195 | 195 | */ |
| 196 | 196 | public void checkDataset() { |
| 197 | 197 | if (dataSet == null) |
| 198 | | throw new DataIntegrityProblemException("Primitive must be part of the dataset: " + toString()); |
| | 198 | throw new DataIntegrityProblemException("Primitive must be part of the dataset: " + this); |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | /** |
| … |
… |
|
| 203 | 203 | */ |
| 204 | 204 | protected final void checkDatasetNotReadOnly() { |
| 205 | 205 | if (dataSet != null && dataSet.isLocked()) |
| 206 | | throw new DataIntegrityProblemException("Primitive cannot be modified in read-only dataset: " + toString()); |
| | 206 | throw new DataIntegrityProblemException("Primitive cannot be modified in read-only dataset: " + this); |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | protected boolean writeLock() { |
| … |
… |
|
| 991 | 991 | } |
| 992 | 992 | |
| 993 | 993 | /** |
| 994 | | * Equal, if the id (and class) is equal. |
| 995 | | * |
| 996 | | * An primitive is equal to its incomplete counter part. |
| | 994 | * Equal if the id (and class) are equal. |
| | 995 | * <p> |
| | 996 | * A primitive is equal to its incomplete counterpart. |
| 997 | 997 | */ |
| 998 | 998 | @Override |
| 999 | 999 | public boolean equals(Object obj) { |
| … |
… |
|
| 1009 | 1009 | |
| 1010 | 1010 | /** |
| 1011 | 1011 | * Return the id plus the class type encoded as hashcode or super's hashcode if id is 0. |
| 1012 | | * |
| 1013 | | * An primitive has the same hashcode as its incomplete counterpart. |
| | 1012 | * <p> |
| | 1013 | * A primitive has the same hashcode as its incomplete counterpart. |
| 1014 | 1014 | */ |
| 1015 | 1015 | @Override |
| 1016 | 1016 | public int hashCode() { |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/data/osm/Relation.java b/src/org/openstreetmap/josm/data/osm/Relation.java
|
a
|
b
|
|
| 443 | 443 | } |
| 444 | 444 | |
| 445 | 445 | BBox box = new BBox(); |
| 446 | | addToBBox(box, new HashSet<PrimitiveId>()); |
| | 446 | addToBBox(box, new HashSet<>()); |
| 447 | 447 | if (getDataSet() == null) { |
| 448 | 448 | return box; |
| 449 | 449 | } |
| … |
… |
|
| 493 | 493 | if (Config.getPref().getBoolean("debug.checkDeleteReferenced", true)) { |
| 494 | 494 | for (RelationMember rm: members) { |
| 495 | 495 | if (rm.getMember().isDeleted()) |
| 496 | | throw new DataIntegrityProblemException("Deleted member referenced: " + toString(), null, this, rm.getMember()); |
| | 496 | throw new DataIntegrityProblemException("Deleted member referenced: " + this, null, this, rm.getMember()); |
| 497 | 497 | } |
| 498 | 498 | } |
| 499 | 499 | } |
| … |
… |
|
| 524 | 524 | @Override |
| 525 | 525 | public Collection<OsmPrimitive> getIncompleteMembers() { |
| 526 | 526 | return Arrays.stream(members) |
| 527 | | .filter(rm -> rm.getMember().isIncomplete()) |
| 528 | 527 | .map(RelationMember::getMember) |
| | 528 | .filter(AbstractPrimitive::isIncomplete) |
| 529 | 529 | .collect(Collectors.toSet()); |
| 530 | 530 | } |
| 531 | 531 | |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/data/osm/Way.java b/src/org/openstreetmap/josm/data/osm/Way.java
|
a
|
b
|
|
| 551 | 551 | throw new DataIntegrityProblemException("Nodes in way must be in the same dataset", |
| 552 | 552 | tr("Nodes in way must be in the same dataset")); |
| 553 | 553 | if (n.isDeleted()) |
| 554 | | throw new DataIntegrityProblemException("Deleted node referenced: " + toString(), |
| | 554 | throw new DataIntegrityProblemException("Deleted node referenced: " + this, |
| 555 | 555 | "<html>" + tr("Deleted node referenced by {0}", |
| 556 | 556 | DefaultNameFormatter.getInstance().formatAsHtmlUnorderedList(this)) + "</html>", |
| 557 | 557 | this, n); |
| … |
… |
|
| 559 | 559 | if (Config.getPref().getBoolean("debug.checkNullCoor", true)) { |
| 560 | 560 | for (Node n: nodes) { |
| 561 | 561 | if (n.isVisible() && !n.isIncomplete() && !n.isLatLonKnown()) |
| 562 | | throw new DataIntegrityProblemException("Complete visible node with null coordinates: " + toString(), |
| | 562 | throw new DataIntegrityProblemException("Complete visible node with null coordinates: " + this, |
| 563 | 563 | "<html>" + tr("Complete node {0} with null coordinates in way {1}", |
| 564 | 564 | DefaultNameFormatter.getInstance().formatAsHtmlUnorderedList(n), |
| 565 | 565 | DefaultNameFormatter.getInstance().formatAsHtmlUnorderedList(this)) + "</html>", |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/data/projection/ProjectionCLI.java b/src/org/openstreetmap/josm/data/projection/ProjectionCLI.java
|
a
|
b
|
|
| 154 | 154 | EastNorth enOut = toProj.latlon2eastNorth(ll); |
| 155 | 155 | double cOut1 = argSwitchOutput ? enOut.north() : enOut.east(); |
| 156 | 156 | double cOut2 = argSwitchOutput ? enOut.east() : enOut.north(); |
| 157 | | System.out.println(Double.toString(cOut1) + " " + Double.toString(cOut2)); |
| | 157 | System.out.println(cOut1 + " " + cOut2); |
| 158 | 158 | System.out.flush(); |
| 159 | 159 | } |
| 160 | 160 | } |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/data/validation/tests/Lanes.java b/src/org/openstreetmap/josm/data/validation/tests/Lanes.java
|
a
|
b
|
|
| 63 | 63 | .primitives(p) |
| 64 | 64 | .build()); |
| 65 | 65 | } |
| 66 | | } catch (NumberFormatException ignore) { |
| 67 | | Logging.debug(ignore.getMessage()); |
| | 66 | } catch (NumberFormatException e) { |
| | 67 | Logging.debug(e.getMessage()); |
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | } |
| … |
… |
|
| 75 | 75 | final String forward = Utils.firstNonNull(p.get("lanes:forward"), "0"); |
| 76 | 76 | final String backward = Utils.firstNonNull(p.get("lanes:backward"), "0"); |
| 77 | 77 | try { |
| 78 | | if (Integer.parseInt(lanes) < Integer.parseInt(forward) + Integer.parseInt(backward)) { |
| 79 | | errors.add(TestError.builder(this, Severity.WARNING, 3101) |
| 80 | | .message(tr("Number of {0} greater than {1}", tr("{0}+{1}", "lanes:forward", "lanes:backward"), "lanes")) |
| 81 | | .primitives(p) |
| 82 | | .build()); |
| 83 | | } |
| 84 | | } catch (NumberFormatException ignore) { |
| 85 | | Logging.debug(ignore.getMessage()); |
| | 78 | if (Integer.parseInt(lanes) < Integer.parseInt(forward) + Integer.parseInt(backward)) { |
| | 79 | errors.add(TestError.builder(this, Severity.WARNING, 3101) |
| | 80 | .message(tr("Number of {0} greater than {1}", tr("{0}+{1}", "lanes:forward", "lanes:backward"), "lanes")) |
| | 81 | .primitives(p) |
| | 82 | .build()); |
| | 83 | } |
| | 84 | } catch (NumberFormatException e) { |
| | 85 | Logging.debug(e.getMessage()); |
| 86 | 86 | } |
| 87 | 87 | } |
| 88 | 88 | |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java b/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
|
a
|
b
|
|
| 444 | 444 | cnt++; |
| 445 | 445 | // add frequently changing info to progress monitor so that it |
| 446 | 446 | // doesn't seem to hang when test takes longer than 0.5 seconds |
| 447 | | if (cnt % 10000 == 0 && stopwatch.elapsed() >= 500) { |
| | 447 | if (cnt % 10_000 == 0 && stopwatch.elapsed() >= 500) { |
| 448 | 448 | progressMonitor.setExtraText(tr(" {0}: {1} of {2} elements done", title, cnt, selection.size())); |
| 449 | 449 | } |
| 450 | 450 | } |
| … |
… |
|
| 487 | 487 | addIfNotSimilar(e, errors); |
| 488 | 488 | } |
| 489 | 489 | } |
| 490 | | |
| 491 | 490 | } |
| 492 | | |
| 493 | 491 | } |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/data/validation/ValidationTask.java b/src/org/openstreetmap/josm/data/validation/ValidationTask.java
|
a
|
b
|
|
| 36 | 36 | * |
| 37 | 37 | * @param tests the tests to run |
| 38 | 38 | * @param validatedPrimitives the collection of primitives to validate. |
| 39 | | * @param formerValidatedPrimitives the last collection of primitives being validates. May be null. |
| | 39 | * @param formerValidatedPrimitives the last collection of primitives being validated. May be null. |
| 40 | 40 | */ |
| 41 | 41 | public ValidationTask(Collection<Test> tests, |
| 42 | 42 | Collection<OsmPrimitive> validatedPrimitives, |
| … |
… |
|
| 48 | 48 | Collection<Test> tests, |
| 49 | 49 | Collection<OsmPrimitive> validatedPrimitives, |
| 50 | 50 | Collection<OsmPrimitive> formerValidatedPrimitives) { |
| 51 | | super(tr("Validating"), progressMonitor, false /*don't ignore exceptions */); |
| | 51 | super(tr("Validating"), progressMonitor, false); |
| 52 | 52 | this.validatedPrimitives = validatedPrimitives; |
| 53 | 53 | this.formerValidatedPrimitives = formerValidatedPrimitives; |
| 54 | 54 | this.tests = tests; |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellEditor.java b/src/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellEditor.java
|
a
|
b
|
|
| 216 | 216 | */ |
| 217 | 217 | protected void renderValue(Object value) { |
| 218 | 218 | setFont(UIManager.getFont("ComboBox.font")); |
| 219 | | if (String.class.isInstance(value)) { |
| 220 | | setText(String.class.cast(value)); |
| 221 | | } else if (MultiValueDecisionType.class.isInstance(value)) { |
| 222 | | switch(MultiValueDecisionType.class.cast(value)) { |
| | 219 | if (value instanceof String) { |
| | 220 | setText((String) value); |
| | 221 | } else if (value instanceof MultiValueDecisionType) { |
| | 222 | switch((MultiValueDecisionType) value) { |
| 223 | 223 | case UNDECIDED: |
| 224 | 224 | setText(tr("Choose a value")); |
| 225 | 225 | setFont(UIManager.getFont("ComboBox.font").deriveFont(Font.ITALIC + Font.BOLD)); |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/correction/CorrectionTable.java b/src/org/openstreetmap/josm/gui/correction/CorrectionTable.java
|
a
|
b
|
|
| 38 | 38 | super(correctionTableModel); |
| 39 | 39 | |
| 40 | 40 | final int correctionsSize = correctionTableModel.getCorrections().size(); |
| 41 | | final int lines = correctionsSize > MAX_VISIBLE_LINES ? MAX_VISIBLE_LINES : correctionsSize; |
| | 41 | final int lines = Math.min(correctionsSize, MAX_VISIBLE_LINES); |
| 42 | 42 | setPreferredScrollableViewportSize(new Dimension(400, lines * getRowHeight())); |
| 43 | 43 | getColumnModel().getColumn(correctionTableModel.getApplyColumn()).setPreferredWidth(40); |
| 44 | 44 | setRowSelectionAllowed(false); |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UidInputFieldValidator.java b/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UidInputFieldValidator.java
|
a
|
b
|
|
| 65 | 65 | if (Utils.isBlank(value)) return 0; |
| 66 | 66 | try { |
| 67 | 67 | int uid = Integer.parseInt(value.trim()); |
| 68 | | if (uid > 0) |
| 69 | | return uid; |
| 70 | | return 0; |
| | 68 | return Math.max(uid, 0); |
| 71 | 69 | } catch (NumberFormatException e) { |
| 72 | 70 | return 0; |
| 73 | 71 | } |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetsInActiveDataLayerListModel.java b/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetsInActiveDataLayerListModel.java
|
a
|
b
|
|
| 81 | 81 | // just init the model content. Don't register as DataSetListener. The mode |
| 82 | 82 | // is already registered to receive DataChangedEvents from the current edit layer |
| 83 | 83 | DataSet ds = e.getSource().getActiveDataSet(); |
| 84 | | if (ds != null) { |
| 85 | | initFromDataSet(ds); |
| 86 | | } else { |
| 87 | | initFromDataSet(null); |
| 88 | | } |
| | 84 | initFromDataSet(ds); |
| 89 | 85 | } |
| 90 | 86 | } |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTable.java b/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTable.java
|
a
|
b
|
|
| 26 | 26 | import org.openstreetmap.josm.actions.AutoScaleAction.AutoScaleMode; |
| 27 | 27 | import org.openstreetmap.josm.actions.HistoryInfoAction; |
| 28 | 28 | import org.openstreetmap.josm.actions.ZoomToAction; |
| | 29 | import org.openstreetmap.josm.data.osm.AbstractPrimitive; |
| 29 | 30 | import org.openstreetmap.josm.data.osm.OsmPrimitive; |
| 30 | 31 | import org.openstreetmap.josm.data.osm.Relation; |
| 31 | 32 | import org.openstreetmap.josm.data.osm.RelationMember; |
| … |
… |
|
| 130 | 131 | if (MainApplication.isDisplayingMapView()) { |
| 131 | 132 | Collection<RelationMember> sel = getMemberTableModel().getSelectedMembers(); |
| 132 | 133 | final Set<OsmPrimitive> toHighlight = sel.stream() |
| 133 | | .filter(r -> r.getMember().isUsable()) |
| 134 | 134 | .map(RelationMember::getMember) |
| | 135 | .filter(AbstractPrimitive::isUsable) |
| 135 | 136 | .collect(Collectors.toSet()); |
| 136 | 137 | SwingUtilities.invokeLater(() -> { |
| 137 | 138 | if (MainApplication.isDisplayingMapView() && highlightHelper.highlightOnly(toHighlight)) { |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java b/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java
|
a
|
b
|
|
| 551 | 551 | public Set<OsmPrimitive> getChildPrimitives(Collection<? extends OsmPrimitive> referenceSet) { |
| 552 | 552 | if (referenceSet == null) return null; |
| 553 | 553 | return members.stream() |
| 554 | | .filter(m -> referenceSet.contains(m.getMember())) |
| 555 | 554 | .map(RelationMember::getMember) |
| | 555 | .filter(referenceSet::contains) |
| 556 | 556 | .collect(Collectors.toSet()); |
| 557 | 557 | } |
| 558 | 558 | |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java b/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java
|
a
|
b
|
|
| 128 | 128 | Set<String> tests = new HashSet<>(); |
| 129 | 129 | visitTestErrors(node, err -> tests.add(getTesterDetails(err)), null); |
| 130 | 130 | String source = (tests.size() == 1) ? tr("Test: {0}", tests.iterator().next()) : tr("Different tests"); |
| 131 | | res = node.toString() + "<br>" + source; |
| | 131 | res = node + "<br>" + source; |
| 132 | 132 | } |
| 133 | 133 | } |
| 134 | 134 | return res == null ? null : "<html>" + res + "</html>"; |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java b/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java
|
a
|
b
|
|
| 192 | 192 | tfLatLon.setText(CoordinateFormatManager.getDefaultFormat().latToString(llc) + ' ' + |
| 193 | 193 | CoordinateFormatManager.getDefaultFormat().lonToString(llc)); |
| 194 | 194 | EastNorth en = ProjectionRegistry.getProjection().latlon2eastNorth(llc); |
| 195 | | tfEastNorth.setText(Double.toString(en.east()) + ' ' + Double.toString(en.north())); |
| | 195 | tfEastNorth.setText(Double.toString(en.east()) + ' ' + en.north()); |
| 196 | 196 | // Both latLonCoordinates and eastNorthCoordinates may have been reset to null if ll is out of the world |
| 197 | 197 | latLonCoordinates = llc; |
| 198 | 198 | eastNorthCoordinates = en; |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java b/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java
|
a
|
b
|
|
| 143 | 143 | gc.fill = GridBagConstraints.BOTH; |
| 144 | 144 | gc.weightx = 1.0; |
| 145 | 145 | gc.weighty = 1.0; |
| 146 | | gc.gridx = 1; |
| 147 | 146 | dlg.add(new JScrollPane(bookmarks), gc); |
| 148 | 147 | |
| 149 | 148 | this.parent = gui; |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/history/HistoryBrowser.java b/src/org/openstreetmap/josm/gui/history/HistoryBrowser.java
|
a
|
b
|
|
| 5 | 5 | |
| 6 | 6 | import java.awt.BorderLayout; |
| 7 | 7 | import java.awt.Dimension; |
| 8 | | import java.util.Arrays; |
| | 8 | import java.util.stream.Stream; |
| 9 | 9 | |
| 10 | 10 | import javax.swing.JPanel; |
| 11 | 11 | import javax.swing.JScrollPane; |
| … |
… |
|
| 161 | 161 | model.unlinkAsListener(); |
| 162 | 162 | model = null; |
| 163 | 163 | } |
| 164 | | Arrays.asList(tagInfoViewer, nodeListViewer, relationMemberListViewer, coordinateInfoViewer).stream() |
| | 164 | Stream.of(tagInfoViewer, nodeListViewer, relationMemberListViewer, coordinateInfoViewer) |
| 165 | 165 | .filter(Destroyable.class::isInstance).forEach(Destroyable::destroy); |
| 166 | 166 | tagInfoViewer = null; |
| 167 | 167 | nodeListViewer = null; |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/io/importexport/GpxExporter.java b/src/org/openstreetmap/josm/gui/io/importexport/GpxExporter.java
|
a
|
b
|
|
| 78 | 78 | |
| 79 | 79 | @Override |
| 80 | 80 | public boolean acceptFile(File pathname, Layer layer) { |
| 81 | | return isSupportedLayer(layer) ? super.acceptFile(pathname, layer) : false; |
| | 81 | return isSupportedLayer(layer) && super.acceptFile(pathname, layer); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | @Override |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/io/importexport/GpxLikeImporter.java b/src/org/openstreetmap/josm/gui/io/importexport/GpxLikeImporter.java
|
a
|
b
|
|
| 74 | 74 | msg.append("</html>"); |
| 75 | 75 | if (success) { |
| 76 | 76 | SwingUtilities.invokeLater(() -> new Notification( |
| 77 | | "<h3>" + tr("Import success:") + "</h3>" + msg.toString()) |
| | 77 | "<h3>" + tr("Import success:") + "</h3>" + msg) |
| 78 | 78 | .setIcon(JOptionPane.INFORMATION_MESSAGE) |
| 79 | 79 | .show()); |
| 80 | 80 | } else { |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/io/ChangesetManagementPanel.java b/src/org/openstreetmap/josm/gui/io/ChangesetManagementPanel.java
|
a
|
b
|
|
| 53 | 53 | private JosmComboBox<Changeset> cbOpenChangesets; |
| 54 | 54 | private JosmComboBoxModel<Changeset> model; |
| 55 | 55 | private JCheckBox cbCloseAfterUpload; |
| 56 | | private JButton btnClose; |
| 57 | 56 | |
| 58 | 57 | /** |
| 59 | 58 | * Constructs a new {@code ChangesetManagementPanel}. |
| … |
… |
|
| 126 | 125 | |
| 127 | 126 | gc.gridx++; |
| 128 | 127 | CloseChangesetAction closeChangesetAction = new CloseChangesetAction(); |
| 129 | | btnClose = new JButton(closeChangesetAction); |
| | 128 | JButton btnClose = new JButton(closeChangesetAction); |
| 130 | 129 | btnClose.setPreferredSize(prefSize); |
| 131 | 130 | btnClose.setMinimumSize(prefSize); |
| 132 | 131 | add(btnClose, gc); |
| … |
… |
|
| 277 | 276 | @Override |
| 278 | 277 | public void changesetCacheUpdated(ChangesetCacheEvent event) { |
| 279 | 278 | // This listener might have been called by a background task. |
| 280 | | SwingUtilities.invokeLater(() -> refreshCombo()); |
| | 279 | SwingUtilities.invokeLater(this::refreshCombo); |
| 281 | 280 | } |
| 282 | 281 | } |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/io/CustomConfigurator.java b/src/org/openstreetmap/josm/gui/io/CustomConfigurator.java
|
a
|
b
|
|
| 130 | 130 | * @param unzip - if true file wil be unzipped and deleted after download |
| 131 | 131 | */ |
| 132 | 132 | public static void processDownloadOperation(String address, String path, String parentDir, boolean mkdir, boolean unzip) { |
| 133 | | String dir = parentDir; |
| 134 | 133 | if (path.contains("..") || path.startsWith("/") || path.contains(":")) { |
| 135 | 134 | return; // some basic protection |
| 136 | 135 | } |
| 137 | | File fOut = new File(dir, path); |
| | 136 | File fOut = new File(parentDir, path); |
| 138 | 137 | DownloadFileTask downloadFileTask = new DownloadFileTask(MainApplication.getMainFrame(), address, fOut, mkdir, unzip); |
| 139 | 138 | |
| 140 | 139 | MainApplication.worker.submit(downloadFileTask); |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/io/UploadDialogModel.java b/src/org/openstreetmap/josm/gui/io/UploadDialogModel.java
|
a
|
b
|
|
| 75 | 75 | * @return the hashtags separated by ";" or null |
| 76 | 76 | */ |
| 77 | 77 | String findHashTags(String comment) { |
| 78 | | String hashtags = String.join(";", |
| 79 | | Arrays.stream(comment.split("\\s", -1)) |
| 80 | | .map(s -> Utils.strip(s, ",;")) |
| 81 | | .filter(s -> s.matches("#[a-zA-Z0-9][-_a-zA-Z0-9]+")) |
| 82 | | .collect(Collectors.toList())); |
| | 78 | String hashtags = Arrays.stream(comment.split("\\s", -1)) |
| | 79 | .map(s -> Utils.strip(s, ",;")) |
| | 80 | .filter(s -> s.matches("#[a-zA-Z0-9][-_a-zA-Z0-9]+")) |
| | 81 | .collect(Collectors.joining(";")); |
| 83 | 82 | return hashtags.isEmpty() ? null : hashtags; |
| 84 | 83 | } |
| 85 | 84 | |
| … |
… |
|
| 155 | 154 | */ |
| 156 | 155 | public void putAll(Map<String, String> map) { |
| 157 | 156 | commitPendingEdit(); |
| 158 | | map.forEach((key, value) -> doPut(key, value)); |
| | 157 | map.forEach(this::doPut); |
| 159 | 158 | setDirty(true); |
| 160 | 159 | fireTableDataChanged(); |
| 161 | 160 | } |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java b/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java
|
a
|
b
|
|
| 9 | 9 | import java.net.URL; |
| 10 | 10 | import java.util.ArrayList; |
| 11 | 11 | import java.util.Arrays; |
| 12 | | import java.util.Collection; |
| 13 | 12 | import java.util.Comparator; |
| | 13 | import java.util.List; |
| 14 | 14 | import java.util.stream.Collectors; |
| 15 | 15 | |
| 16 | 16 | import javax.swing.AbstractAction; |
| … |
… |
|
| 125 | 125 | URL url = Utils.fileToURL(audioFile); |
| 126 | 126 | boolean hasTracks = !Utils.isEmpty(layer.data.tracks); |
| 127 | 127 | boolean hasWaypoints = !Utils.isEmpty(layer.data.waypoints); |
| 128 | | Collection<WayPoint> waypoints = new ArrayList<>(); |
| | 128 | List<WayPoint> waypoints = new ArrayList<>(); |
| 129 | 129 | boolean timedMarkersOmitted = false; |
| 130 | 130 | boolean untimedMarkersOmitted = false; |
| 131 | 131 | double snapDistance = Config.getPref().getDouble("marker.audiofromuntimedwaypoints.distance", 1.0e-3); |
| … |
… |
|
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | // we must have got at least one waypoint now |
| 275 | | ((ArrayList<WayPoint>) waypoints).sort(Comparator.naturalOrder()); |
| | 275 | waypoints.sort(Comparator.naturalOrder()); |
| 276 | 276 | |
| 277 | 277 | firstTime = -1.0; // this time of the first waypoint, not first trackpoint |
| 278 | 278 | for (WayPoint w : waypoints) { |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/layer/imagery/ColorfulFilter.java b/src/org/openstreetmap/josm/gui/layer/imagery/ColorfulFilter.java
|
a
|
b
|
|
| 212 | 212 | int val = (int) (colorfulness * color + (1 - colorfulness) * luminosity); |
| 213 | 213 | if (val < 0) { |
| 214 | 214 | return 0; |
| 215 | | } else if (val > 0xff) { |
| 216 | | return 0xff; |
| 217 | | } else { |
| 218 | | return val; |
| 219 | | } |
| | 215 | } else return Math.min(val, 0xff); |
| 220 | 216 | } |
| 221 | 217 | |
| 222 | 218 | private byte mix(int color, double luminosity) { |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java b/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
|
a
|
b
|
|
| 778 | 778 | private void zoomChanged(boolean invalidate) { |
| 779 | 779 | Logging.debug("zoomChanged(): {0}", currentZoomLevel); |
| 780 | 780 | if (tileLoader instanceof TMSCachedTileLoader) { |
| 781 | | ((TMSCachedTileLoader) tileLoader).cancelOutstandingTasks(); |
| | 781 | tileLoader.cancelOutstandingTasks(); |
| 782 | 782 | } |
| 783 | 783 | if (invalidate) { |
| 784 | 784 | invalidate(); |
| … |
… |
|
| 1148 | 1148 | StringBuilder line = new StringBuilder(); |
| 1149 | 1149 | StringBuilder ret = new StringBuilder(); |
| 1150 | 1150 | for (String s: text.split(" ", -1)) { |
| 1151 | | if (g.getFontMetrics().stringWidth(line.toString() + s) > tileSource.getTileSize()) { |
| | 1151 | if (g.getFontMetrics().stringWidth(line + s) > tileSource.getTileSize()) { |
| 1152 | 1152 | ret.append(line).append('\n'); |
| 1153 | 1153 | line.setLength(0); |
| 1154 | 1154 | } |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj b/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj
|
a
|
b
|
|
| 710 | 710 | Condition simple_key_condition(Context context) : |
| 711 | 711 | { |
| 712 | 712 | boolean not = false; |
| 713 | | KeyMatchType matchType = null;; |
| | 713 | KeyMatchType matchType = null; |
| 714 | 714 | String key; |
| 715 | 715 | } |
| 716 | 716 | { |
| … |
… |
|
| 731 | 731 | String val; |
| 732 | 732 | float f; |
| 733 | 733 | int i; |
| 734 | | KeyMatchType matchType = null;; |
| | 734 | KeyMatchType matchType = null; |
| 735 | 735 | Op op; |
| 736 | 736 | boolean considerValAsKey = false; |
| 737 | 737 | } |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java b/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java
|
a
|
b
|
|
| 19 | 19 | import java.util.regex.Matcher; |
| 20 | 20 | import java.util.regex.Pattern; |
| 21 | 21 | |
| | 22 | import oauth.signpost.OAuth; |
| | 23 | import oauth.signpost.OAuthConsumer; |
| | 24 | import oauth.signpost.OAuthProvider; |
| | 25 | import oauth.signpost.exception.OAuthException; |
| 22 | 26 | import org.openstreetmap.josm.data.oauth.OAuthParameters; |
| 23 | 27 | import org.openstreetmap.josm.data.oauth.OAuthToken; |
| 24 | 28 | import org.openstreetmap.josm.data.oauth.OsmPrivileges; |
| … |
… |
|
| 30 | 34 | import org.openstreetmap.josm.tools.Logging; |
| 31 | 35 | import org.openstreetmap.josm.tools.Utils; |
| 32 | 36 | |
| 33 | | import oauth.signpost.OAuth; |
| 34 | | import oauth.signpost.OAuthConsumer; |
| 35 | | import oauth.signpost.OAuthProvider; |
| 36 | | import oauth.signpost.exception.OAuthException; |
| 37 | | |
| 38 | 37 | /** |
| 39 | 38 | * An OAuth 1.0 authorization client. |
| 40 | 39 | * @since 2746 |
| … |
… |
|
| 198 | 197 | |
| 199 | 198 | for (String setCookie: setCookies) { |
| 200 | 199 | String[] kvPairs = setCookie.split(";", -1); |
| 201 | | if (kvPairs.length == 0) { |
| 202 | | continue; |
| 203 | | } |
| 204 | 200 | for (String kvPair : kvPairs) { |
| 205 | 201 | kvPair = kvPair.trim(); |
| 206 | 202 | String[] kv = kvPair.split("=", -1); |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/preferences/advanced/AbstractTableListEditor.java b/src/org/openstreetmap/josm/gui/preferences/advanced/AbstractTableListEditor.java
|
a
|
b
|
|
| 107 | 107 | public void valueChanged(ListSelectionEvent e) { |
| 108 | 108 | TableCellEditor editor = table.getCellEditor(); |
| 109 | 109 | if (editor != null) { |
| 110 | | ((DefaultCellEditor) editor).stopCellEditing(); |
| | 110 | editor.stopCellEditing(); |
| 111 | 111 | } |
| 112 | 112 | if (entryList.getSelectedIndices().length != 1) { |
| 113 | 113 | entryIdx = null; |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/preferences/projection/UTMProjectionChoice.java b/src/org/openstreetmap/josm/gui/preferences/projection/UTMProjectionChoice.java
|
a
|
b
|
|
| 90 | 90 | public String getCurrentCode() { |
| 91 | 91 | int zone = index + 1; |
| 92 | 92 | int code = 32600 + zone + (hemisphere == Hemisphere.South ? 100 : 0); |
| 93 | | return "EPSG:" + Integer.toString(code); |
| | 93 | return "EPSG:" + code; |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | @Override |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java b/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
|
a
|
b
|
|
| 1249 | 1249 | sc = ((JosmAction) action.getAction()).getShortcut(); |
| 1250 | 1250 | if (sc.getAssignedKey() == KeyEvent.CHAR_UNDEFINED) { |
| 1251 | 1251 | sc = null; |
| 1252 | | } |
| | 1252 | } |
| 1253 | 1253 | } |
| 1254 | 1254 | |
| 1255 | 1255 | long paramCode = 0; |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/tagging/presets/items/ComboMultiSelect.java b/src/org/openstreetmap/josm/gui/tagging/presets/items/ComboMultiSelect.java
|
a
|
b
|
|
| 10 | 10 | import java.util.ArrayList; |
| 11 | 11 | import java.util.Arrays; |
| 12 | 12 | import java.util.Collection; |
| 13 | | import java.util.Collections; |
| 14 | 13 | import java.util.List; |
| 15 | 14 | import java.util.Map; |
| 16 | 15 | import java.util.TreeMap; |
| … |
… |
|
| 311 | 310 | } |
| 312 | 311 | |
| 313 | 312 | if (values_sort && TaggingPresets.SORT_MENU.get()) { |
| 314 | | Collections.sort(presetListEntries, (a, b) -> AlphanumComparator.getInstance().compare(a.getDisplayValue(), b.getDisplayValue())); |
| | 313 | presetListEntries.sort((a, b) -> AlphanumComparator.getInstance().compare(a.getDisplayValue(), b.getDisplayValue())); |
| 315 | 314 | } |
| 316 | 315 | } |
| 317 | 316 | |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/tagging/presets/items/PresetListEntry.java b/src/org/openstreetmap/josm/gui/tagging/presets/items/PresetListEntry.java
|
a
|
b
|
|
| 82 | 82 | */ |
| 83 | 83 | public String getListDisplay(int width) { |
| 84 | 84 | String displayValue = getDisplayValue(); |
| 85 | | Integer count = getCount(); |
| | 85 | int count = getCount(); |
| 86 | 86 | |
| 87 | 87 | if (count > 0 && cms.usage.getSelectedCount() > 1) { |
| 88 | 88 | displayValue = tr("{0} ({1})", displayValue, count); |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java b/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java
|
a
|
b
|
|
| 278 | 278 | try { |
| 279 | 279 | result.attachImageIcon(this, true); |
| 280 | 280 | } catch (IllegalArgumentException e) { |
| 281 | | Logging.warn(toString() + ": " + PRESET_ICON_ERROR_MSG_PREFIX + iconName); |
| | 281 | Logging.warn(this + ": " + PRESET_ICON_ERROR_MSG_PREFIX + iconName); |
| 282 | 282 | Logging.warn(e); |
| 283 | 283 | } finally { |
| 284 | 284 | iconFuture.complete(null); |
| 285 | 285 | } |
| 286 | 286 | }); |
| 287 | 287 | } else { |
| 288 | | Logging.warn(toString() + ": " + PRESET_ICON_ERROR_MSG_PREFIX + iconName); |
| | 288 | Logging.warn(this + ": " + PRESET_ICON_ERROR_MSG_PREFIX + iconName); |
| 289 | 289 | iconFuture.complete(null); |
| 290 | 290 | } |
| 291 | 291 | }); |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java b/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java
|
a
|
b
|
|
| 530 | 530 | */ |
| 531 | 531 | public List<String> getKeys() { |
| 532 | 532 | return tags.stream() |
| 533 | | .filter(tag -> !Utils.isStripEmpty(tag.getName())) |
| 534 | 533 | .map(TagModel::getName) |
| | 534 | .filter(name -> !Utils.isStripEmpty(name)) |
| 535 | 535 | .collect(Collectors.toList()); |
| 536 | 536 | } |
| 537 | 537 | |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/MapStatus.java b/src/org/openstreetmap/josm/gui/MapStatus.java
|
a
|
b
|
|
| 645 | 645 | osm.visitKeys((primitive, key, value) -> text.append("<br>").append(key).append('=').append(value)); |
| 646 | 646 | |
| 647 | 647 | final JLabel l = new JLabel( |
| 648 | | "<html>" + text.toString() + "</html>", |
| | 648 | "<html>" + text + "</html>", |
| 649 | 649 | ImageProvider.get(osm.getDisplayType()), |
| 650 | 650 | JLabel.HORIZONTAL |
| 651 | 651 | ) { |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java b/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java
|
a
|
b
|
|
| 202 | 202 | */ |
| 203 | 203 | if (GLOBAL_CONFIRMATION.get()) { |
| 204 | 204 | // Ensure dialog box does not exceed main window size |
| 205 | | Integer maxWidth = (int) Math.max(200, MainApplication.getMainFrame().getWidth()*0.6); |
| | 205 | int maxWidth = (int) Math.max(200, MainApplication.getMainFrame().getWidth()*0.6); |
| 206 | 206 | String message = "<html><div>" + getPermissionMessage() + |
| 207 | 207 | "<br/>" + tr("Do you want to allow this?") + "</div></html>"; |
| 208 | 208 | JLabel label = new JLabel(message); |
| … |
… |
|
| 356 | 356 | protected DownloadParams getDownloadParams() { |
| 357 | 357 | DownloadParams result = new DownloadParams(); |
| 358 | 358 | if (args != null) { |
| 359 | | result = result |
| 360 | | .withNewLayer(isLoadInNewLayer()) |
| 361 | | .withLayerName(args.get("layer_name")) |
| 362 | | .withLocked(get("layer_locked")) |
| 363 | | .withDownloadPolicy(get("download_policy", DownloadPolicy::of, () -> DownloadPolicy.NORMAL)) |
| 364 | | .withUploadPolicy(get("upload_policy", UploadPolicy::of, () -> UploadPolicy.NORMAL)); |
| | 359 | result |
| | 360 | .withNewLayer(isLoadInNewLayer()) |
| | 361 | .withLayerName(args.get("layer_name")) |
| | 362 | .withLocked(get("layer_locked")) |
| | 363 | .withDownloadPolicy(get("download_policy", DownloadPolicy::of, () -> DownloadPolicy.NORMAL)) |
| | 364 | .withUploadPolicy(get("upload_policy", UploadPolicy::of, () -> UploadPolicy.NORMAL)); |
| 365 | 365 | } |
| 366 | 366 | return result; |
| 367 | 367 | } |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/io/ChangesetQuery.java b/src/org/openstreetmap/josm/io/ChangesetQuery.java
|
a
|
b
|
|
| 264 | 264 | * Restricts the result to changesets which have been closed after the date given by <code>d</code>. |
| 265 | 265 | * <code>d</code> d is a date relative to the current time zone. |
| 266 | 266 | * |
| 267 | | * @param d the date . Must not be null. |
| | 267 | * @param d the date. Must not be null. |
| 268 | 268 | * @return the restricted changeset query |
| 269 | 269 | * @throws IllegalArgumentException if d is null |
| 270 | 270 | */ |
| … |
… |
|
| 368 | 368 | if (sb.length() > 0) { |
| 369 | 369 | sb.append('&'); |
| 370 | 370 | } |
| 371 | | sb.append("open=").append(Boolean.toString(open)); |
| | 371 | sb.append("open=").append(open); |
| 372 | 372 | } else if (closed != null) { |
| 373 | 373 | if (sb.length() > 0) { |
| 374 | 374 | sb.append('&'); |
| 375 | 375 | } |
| 376 | | sb.append("closed=").append(Boolean.toString(closed)); |
| | 376 | sb.append("closed=").append(closed); |
| 377 | 377 | } else if (changesetIds != null) { |
| 378 | 378 | // since 2013-12-05, see https://github.com/openstreetmap/openstreetmap-website/commit/1d1f194d598e54a5d6fb4f38fb569d4138af0dc8 |
| 379 | 379 | if (sb.length() > 0) { |
| … |
… |
|
| 569 | 569 | * <code>query</code> is the query part of a API url for querying changesets, |
| 570 | 570 | * see <a href="http://wiki.openstreetmap.org/wiki/API_v0.6#Query:_GET_.2Fapi.2F0.6.2Fchangesets">OSM API</a>. |
| 571 | 571 | * |
| 572 | | * Example for an query string:<br> |
| | 572 | * Example for a query string:<br> |
| 573 | 573 | * <pre> |
| 574 | 574 | * uid=1234&open=true |
| 575 | 575 | * </pre> |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/plugins/PluginHandler.java b/src/org/openstreetmap/josm/plugins/PluginHandler.java
|
a
|
b
|
|
| 465 | 465 | } else { |
| 466 | 466 | long tim = System.currentTimeMillis(); |
| 467 | 467 | long last = Config.getPref().getLong("pluginmanager.lastupdate", 0); |
| 468 | | Integer maxTime = Config.getPref().getInt("pluginmanager.time-based-update.interval", DEFAULT_TIME_BASED_UPDATE_INTERVAL); |
| | 468 | int maxTime = Config.getPref().getInt("pluginmanager.time-based-update.interval", DEFAULT_TIME_BASED_UPDATE_INTERVAL); |
| 469 | 469 | long d = TimeUnit.MILLISECONDS.toDays(tim - last); |
| 470 | 470 | if ((last <= 0) || (maxTime <= 0)) { |
| 471 | 471 | Config.getPref().put("pluginmanager.lastupdate", Long.toString(tim)); |
| … |
… |
|
| 1020 | 1020 | } |
| 1021 | 1021 | try { |
| 1022 | 1022 | monitor.beginTask(tr("Determining plugins to load...")); |
| 1023 | | Set<String> plugins = new HashSet<>(Config.getPref().getList("plugins", new LinkedList<String>())); |
| | 1023 | Set<String> plugins = new HashSet<>(Config.getPref().getList("plugins", new LinkedList<>())); |
| 1024 | 1024 | Logging.debug("Plugins list initialized to {0}", plugins); |
| 1025 | 1025 | String systemProp = Utils.getSystemProperty("josm.plugins"); |
| 1026 | 1026 | if (systemProp != null) { |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/tools/ColorScale.java b/src/org/openstreetmap/josm/tools/ColorScale.java
|
a
|
b
|
|
| 249 | 249 | FontMetrics fm = g.getFontMetrics(); |
| 250 | 250 | fh = fm.getHeight()/2; |
| 251 | 251 | if (colorBarTitles != null && colorBarTitles.length > 0) { |
| 252 | | fw = Arrays.asList(colorBarTitles).stream().mapToInt(title -> fm.stringWidth(title)).max().orElse(50); |
| | 252 | fw = Arrays.stream(colorBarTitles).mapToInt(fm::stringWidth).max().orElse(50); |
| 253 | 253 | } else { |
| 254 | 254 | fw = fm.stringWidth( |
| 255 | 255 | String.valueOf(Math.max((int) Math.abs(max * valueScale), (int) Math.abs(min * valueScale)))) |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java b/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java
|
a
|
b
|
|
| 135 | 135 | return Double.parseDouble(map.get(key)); |
| 136 | 136 | if (map.containsKey('m'+key)) |
| 137 | 137 | return Double.parseDouble(map.get('m'+key)); |
| 138 | | throw new IllegalArgumentException(map.toString() + " does not contain " + key); |
| | 138 | throw new IllegalArgumentException(map + " does not contain " + key); |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | private static final char[] SHORTLINK_CHARS = { |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/tools/Shortcut.java b/src/org/openstreetmap/josm/tools/Shortcut.java
|
a
|
b
|
|
| 521 | 521 | // and now the workhorse. same parameters as above, just one more |
| 522 | 522 | private static Shortcut registerShortcut(String shortText, String longText, int requestedKey, int requestedGroup, Integer modifier) { |
| 523 | 523 | doInit(); |
| 524 | | Integer defaultModifier = findModifier(requestedGroup, modifier); |
| | 524 | int defaultModifier = findModifier(requestedGroup, modifier); |
| 525 | 525 | final Optional<Shortcut> existing = findShortcutByKeyOrShortText(requestedKey, defaultModifier, shortText); |
| 526 | 526 | if (existing.isPresent() && shortText.equals(existing.get().getShortText())) { |
| 527 | 527 | // a re-register? maybe a sc already read from the preferences? |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/tools/Utils.java b/src/org/openstreetmap/josm/tools/Utils.java
|
a
|
b
|
|
| 1642 | 1642 | throw new IllegalArgumentException(MessageFormat.format("Parameter min ({0}) cannot be greater than max ({1})", min, max)); |
| 1643 | 1643 | } else if (val < min) { |
| 1644 | 1644 | return min; |
| 1645 | | } else if (val > max) { |
| 1646 | | return max; |
| 1647 | | } else { |
| 1648 | | return val; |
| 1649 | | } |
| | 1645 | } else return Math.min(val, max); |
| 1650 | 1646 | } |
| 1651 | 1647 | |
| 1652 | 1648 | /** |
| … |
… |
|
| 1663 | 1659 | throw new IllegalArgumentException(MessageFormat.format("Parameter min ({0}) cannot be greater than max ({1})", min, max)); |
| 1664 | 1660 | } else if (val < min) { |
| 1665 | 1661 | return min; |
| 1666 | | } else if (val > max) { |
| 1667 | | return max; |
| 1668 | | } else { |
| 1669 | | return val; |
| 1670 | | } |
| | 1662 | } else return Math.min(val, max); |
| 1671 | 1663 | } |
| 1672 | 1664 | |
| 1673 | 1665 | /** |
| … |
… |
|
| 1761 | 1753 | int bPos = version.indexOf('b'); |
| 1762 | 1754 | int pPos = version.indexOf('+'); |
| 1763 | 1755 | try { |
| 1764 | | return Integer.parseInt(version.substring(bPos > -1 ? bPos + 1 : pPos + 1, version.length())); |
| | 1756 | return Integer.parseInt(version.substring(bPos > -1 ? bPos + 1 : pPos + 1)); |
| 1765 | 1757 | } catch (NumberFormatException e) { |
| 1766 | 1758 | Logging.trace(e); |
| 1767 | 1759 | return 0; |
| … |
… |
|
| 1827 | 1819 | |
| 1828 | 1820 | /** |
| 1829 | 1821 | * Determines if a class can be found for the given name. |
| 1830 | | * @param className class nmae to find |
| | 1822 | * @param className class name to find |
| 1831 | 1823 | * @return {@code true} if the class can be found, {@code false} otherwise |
| 1832 | 1824 | * @since 17692 |
| 1833 | 1825 | */ |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/test/unit/org/openstreetmap/josm/data/osm/OsmPrimitiveKeyHandlingTest.java b/test/unit/org/openstreetmap/josm/data/osm/OsmPrimitiveKeyHandlingTest.java
|
a
|
b
|
|
| 6 | 6 | import static org.junit.jupiter.api.Assertions.assertNotEquals; |
| 7 | 7 | import static org.junit.jupiter.api.Assertions.assertTrue; |
| 8 | 8 | |
| 9 | | import org.junit.jupiter.api.extension.RegisterExtension; |
| | 9 | import java.util.Collections; |
| | 10 | import java.util.HashSet; |
| | 11 | |
| | 12 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 10 | 13 | import org.junit.jupiter.api.Test; |
| | 14 | import org.junit.jupiter.api.extension.RegisterExtension; |
| 11 | 15 | import org.openstreetmap.josm.data.coor.LatLon; |
| 12 | 16 | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 13 | 17 | |
| 14 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 15 | | |
| 16 | | import java.util.Collections; |
| 17 | | import java.util.HashSet; |
| 18 | | |
| 19 | 18 | /** |
| 20 | 19 | * Some unit test cases for basic tag management on {@link OsmPrimitive}. Uses |
| 21 | 20 | * {@link Node} for the tests, {@link OsmPrimitive} is abstract. |
| … |
… |
|
| 192 | 191 | private void testGetKey(OsmPrimitive p, String key, String value) { |
| 193 | 192 | assertEquals(value != null, p.hasKey(key)); |
| 194 | 193 | assertEquals(value != null, p.getKeys().containsKey(key)); |
| 195 | | assertEquals(value != null, p.getKeys().keySet().contains(key)); |
| 196 | 194 | assertEquals(value, p.get(key)); |
| 197 | | assertEquals(value, p.getKeys().get(key)); |
| 198 | 195 | } |
| 199 | | |
| 200 | 196 | } |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/test/unit/org/openstreetmap/josm/io/GpxReaderTest.java b/test/unit/org/openstreetmap/josm/io/GpxReaderTest.java
|
a
|
b
|
|
| 6 | 6 | import static org.junit.jupiter.api.Assertions.assertTrue; |
| 7 | 7 | |
| 8 | 8 | import java.io.ByteArrayInputStream; |
| 9 | | import java.io.File; |
| 10 | 9 | import java.io.FileInputStream; |
| 11 | 10 | import java.io.IOException; |
| 12 | 11 | import java.nio.charset.StandardCharsets; |
| … |
… |
|
| 14 | 13 | import java.util.HashMap; |
| 15 | 14 | import java.util.Map; |
| 16 | 15 | |
| | 16 | import org.junit.jupiter.api.Test; |
| 17 | 17 | import org.openstreetmap.josm.TestUtils; |
| 18 | 18 | import org.openstreetmap.josm.data.Bounds; |
| 19 | 19 | import org.openstreetmap.josm.data.coor.LatLon; |
| 20 | 20 | import org.openstreetmap.josm.data.gpx.GpxData; |
| 21 | 21 | import org.openstreetmap.josm.data.gpx.WayPoint; |
| 22 | 22 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
| 23 | | |
| 24 | | import org.junit.jupiter.api.Test; |
| 25 | 23 | import org.xml.sax.SAXException; |
| 26 | 24 | |
| 27 | 25 | /** |
| … |
… |
|
| 38 | 36 | */ |
| 39 | 37 | public static GpxData parseGpxData(String filename) throws IOException, SAXException { |
| 40 | 38 | final GpxData result; |
| 41 | | try (FileInputStream in = new FileInputStream(new File(filename))) { |
| | 39 | try (FileInputStream in = new FileInputStream(filename)) { |
| 42 | 40 | GpxReader reader = new GpxReader(in); |
| 43 | 41 | assertTrue(reader.parse(false)); |
| 44 | 42 | result = reader.getGpxData(); |
-
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/test/unit/org/openstreetmap/josm/testutils/mockers/EDTAssertionMocker.java b/test/unit/org/openstreetmap/josm/testutils/mockers/EDTAssertionMocker.java
|
a
|
b
|
|
| 1 | 1 | // License: GPL. For details, see LICENSE file. |
| 2 | 2 | package org.openstreetmap.josm.testutils.mockers; |
| 3 | 3 | |
| 4 | | import org.openstreetmap.josm.gui.util.GuiHelper; |
| 5 | | |
| 6 | 4 | import mockit.Invocation; |
| 7 | 5 | import mockit.Mock; |
| 8 | 6 | import mockit.MockUp; |
| | 7 | import org.openstreetmap.josm.gui.util.GuiHelper; |
| 9 | 8 | |
| 10 | 9 | /** |
| 11 | 10 | * MockUp that, when applied, should cause calls to the EDT which would normally swallow generated |
| … |
… |
|
| 16 | 15 | static void handleEDTException(final Invocation invocation, final Throwable t) throws Throwable { |
| 17 | 16 | final Throwable cause = t.getCause(); |
| 18 | 17 | if (cause instanceof AssertionError) { |
| 19 | | throw (AssertionError) cause; |
| | 18 | throw cause; |
| 20 | 19 | } |
| 21 | 20 | |
| 22 | 21 | invocation.proceed(t); |