Changeset 14882 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2019-03-12T21:59:50+01:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/ValidateAction.java
r14838 r14882 177 177 for (TestError error : errors) { 178 178 if (canceled) return; 179 List<String> s = new ArrayList<>(); 180 s.add(error.getIgnoreState()); 181 s.add(error.getIgnoreGroup()); 182 s.add(error.getIgnoreSubGroup()); 183 for (String state : s) { 184 if (state != null && OsmValidator.hasIgnoredError(state)) { 185 error.setIgnored(true); 186 } 187 } 179 error.updateIgnored(); 188 180 } 189 181 } -
trunk/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java
r14672 r14882 44 44 /** 45 45 * Validate the modified data before uploading 46 * @param apiDataSet contains primitives to be uploaded 47 * @return true if upload should continue, else false 46 48 */ 47 49 @Override … … 77 79 78 80 if (ValidatorPrefHelper.PREF_USE_IGNORE.get()) { 79 int nume = 0;81 boolean allIgnored = true; 80 82 for (TestError error : errors) { 81 List<String> s = new ArrayList<>(); 82 s.add(error.getIgnoreState()); 83 s.add(error.getIgnoreGroup()); 84 s.add(error.getIgnoreSubGroup()); 85 for (String state : s) { 86 if (state != null && OsmValidator.hasIgnoredError(state)) { 87 error.setIgnored(true); 88 } 89 } 90 if (!error.isIgnored()) { 91 ++nume; 83 if (!error.updateIgnored()) { 84 allIgnored = false; 92 85 } 93 86 } 94 if ( nume == 0)87 if (allIgnored) 95 88 return true; 96 89 } -
trunk/src/org/openstreetmap/josm/data/validation/TestError.java
r14768 r14882 279 279 public String getIgnoreState() { 280 280 Collection<String> strings = new TreeSet<>(); 281 StringBuilder ignorestring = new StringBuilder(getIgnoreSubGroup());282 281 for (OsmPrimitive o : primitives) { 283 282 // ignore data not yet uploaded … … 294 293 strings.add(type + '_' + o.getId()); 295 294 } 295 StringBuilder ignorestring = new StringBuilder(getIgnoreSubGroup()); 296 296 for (String o : strings) { 297 297 ignorestring.append(':').append(o); 298 298 } 299 299 return ignorestring.toString(); 300 } 301 302 /** 303 * Check if this error matches an entry in the ignore list and 304 * set the ignored flag if it is. 305 * @return the new ignored state 306 */ 307 public boolean updateIgnored() { 308 setIgnored(calcIgnored()); 309 return isIgnored(); 310 } 311 312 private boolean calcIgnored() { 313 String state = getIgnoreGroup(); 314 if (state != null && OsmValidator.hasIgnoredError(state)) 315 return true; 316 state = getIgnoreSubGroup(); 317 if (state != null && OsmValidator.hasIgnoredError(state)) 318 return true; 319 state = getIgnoreState(); 320 return state != null && OsmValidator.hasIgnoredError(state); 300 321 } 301 322
Note:
See TracChangeset
for help on using the changeset viewer.