- Timestamp:
- 2018-06-24T19:57:43+02:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/Addresses.java
r13970 r13974 65 65 // CHECKSTYLE.ON: SingleSpaceSeparator 66 66 67 private Map<String, Collection<OsmPrimitive>> addresses;67 private Map<String, Collection<OsmPrimitive>> knownAddresses; 68 68 private Set<String> ignoredAddresses; 69 69 … … 124 124 } 125 125 126 privateboolean hasAddress(OsmPrimitive p) {126 static boolean hasAddress(OsmPrimitive p) { 127 127 return p.hasKey(ADDR_HOUSE_NUMBER) && p.hasKey(ADDR_STREET, ADDR_PLACE); 128 128 } … … 136 136 String simplifiedAddress = getSimplifiedAddress(p); 137 137 if (!ignoredAddresses.contains(simplifiedAddress)) { 138 addresses.computeIfAbsent(simplifiedAddress, x -> new ArrayList<>()).add(p);138 knownAddresses.computeIfAbsent(simplifiedAddress, x -> new ArrayList<>()).add(p); 139 139 } 140 140 } … … 142 142 143 143 protected void initAddressMap(OsmPrimitive primitive) { 144 addresses = new HashMap<>();144 knownAddresses = new HashMap<>(); 145 145 ignoredAddresses = new HashSet<>(); 146 146 for (OsmPrimitive p : primitive.getDataSet().allNonDeletedPrimitives()) { … … 153 153 if (!ignoredAddresses.contains(simplifiedAddress)) { 154 154 ignoredAddresses.add(simplifiedAddress); 155 } else if ( addresses.containsKey(simplifiedAddress)) {156 addresses.remove(simplifiedAddress);155 } else if (knownAddresses.containsKey(simplifiedAddress)) { 156 knownAddresses.remove(simplifiedAddress); 157 157 } 158 158 } … … 167 167 @Override 168 168 public void endTest() { 169 addresses = null;169 knownAddresses = null; 170 170 ignoredAddresses = null; 171 171 super.endTest(); … … 173 173 174 174 protected void checkForDuplicate(OsmPrimitive p) { 175 if ( addresses == null) {175 if (knownAddresses == null) { 176 176 initAddressMap(p); 177 177 } … … 181 181 return; 182 182 } 183 if ( addresses.containsKey(simplifiedAddress)) {183 if (knownAddresses.containsKey(simplifiedAddress)) { 184 184 double maxDistance = MAX_DUPLICATE_DISTANCE.get(); 185 for (OsmPrimitive p2 : addresses.get(simplifiedAddress)) {185 for (OsmPrimitive p2 : knownAddresses.get(simplifiedAddress)) { 186 186 if (p == p2) { 187 187 continue; 188 188 } 189 Severity severityLevel = Severity.WARNING;189 Severity severityLevel; 190 190 String city1 = p.get(ADDR_CITY); 191 191 String city2 = p2.get(ADDR_CITY); … … 227 227 .primitives(Arrays.asList(p, p2)).build()); 228 228 } 229 addresses.get(simplifiedAddress).remove(p); // otherwise we would get every warning two times229 knownAddresses.get(simplifiedAddress).remove(p); // otherwise we would get every warning two times 230 230 } 231 231 } -
trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserDialogManager.java
r13948 r13974 198 198 * Adds a new {@code HistoryHook}. 199 199 * @param hook hook to add 200 * @return <tt>true</tt>(as specified by {@link Collection#add})200 * @return {@code true} (as specified by {@link Collection#add}) 201 201 * @since 13947 202 202 */ … … 208 208 * Removes an existing {@code HistoryHook}. 209 209 * @param hook hook to remove 210 * @return <tt>true</tt>if this list contained the specified element210 * @return {@code true} if this list contained the specified element 211 211 * @since 13947 212 212 */ -
trunk/src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java
r13965 r13974 50 50 private static ImageIcon loadIcon(String iconName) { 51 51 return iconCache.computeIfAbsent(iconName, 52 x -> new ImageProvider( iconName).setOptional(true).setSize(ImageProvider.ImageSizes.SMALLICON).get());52 x -> new ImageProvider(x).setOptional(true).setSize(ImageProvider.ImageSizes.SMALLICON).get()); 53 53 } 54 54
Note:
See TracChangeset
for help on using the changeset viewer.