Changeset 9693 in josm
- Timestamp:
- 2016-01-31T11:28:22+01:00 (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
r9397 r9693 1425 1425 } 1426 1426 1427 protected abstract Collection<Bounds> getBounds( );1427 protected abstract Collection<Bounds> getBounds(OsmPrimitive primitive); 1428 1428 1429 1429 @Override … … 1432 1432 return false; 1433 1433 else if (osm instanceof Node) { 1434 Collection<Bounds> allBounds = getBounds( );1434 Collection<Bounds> allBounds = getBounds(osm); 1435 1435 if (allBounds != null) { 1436 1436 LatLon coor = ((Node) osm).getCoor(); … … 1467 1467 1468 1468 @Override 1469 protected Collection<Bounds> getBounds() { 1470 return Main.main == null || Main.main.getCurrentDataSet() == null || Main.main.getCurrentDataSet().getDataSourceArea() == null 1471 ? null : Main.main.getCurrentDataSet().getDataSourceBounds(); 1469 protected Collection<Bounds> getBounds(OsmPrimitive primitive) { 1470 return primitive.getDataSet() != null ? primitive.getDataSet().getDataSourceBounds() : null; 1472 1471 } 1473 1472 … … 1480 1479 /** 1481 1480 * Matches objects which are not outside the source area ("downloaded area"). 1482 * Unli nk{@link InDataSourceArea} this matches also if no source area is set (e.g., for new layers).1481 * Unlike {@link InDataSourceArea} this matches also if no source area is set (e.g., for new layers). 1483 1482 */ 1484 1483 public static class NotOutsideDataSourceArea extends InDataSourceArea { … … 1492 1491 1493 1492 @Override 1494 protected Collection<Bounds> getBounds( ) {1495 final Collection<Bounds> bounds = super.getBounds( );1493 protected Collection<Bounds> getBounds(OsmPrimitive primitive) { 1494 final Collection<Bounds> bounds = super.getBounds(primitive); 1496 1495 return bounds == null || bounds.isEmpty() ? Collections.singleton(Main.getProjection().getWorldBoundsLatLon()) : bounds; 1497 1496 } … … 1513 1512 1514 1513 @Override 1515 protected Collection<Bounds> getBounds( ) {1514 protected Collection<Bounds> getBounds(OsmPrimitive primitive) { 1516 1515 if (!Main.isDisplayingMapView()) { 1517 1516 return null; -
trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedNode.java
r9604 r9693 41 41 if (n.isUsable() && !n.isTagged() && n.getReferrers().isEmpty()) { 42 42 43 if (!n.hasKeys() && !IN_DOWNLOADED_AREA.evaluate(n)) {43 if (!n.hasKeys() && IN_DOWNLOADED_AREA.evaluate(n)) { 44 44 String msg = marktr("No tags"); 45 45 errors.add(new TestError(this, Severity.WARNING, ERROR_MESSAGE, tr(msg), msg, UNTAGGED_NODE_BLANK, n)); -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/UntaggedNodeTest.java
r9666 r9693 2 2 package org.openstreetmap.josm.data.validation.tests; 3 3 4 import static org.CustomMatchers.hasSize; 4 5 import static org.CustomMatchers.isEmpty; 5 6 import static org.junit.Assert.assertThat; … … 46 47 } 47 48 } 49 50 /** 51 * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/12464">Bug #12464</a>. 52 * @throws Exception if an error occurs 53 */ 54 @Test 55 public void testTicket12464() throws Exception { 56 test.initialize(); 57 test.startTest(null); 58 try (InputStream fis = TestUtils.getRegressionDataStream(12464, "example.osm")) { 59 final DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE); 60 test.visit(ds.allPrimitives()); 61 test.endTest(); 62 assertThat(test.getErrors(), hasSize(1)); 63 } 64 } 48 65 }
Note:
See TracChangeset
for help on using the changeset viewer.