- Timestamp:
- 2015-10-24T21:32:35+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java
r8846 r8941 17 17 import javax.swing.Icon; 18 18 19 import org.openstreetmap.josm. Main;19 import org.openstreetmap.josm.data.osm.DataSet; 20 20 import org.openstreetmap.josm.data.osm.OsmPrimitive; 21 21 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; … … 106 106 } 107 107 108 @Override public boolean executeCommand() { 109 Main.main.getCurrentDataSet().beginUpdate(); 108 @Override 109 public boolean executeCommand() { 110 final DataSet dataSet = objects.get(0).getDataSet(); 111 dataSet.beginUpdate(); 110 112 try { 111 113 super.executeCommand(); // save old … … 129 131 return true; 130 132 } finally { 131 Main.main.getCurrentDataSet().endUpdate(); 132 } 133 } 134 135 @Override public void fillModifiedData(Collection<OsmPrimitive> modified, Collection<OsmPrimitive> deleted, Collection<OsmPrimitive> added) { 133 dataSet.endUpdate(); 134 } 135 } 136 137 @Override 138 public void fillModifiedData(Collection<OsmPrimitive> modified, Collection<OsmPrimitive> deleted, Collection<OsmPrimitive> added) { 136 139 modified.addAll(objects); 137 140 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/Highways.java
r8840 r8941 20 20 import org.openstreetmap.josm.data.osm.OsmUtils; 21 21 import org.openstreetmap.josm.data.osm.Way; 22 import org.openstreetmap.josm.data.validation.FixableTestError; 22 23 import org.openstreetmap.josm.data.validation.Severity; 23 24 import org.openstreetmap.josm.data.validation.Test; … … 39 40 protected static final int SOURCE_MAXSPEED_CONTEXT_MISMATCH_VS_HIGHWAY = 2706; 40 41 protected static final int SOURCE_WRONG_LINK = 2707; 42 43 protected static final String SOURCE_MAXSPEED = "source:maxspeed"; 41 44 42 45 /** … … 92 95 testMissingPedestrianCrossing(n); 93 96 } 94 if (n.hasKey( "source:maxspeed")) {97 if (n.hasKey(SOURCE_MAXSPEED)) { 95 98 // Check maxspeed but not context against highway for nodes 96 99 // as maxspeed is not set on highways here but on signs, speed cameras, etc. … … 107 110 testWrongRoundabout(w); 108 111 } 109 if (w.hasKey( "source:maxspeed")) {112 if (w.hasKey(SOURCE_MAXSPEED)) { 110 113 // Check maxspeed, including context against highway 111 114 testSourceMaxspeed(w, true); … … 240 243 241 244 private void testSourceMaxspeed(OsmPrimitive p, boolean testContextHighway) { 242 String value = p.get( "source:maxspeed");245 String value = p.get(SOURCE_MAXSPEED); 243 246 if (value.matches("[A-Z]{2}:.+")) { 244 247 int index = value.indexOf(':'); … … 246 249 String country = value.substring(0, index); 247 250 if (!ISO_COUNTRIES.contains(country)) { 248 errors.add(new TestError(this, Severity.WARNING, 249 tr("Unknown country code: {0}", country), SOURCE_MAXSPEED_UNKNOWN_COUNTRY_CODE, p)); 251 if ("UK".equals(country)) { 252 errors.add(new FixableTestError(this, Severity.WARNING, 253 tr("Unknown country code: {0}", country), SOURCE_MAXSPEED_UNKNOWN_COUNTRY_CODE, p, 254 new ChangePropertyCommand(p, SOURCE_MAXSPEED, value.replace("UK:", "GB:")))); 255 } else { 256 errors.add(new TestError(this, Severity.WARNING, 257 tr("Unknown country code: {0}", country), SOURCE_MAXSPEED_UNKNOWN_COUNTRY_CODE, p)); 258 } 250 259 } 251 260 // Check context
Note:
See TracChangeset
for help on using the changeset viewer.