From bf5cb903df8896c011db2f85716ef8b5bbe10707 Mon Sep 17 00:00:00 2001 From: matthieun Date: Wed, 1 May 2024 14:39:28 -0700 Subject: [PATCH] Build Fix (#800) * Retire pyatlas, update date range, latest spotless * back to java11 * Ubuntu-latest * Retire sonar --- .github/workflows/ci.yml | 37 ++++++------- LICENSE | 2 +- build.gradle | 2 +- .../AtlasDeltaGeoJsonIntegrationTest.java | 7 ++- .../delta/AtlasDeltaIntegrationTest.java | 7 ++- .../dynamic/DynamicAtlasIntegrationTest.java | 2 +- .../pbf/OsmPbfIngestIntegrationTest.java | 2 +- .../atlas/raw/RawAtlasIntegrationTest.java | 2 +- .../atlas/change/ChangeRelation.java | 4 +- .../atlas/change/MemberMergeStrategies.java | 16 +++--- .../atlas/change/diff/AtlasDiff.java | 2 +- .../atlas/complete/CompleteArea.java | 10 ++-- .../atlas/complete/CompleteEdge.java | 10 ++-- .../atlas/complete/CompleteLine.java | 10 ++-- .../atlas/dynamic/DynamicAtlasExpander.java | 3 +- .../complex/boundaries/ComplexBoundary.java | 3 +- .../atlas/raw/creation/OsmPbfReader.java | 8 +-- .../raw/sectioning/AtlasSectionProcessor.java | 5 +- .../filters/ConfiguredTaggableFilter.java | 4 +- .../TaggableFilterToMatcherConverter.java | 2 +- .../matcher/ConfiguredTaggableMatcher.java | 4 +- .../templates/ListOfNumbersTemplate.java | 2 +- .../atlas/geography/RectangleTest.java | 4 +- .../atlas/change/ChangeAtlasTest.java | 2 +- .../atlas/change/FeatureChangeMergerTest.java | 12 ++--- .../DynamicAtlasPreemptiveLoadTest.java | 52 +++++++++---------- .../ComplexTurnRestrictionTest.java | 2 +- .../sectioning/AtlasSectionProcessorTest.java | 2 +- .../atlas/raw/slicing/RawAtlasSlicerTest.java | 2 +- .../boundary/CountryBoundaryMapTest.java | 12 ++--- .../boundary/CountryShardListingTest.java | 4 +- ...ltiplePolyLineToPolygonsConverterTest.java | 19 ++++--- .../jackson/GeoJsonParserJacksonImplTest.java | 2 +- .../atlas/tags/LocalizedTaggableTestCase.java | 4 +- .../NamespaceCachingStrategiesTest.java | 2 +- .../CountryBoundaryMapPrinterCommandTest.java | 3 +- .../JavaToProtoSerializationCommandTest.java | 4 +- .../EntityIdentifierGeneratorTest.java | 3 +- 38 files changed, 138 insertions(+), 135 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1346b51c3..0657f51281 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,22 +15,23 @@ on: jobs: build: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: # Setup - uses: actions/checkout@v2 - name: Set up JDK 11 - uses: actions/setup-java@v1.4.3 + uses: actions/setup-java@v4 with: - java-version: 11.0.2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - name: Install Virtualenv - run: pip install virtualenv + distribution: 'zulu' + java-version: 11 +# - name: Set up Python +# uses: actions/setup-python@v2 +# with: +# python-version: 3.7 +# - name: Install Virtualenv +# run: pip install virtualenv - name: Install GEOS run: sudo apt-get install libgeos-dev - name: Grant execute permission for gradlew @@ -43,19 +44,19 @@ jobs: run: .github/workflow_scripts/update_project_version.sh # Quality Checks - - name: ShellCheck PyAtlas - run: shellcheck pyatlas/*.sh - - name: Build PyAtlas - run: ./gradlew cleanPyatlas buildPyatlas +# - name: ShellCheck PyAtlas +# run: shellcheck pyatlas/*.sh +# - name: Build PyAtlas +# run: ./gradlew cleanPyatlas buildPyatlas - name: Quality checks (No tests) run: ./gradlew jar check -x test -x integrationTest - name: Tests run: ./gradlew check build - - name: Sonar - env: - SONAR_TOKEN: 374d4e512b90257ba50c21c37202ee01af40c6a0 - SONAR_PR_DECORATION_GITHUB_TOKEN: ${{ secrets.SONAR_PR_DECORATION_GITHUB_TOKEN }} - run: .github/workflow_scripts/sonar.sh +# - name: Sonar +# env: +# SONAR_TOKEN: 374d4e512b90257ba50c21c37202ee01af40c6a0 +# SONAR_PR_DECORATION_GITHUB_TOKEN: ${{ secrets.SONAR_PR_DECORATION_GITHUB_TOKEN }} +# run: .github/workflow_scripts/sonar.sh # Merge to Main - name: Merge dev to main diff --git a/LICENSE b/LICENSE index fa783a9ca9..836baca065 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2023, Apple Inc. All rights reserved. +Copyright (c) 2015-2024, Apple Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/build.gradle b/build.gradle index ebd6b4c78c..e32687d216 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ plugins { id 'java-library' id 'maven-publish' id 'signing' - id 'com.diffplug.spotless' version '6.3.0' + id 'com.diffplug.spotless' version '6.25.0' id 'com.google.protobuf' version '0.8.18' id 'org.sonarqube' version '3.3' } diff --git a/src/integrationTest/java/org/openstreetmap/atlas/geography/atlas/delta/AtlasDeltaGeoJsonIntegrationTest.java b/src/integrationTest/java/org/openstreetmap/atlas/geography/atlas/delta/AtlasDeltaGeoJsonIntegrationTest.java index 23cb2e8797..2548087110 100644 --- a/src/integrationTest/java/org/openstreetmap/atlas/geography/atlas/delta/AtlasDeltaGeoJsonIntegrationTest.java +++ b/src/integrationTest/java/org/openstreetmap/atlas/geography/atlas/delta/AtlasDeltaGeoJsonIntegrationTest.java @@ -66,13 +66,12 @@ public void readAtlases() this.before = new TextAtlasBuilder() .read(new InputStreamResource(() -> AtlasDeltaIntegrationTest.class .getResourceAsStream("DMA_9-168-233-base.txt.gz")) - .withDecompressor(Decompressor.GZIP) - .withName("DMA_9-168-233-base.txt.gz")); + .withDecompressor(Decompressor.GZIP).withName("DMA_9-168-233-base.txt.gz")); this.after = new TextAtlasBuilder() .read(new InputStreamResource(() -> AtlasDeltaIntegrationTest.class .getResourceAsStream("DMA_9-168-233-alter.txt.gz")) - .withDecompressor(Decompressor.GZIP) - .withName("DMA_9-168-233-alter.txt.gz")); + .withDecompressor(Decompressor.GZIP) + .withName("DMA_9-168-233-alter.txt.gz")); this.delta = new AtlasDelta(this.before, this.after, false).generate(); } diff --git a/src/integrationTest/java/org/openstreetmap/atlas/geography/atlas/delta/AtlasDeltaIntegrationTest.java b/src/integrationTest/java/org/openstreetmap/atlas/geography/atlas/delta/AtlasDeltaIntegrationTest.java index 33cfafee0f..4e0cb2fd49 100644 --- a/src/integrationTest/java/org/openstreetmap/atlas/geography/atlas/delta/AtlasDeltaIntegrationTest.java +++ b/src/integrationTest/java/org/openstreetmap/atlas/geography/atlas/delta/AtlasDeltaIntegrationTest.java @@ -25,13 +25,12 @@ public void testDiff() final Atlas before = new TextAtlasBuilder() .read(new InputStreamResource(() -> AtlasDeltaIntegrationTest.class .getResourceAsStream("DMA_9-168-233-base.txt.gz")) - .withDecompressor(Decompressor.GZIP) - .withName("DMA_9-168-233-base.txt.gz")); + .withDecompressor(Decompressor.GZIP).withName("DMA_9-168-233-base.txt.gz")); final Atlas after = new TextAtlasBuilder() .read(new InputStreamResource(() -> AtlasDeltaIntegrationTest.class .getResourceAsStream("DMA_9-168-233-alter.txt.gz")) - .withDecompressor(Decompressor.GZIP) - .withName("DMA_9-168-233-alter.txt.gz")); + .withDecompressor(Decompressor.GZIP) + .withName("DMA_9-168-233-alter.txt.gz")); final AtlasDelta delta = new AtlasDelta(before, after, true).generate(); final SortedSet differences = delta.getDifferences(); final long size = differences.size(); diff --git a/src/integrationTest/java/org/openstreetmap/atlas/geography/atlas/dynamic/DynamicAtlasIntegrationTest.java b/src/integrationTest/java/org/openstreetmap/atlas/geography/atlas/dynamic/DynamicAtlasIntegrationTest.java index 3cd08ef2db..5f5a641f01 100644 --- a/src/integrationTest/java/org/openstreetmap/atlas/geography/atlas/dynamic/DynamicAtlasIntegrationTest.java +++ b/src/integrationTest/java/org/openstreetmap/atlas/geography/atlas/dynamic/DynamicAtlasIntegrationTest.java @@ -24,7 +24,7 @@ public class DynamicAtlasIntegrationTest final String fileName = "DMA_" + shard.getName() + ".atlas.txt.gz"; return Optional.of(new TextAtlasBuilder().read(new InputStreamResource( () -> DynamicAtlasIntegrationTest.class.getResourceAsStream(fileName)) - .withName(fileName).withDecompressor(Decompressor.GZIP))); + .withName(fileName).withDecompressor(Decompressor.GZIP))); }, new SlippyTileSharding(9), SlippyTile.forName("9-168-234"), Rectangle.MAXIMUM); @Test diff --git a/src/integrationTest/java/org/openstreetmap/atlas/geography/atlas/pbf/OsmPbfIngestIntegrationTest.java b/src/integrationTest/java/org/openstreetmap/atlas/geography/atlas/pbf/OsmPbfIngestIntegrationTest.java index 9ea1881a89..5675e976b6 100644 --- a/src/integrationTest/java/org/openstreetmap/atlas/geography/atlas/pbf/OsmPbfIngestIntegrationTest.java +++ b/src/integrationTest/java/org/openstreetmap/atlas/geography/atlas/pbf/OsmPbfIngestIntegrationTest.java @@ -236,7 +236,7 @@ public void testWaysSpanningOutsideOfCountry() final CountryBoundaryMap map = CountryBoundaryMap .fromPlainText(new InputStreamResource(() -> OsmPbfIngestIntegrationTest.class .getResourceAsStream("CUB_osm_boundaries.txt.gz")) - .withDecompressor(Decompressor.GZIP)); + .withDecompressor(Decompressor.GZIP)); final SlippyTile tile = SlippyTile.forName("8-72-111"); final MultiPolygon boundary = new JtsPolygonToMultiPolygonConverter() .convert(map.countryBoundary("CUB").get(0)); diff --git a/src/integrationTest/java/org/openstreetmap/atlas/geography/atlas/raw/RawAtlasIntegrationTest.java b/src/integrationTest/java/org/openstreetmap/atlas/geography/atlas/raw/RawAtlasIntegrationTest.java index aa41b7da6d..2899dbe63d 100644 --- a/src/integrationTest/java/org/openstreetmap/atlas/geography/atlas/raw/RawAtlasIntegrationTest.java +++ b/src/integrationTest/java/org/openstreetmap/atlas/geography/atlas/raw/RawAtlasIntegrationTest.java @@ -62,7 +62,7 @@ public class RawAtlasIntegrationTest final CountryBoundaryMap boundary = CountryBoundaryMap .fromPlainText(new InputStreamResource(() -> RawAtlasIntegrationTest.class .getResourceAsStream("CIV_GIN_LBR_osm_boundaries_with_grid_index.txt.gz")) - .withDecompressor(Decompressor.GZIP)); + .withDecompressor(Decompressor.GZIP)); loadingOptionAll = AtlasLoadingOption.createOptionWithAllEnabled(boundary); loadingOptionIvoryCoast = AtlasLoadingOption.createOptionWithAllEnabled(boundary) diff --git a/src/main/java/org/openstreetmap/atlas/geography/atlas/change/ChangeRelation.java b/src/main/java/org/openstreetmap/atlas/geography/atlas/change/ChangeRelation.java index 5193021a07..1e98c7ca75 100644 --- a/src/main/java/org/openstreetmap/atlas/geography/atlas/change/ChangeRelation.java +++ b/src/main/java/org/openstreetmap/atlas/geography/atlas/change/ChangeRelation.java @@ -81,8 +81,8 @@ public List allRelationsWithSameOsmIdentifier() { return attribute(Relation::allRelationsWithSameOsmIdentifier, "all relations with same osm identifier").stream() - .map(relation -> getChangeAtlas().relation(relation.getIdentifier())) - .collect(Collectors.toList()); + .map(relation -> getChangeAtlas().relation(relation.getIdentifier())) + .collect(Collectors.toList()); } @Override diff --git a/src/main/java/org/openstreetmap/atlas/geography/atlas/change/MemberMergeStrategies.java b/src/main/java/org/openstreetmap/atlas/geography/atlas/change/MemberMergeStrategies.java index aa7651e123..949b1820ae 100644 --- a/src/main/java/org/openstreetmap/atlas/geography/atlas/change/MemberMergeStrategies.java +++ b/src/main/java/org/openstreetmap/atlas/geography/atlas/change/MemberMergeStrategies.java @@ -278,12 +278,12 @@ public final class MemberMergeStrategies */ final Map removedFromLeftView = computeMapDifferenceCounts( beforeBeanMap, afterLeftBeanMap).entrySet().stream() - .filter(entry -> entry.getValue() > 0) - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + .filter(entry -> entry.getValue() > 0) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); final Map removedFromRightView = computeMapDifferenceCounts( beforeBeanMap, afterRightBeanMap).entrySet().stream() - .filter(entry -> entry.getValue() > 0) - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + .filter(entry -> entry.getValue() > 0) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); /* * Compute the difference set between the afterViews and the beforeView (which is equivalent @@ -292,12 +292,12 @@ public final class MemberMergeStrategies */ final Map addedToLeftView = computeMapDifferenceCounts( afterLeftBeanMap, beforeBeanMap).entrySet().stream() - .filter(entry -> entry.getValue() > 0) - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + .filter(entry -> entry.getValue() > 0) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); final Map addedToRightView = computeMapDifferenceCounts( afterRightBeanMap, beforeBeanMap).entrySet().stream() - .filter(entry -> entry.getValue() > 0) - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + .filter(entry -> entry.getValue() > 0) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); /* * Check for REMOVE/REMOVE conflicts. A REMOVE/REMOVE conflict occurs when diff --git a/src/main/java/org/openstreetmap/atlas/geography/atlas/change/diff/AtlasDiff.java b/src/main/java/org/openstreetmap/atlas/geography/atlas/change/diff/AtlasDiff.java index 6122a039a7..d95818f0c3 100644 --- a/src/main/java/org/openstreetmap/atlas/geography/atlas/change/diff/AtlasDiff.java +++ b/src/main/java/org/openstreetmap/atlas/geography/atlas/change/diff/AtlasDiff.java @@ -142,7 +142,7 @@ public Optional generateChange() */ createFeatureChangesBasedOnEntitySets(addedEntities, removedEntities, potentiallyModifiedEntities, this.before, this.after, this.saveAllGeometries) - .stream().forEach(changeBuilder::add); + .stream().forEach(changeBuilder::add); if (changeBuilder.peekNumberOfChanges() == 0) { diff --git a/src/main/java/org/openstreetmap/atlas/geography/atlas/complete/CompleteArea.java b/src/main/java/org/openstreetmap/atlas/geography/atlas/complete/CompleteArea.java index 32e6b26c41..8a48b99b8d 100644 --- a/src/main/java/org/openstreetmap/atlas/geography/atlas/complete/CompleteArea.java +++ b/src/main/java/org/openstreetmap/atlas/geography/atlas/complete/CompleteArea.java @@ -55,11 +55,11 @@ public static CompleteArea from(final Area area) } return new CompleteArea(area.getIdentifier(), area.asPolygon(), area.getTags(), area.relations().stream().map(Relation::getIdentifier).collect(Collectors.toSet())) - .withGeometricRelationIdentifiers( - area.relations().stream().filter(Relation::isGeometric) - .filter(relation -> relation.asMultiPolygon().isPresent() - && !relation.asMultiPolygon().get().isEmpty()) - .map(Relation::getIdentifier).collect(Collectors.toSet())); + .withGeometricRelationIdentifiers( + area.relations().stream().filter(Relation::isGeometric) + .filter(relation -> relation.asMultiPolygon().isPresent() + && !relation.asMultiPolygon().get().isEmpty()) + .map(Relation::getIdentifier).collect(Collectors.toSet())); } /** diff --git a/src/main/java/org/openstreetmap/atlas/geography/atlas/complete/CompleteEdge.java b/src/main/java/org/openstreetmap/atlas/geography/atlas/complete/CompleteEdge.java index 827c26a613..224e9678ed 100644 --- a/src/main/java/org/openstreetmap/atlas/geography/atlas/complete/CompleteEdge.java +++ b/src/main/java/org/openstreetmap/atlas/geography/atlas/complete/CompleteEdge.java @@ -59,11 +59,11 @@ public static CompleteEdge from(final Edge edge) return new CompleteEdge(edge.getIdentifier(), edge.asPolyLine(), edge.getTags(), edge.start().getIdentifier(), edge.end().getIdentifier(), edge.relations().stream().map(Relation::getIdentifier).collect(Collectors.toSet())) - .withGeometricRelationIdentifiers( - edge.relations().stream().filter(Relation::isGeometric) - .filter(relation -> relation.asMultiPolygon().isPresent() - && !relation.asMultiPolygon().get().isEmpty()) - .map(Relation::getIdentifier).collect(Collectors.toSet())); + .withGeometricRelationIdentifiers( + edge.relations().stream().filter(Relation::isGeometric) + .filter(relation -> relation.asMultiPolygon().isPresent() + && !relation.asMultiPolygon().get().isEmpty()) + .map(Relation::getIdentifier).collect(Collectors.toSet())); } /** diff --git a/src/main/java/org/openstreetmap/atlas/geography/atlas/complete/CompleteLine.java b/src/main/java/org/openstreetmap/atlas/geography/atlas/complete/CompleteLine.java index 6479cd48bb..f51908484a 100644 --- a/src/main/java/org/openstreetmap/atlas/geography/atlas/complete/CompleteLine.java +++ b/src/main/java/org/openstreetmap/atlas/geography/atlas/complete/CompleteLine.java @@ -55,11 +55,11 @@ public static CompleteLine from(final Line line) } return new CompleteLine(line.getIdentifier(), line.asPolyLine(), line.getTags(), line.relations().stream().map(Relation::getIdentifier).collect(Collectors.toSet())) - .withGeometricRelationIdentifiers( - line.relations().stream().filter(Relation::isGeometric) - .filter(relation -> relation.asMultiPolygon().isPresent() - && !relation.asMultiPolygon().get().isEmpty()) - .map(Relation::getIdentifier).collect(Collectors.toSet())); + .withGeometricRelationIdentifiers( + line.relations().stream().filter(Relation::isGeometric) + .filter(relation -> relation.asMultiPolygon().isPresent() + && !relation.asMultiPolygon().get().isEmpty()) + .map(Relation::getIdentifier).collect(Collectors.toSet())); } /** diff --git a/src/main/java/org/openstreetmap/atlas/geography/atlas/dynamic/DynamicAtlasExpander.java b/src/main/java/org/openstreetmap/atlas/geography/atlas/dynamic/DynamicAtlasExpander.java index 9847358c2e..2d0e0a2380 100644 --- a/src/main/java/org/openstreetmap/atlas/geography/atlas/dynamic/DynamicAtlasExpander.java +++ b/src/main/java/org/openstreetmap/atlas/geography/atlas/dynamic/DynamicAtlasExpander.java @@ -604,8 +604,7 @@ private void newShapeLog(final GeometryPrintable geometry, final AtlasEntity... source.length > 0 ? "Atlas " + new StringList(Iterables.stream(Iterables.asList(source)) .map(item -> item.getType() + " " + item.getIdentifier())) - .join(", ") - + " with shape " + .join(", ") + " with shape " : "", geometry.toWkt()); } diff --git a/src/main/java/org/openstreetmap/atlas/geography/atlas/items/complex/boundaries/ComplexBoundary.java b/src/main/java/org/openstreetmap/atlas/geography/atlas/items/complex/boundaries/ComplexBoundary.java index 9033c7b2a5..a077b9e1a0 100644 --- a/src/main/java/org/openstreetmap/atlas/geography/atlas/items/complex/boundaries/ComplexBoundary.java +++ b/src/main/java/org/openstreetmap/atlas/geography/atlas/items/complex/boundaries/ComplexBoundary.java @@ -199,7 +199,8 @@ protected String toString(final String header) this.outline == null ? "MISSING" : this.outline.toReadableString(), new StringList( this.subAreas.stream().map(subArea -> subArea.toString(header + "\t")) - .collect(Collectors.toList())).join("\n")); + .collect(Collectors.toList())) + .join("\n")); } /** diff --git a/src/main/java/org/openstreetmap/atlas/geography/atlas/raw/creation/OsmPbfReader.java b/src/main/java/org/openstreetmap/atlas/geography/atlas/raw/creation/OsmPbfReader.java index b484eb4553..6ff6930b99 100644 --- a/src/main/java/org/openstreetmap/atlas/geography/atlas/raw/creation/OsmPbfReader.java +++ b/src/main/java/org/openstreetmap/atlas/geography/atlas/raw/creation/OsmPbfReader.java @@ -395,10 +395,10 @@ private boolean isInvalidWay(final Way way) return wayNodes.size() < 2 || wayNodes.size() == 2 && wayNodes.get(0).getNodeId() == wayNodes.get(1).getNodeId() - || wayNodes.size() < MINIMUM_CLOSED_WAY_LENGTH - && getNodeLocation(padIdentifier(wayNodes.get(0).getNodeId())) - .equals(getNodeLocation(padIdentifier( - wayNodes.get(wayNodes.size() - 1).getNodeId()))); + || wayNodes.size() < MINIMUM_CLOSED_WAY_LENGTH && getNodeLocation( + padIdentifier(wayNodes.get(0).getNodeId())) + .equals(getNodeLocation( + padIdentifier(wayNodes.get(wayNodes.size() - 1).getNodeId()))); } /** diff --git a/src/main/java/org/openstreetmap/atlas/geography/atlas/raw/sectioning/AtlasSectionProcessor.java b/src/main/java/org/openstreetmap/atlas/geography/atlas/raw/sectioning/AtlasSectionProcessor.java index 59294a8832..c6d36a8b09 100644 --- a/src/main/java/org/openstreetmap/atlas/geography/atlas/raw/sectioning/AtlasSectionProcessor.java +++ b/src/main/java/org/openstreetmap/atlas/geography/atlas/raw/sectioning/AtlasSectionProcessor.java @@ -317,9 +317,8 @@ private Atlas buildExpandedAtlas(final Shard initialShard, final Sharding shardi final DynamicAtlasPolicy policy = new DynamicAtlasPolicy(fullySlicedAtlasFetcher, sharding, initialShard.bounds().expand(SHARD_EXPANSION_DISTANCE), Rectangle.MAXIMUM) - .withDeferredLoading(true).withExtendIndefinitely(false) - .withAtlasEntitiesToConsiderForExpansion( - this.dynamicAtlasExpansionFilter::test); + .withDeferredLoading(true).withExtendIndefinitely(false) + .withAtlasEntitiesToConsiderForExpansion(this.dynamicAtlasExpansionFilter::test); final DynamicAtlas atlas = new DynamicAtlas(policy); atlas.preemptiveLoad(); diff --git a/src/main/java/org/openstreetmap/atlas/tags/filters/ConfiguredTaggableFilter.java b/src/main/java/org/openstreetmap/atlas/tags/filters/ConfiguredTaggableFilter.java index bc27acac46..865b7093c9 100644 --- a/src/main/java/org/openstreetmap/atlas/tags/filters/ConfiguredTaggableFilter.java +++ b/src/main/java/org/openstreetmap/atlas/tags/filters/ConfiguredTaggableFilter.java @@ -26,8 +26,8 @@ public ConfiguredTaggableFilter(final Configuration configuration) { this.filters = ((List) configuration.get(FILTERS_CONFIGURATION_NAME).valueOption() .orElseThrow(() -> new CoreException("No filters defined in configuration {}", - configuration))).stream().map(TaggableFilter::forDefinition) - .collect(Collectors.toList()); + configuration))) + .stream().map(TaggableFilter::forDefinition).collect(Collectors.toList()); } @Override diff --git a/src/main/java/org/openstreetmap/atlas/tags/filters/TaggableFilterToMatcherConverter.java b/src/main/java/org/openstreetmap/atlas/tags/filters/TaggableFilterToMatcherConverter.java index 02787b86be..3d7d29eede 100644 --- a/src/main/java/org/openstreetmap/atlas/tags/filters/TaggableFilterToMatcherConverter.java +++ b/src/main/java/org/openstreetmap/atlas/tags/filters/TaggableFilterToMatcherConverter.java @@ -39,7 +39,7 @@ protected static String toTaggableMatcherDefinition(final TaggableFilter filter) + new StringList(filter.getChildren().stream() .map(TaggableFilterToMatcherConverter::toTaggableMatcherDefinition) .collect(Collectors.toList())) - .join(" " + filter.getTreeBoolean().separator() + " ") + .join(" " + filter.getTreeBoolean().separator() + " ") + Token.TokenType.PAREN_CLOSE.getLiteralValue(); } diff --git a/src/main/java/org/openstreetmap/atlas/tags/filters/matcher/ConfiguredTaggableMatcher.java b/src/main/java/org/openstreetmap/atlas/tags/filters/matcher/ConfiguredTaggableMatcher.java index 5198417af5..f5d826edbb 100644 --- a/src/main/java/org/openstreetmap/atlas/tags/filters/matcher/ConfiguredTaggableMatcher.java +++ b/src/main/java/org/openstreetmap/atlas/tags/filters/matcher/ConfiguredTaggableMatcher.java @@ -27,8 +27,8 @@ public ConfiguredTaggableMatcher(final Configuration configuration) { this.matchers = ((List) configuration.get(MATCHERS_CONFIGURATION_NAME).valueOption() .orElseThrow(() -> new CoreException("No matchers defined in configuration {}", - configuration))).stream().map(TaggableMatcher::from) - .collect(Collectors.toList()); + configuration))) + .stream().map(TaggableMatcher::from).collect(Collectors.toList()); } @Override diff --git a/src/main/java/org/openstreetmap/atlas/utilities/command/subcommands/templates/ListOfNumbersTemplate.java b/src/main/java/org/openstreetmap/atlas/utilities/command/subcommands/templates/ListOfNumbersTemplate.java index 18750839a5..09d44eba4f 100644 --- a/src/main/java/org/openstreetmap/atlas/utilities/command/subcommands/templates/ListOfNumbersTemplate.java +++ b/src/main/java/org/openstreetmap/atlas/utilities/command/subcommands/templates/ListOfNumbersTemplate.java @@ -82,7 +82,7 @@ public void registerManualPageSections(final AbstractAtlasShellToolsCommand pare new ByteArrayInputStream( ("This is an example man page section for the ListOfNumbersTemplate! " + "This template adds an option that reads a list of numbers.") - .getBytes(StandardCharsets.UTF_8))); + .getBytes(StandardCharsets.UTF_8))); } @Override diff --git a/src/test/java/org/openstreetmap/atlas/geography/RectangleTest.java b/src/test/java/org/openstreetmap/atlas/geography/RectangleTest.java index 9496c1f643..cd7608a106 100644 --- a/src/test/java/org/openstreetmap/atlas/geography/RectangleTest.java +++ b/src/test/java/org/openstreetmap/atlas/geography/RectangleTest.java @@ -101,7 +101,7 @@ public void testContract() Assert.assertEquals(Math.round(contractRectangle1Distance.asMeters()), Math.round(new Location(this.rectangle1.lowerLeft().getLatitude(), collapsedHorizontally.middle().getLongitude()) - .distanceTo(collapsedHorizontally.lowerLeft()).asMeters())); + .distanceTo(collapsedHorizontally.lowerLeft()).asMeters())); // test collapse vertically final Location rectangle2UpperLeft = Iterables.asList(this.rectangle2).get(1); @@ -114,7 +114,7 @@ public void testContract() Assert.assertEquals(Math.round(contractRectangle2Distance.asMeters()), Math.round(new Location(collapsedVertically.middle().getLatitude(), this.rectangle2.lowerLeft().getLongitude()) - .distanceTo(collapsedVertically.lowerLeft()).asMeters())); + .distanceTo(collapsedVertically.lowerLeft()).asMeters())); // Test fully collapse Collapsed Assert.assertEquals(this.rectangle1.center().bounds(), diff --git a/src/test/java/org/openstreetmap/atlas/geography/atlas/change/ChangeAtlasTest.java b/src/test/java/org/openstreetmap/atlas/geography/atlas/change/ChangeAtlasTest.java index 2157add5ba..55cf7d170f 100644 --- a/src/test/java/org/openstreetmap/atlas/geography/atlas/change/ChangeAtlasTest.java +++ b/src/test/java/org/openstreetmap/atlas/geography/atlas/change/ChangeAtlasTest.java @@ -62,7 +62,7 @@ public class ChangeAtlasTest boundary = CountryBoundaryMap .fromPlainText(new InputStreamResource(() -> RawAtlasSlicerTest.class .getResourceAsStream("CIV_GIN_LBR_osm_boundaries.txt.gz")) - .withDecompressor(Decompressor.GZIP)); + .withDecompressor(Decompressor.GZIP)); } @Rule diff --git a/src/test/java/org/openstreetmap/atlas/geography/atlas/change/FeatureChangeMergerTest.java b/src/test/java/org/openstreetmap/atlas/geography/atlas/change/FeatureChangeMergerTest.java index d3afd6854f..5412a7f9dd 100644 --- a/src/test/java/org/openstreetmap/atlas/geography/atlas/change/FeatureChangeMergerTest.java +++ b/src/test/java/org/openstreetmap/atlas/geography/atlas/change/FeatureChangeMergerTest.java @@ -50,7 +50,7 @@ public void testBeforeViewAreaMerge() null).withBoundsExtendedBy(Polygon.SILICON_VALLEY.bounds()); final CompleteArea after1 = new CompleteArea(123L, null, Maps.hashMap("a", "1", "b", "2", "c", "3"), null) - .withBoundsExtendedBy(Polygon.SILICON_VALLEY.bounds()); + .withBoundsExtendedBy(Polygon.SILICON_VALLEY.bounds()); final CompleteArea before2 = new CompleteArea(123L, Polygon.SILICON_VALLEY, null, null); final CompleteArea after2 = new CompleteArea(123L, Polygon.SILICON_VALLEY_2, null, null); @@ -72,7 +72,7 @@ public void testBeforeViewEdgeMerge() null, null, null).withBoundsExtendedBy(PolyLine.TEST_POLYLINE.bounds()); final CompleteEdge after1 = new CompleteEdge(123L, null, Maps.hashMap("a", "1", "b", "2", "c", "3"), null, null, null) - .withBoundsExtendedBy(PolyLine.TEST_POLYLINE.bounds()); + .withBoundsExtendedBy(PolyLine.TEST_POLYLINE.bounds()); final CompleteEdge before2 = new CompleteEdge(123L, PolyLine.TEST_POLYLINE, null, null, null, null); final CompleteEdge after2 = new CompleteEdge(123L, PolyLine.TEST_POLYLINE_2, null, null, @@ -96,7 +96,7 @@ public void testBeforeViewLineMerge() null).withBoundsExtendedBy(PolyLine.TEST_POLYLINE.bounds()); final CompleteLine after1 = new CompleteLine(123L, null, Maps.hashMap("a", "1", "b", "2", "c", "3"), null) - .withBoundsExtendedBy(PolyLine.TEST_POLYLINE.bounds()); + .withBoundsExtendedBy(PolyLine.TEST_POLYLINE.bounds()); final CompleteLine before2 = new CompleteLine(123L, PolyLine.TEST_POLYLINE, null, null); final CompleteLine after2 = new CompleteLine(123L, PolyLine.TEST_POLYLINE_2, null, null); @@ -118,7 +118,7 @@ public void testBeforeViewNodeMerge() null, null, null).withBoundsExtendedBy(Location.TEST_1.bounds()); final CompleteNode after1 = new CompleteNode(123L, null, Maps.hashMap("a", "1", "b", "2", "c", "3"), null, null, null) - .withBoundsExtendedBy(Location.TEST_1.bounds()); + .withBoundsExtendedBy(Location.TEST_1.bounds()); final CompleteNode before2 = new CompleteNode(123L, Location.TEST_1, null, null, null, null); final CompleteNode after2 = new CompleteNode(123L, Location.TEST_2, null, null, null, null); @@ -139,10 +139,10 @@ public void testBeforeViewPointMerge() { final CompletePoint before1 = new CompletePoint(123L, null, Maps.hashMap("a", "1", "b", "2"), null) - .withBoundsExtendedBy(Location.TEST_1.bounds()); + .withBoundsExtendedBy(Location.TEST_1.bounds()); final CompletePoint after1 = new CompletePoint(123L, null, Maps.hashMap("a", "1", "b", "2", "c", "3"), null) - .withBoundsExtendedBy(Location.TEST_1.bounds()); + .withBoundsExtendedBy(Location.TEST_1.bounds()); final CompletePoint before2 = new CompletePoint(123L, Location.TEST_1, null, null); final CompletePoint after2 = new CompletePoint(123L, Location.TEST_2, null, null); diff --git a/src/test/java/org/openstreetmap/atlas/geography/atlas/dynamic/DynamicAtlasPreemptiveLoadTest.java b/src/test/java/org/openstreetmap/atlas/geography/atlas/dynamic/DynamicAtlasPreemptiveLoadTest.java index adff84a28e..7f438eab79 100644 --- a/src/test/java/org/openstreetmap/atlas/geography/atlas/dynamic/DynamicAtlasPreemptiveLoadTest.java +++ b/src/test/java/org/openstreetmap/atlas/geography/atlas/dynamic/DynamicAtlasPreemptiveLoadTest.java @@ -44,7 +44,7 @@ public class DynamicAtlasPreemptiveLoadTest return Optional.empty(); } }, new SlippyTileSharding(9), INITIAL_SHARD, Rectangle.MAXIMUM) - .withDeferredLoading(true).withExtendIndefinitely(false); + .withDeferredLoading(true).withExtendIndefinitely(false); private final Supplier allInitialShardsPolicySupplier = () -> new DynamicAtlasPolicy( shard -> { @@ -72,34 +72,34 @@ public class DynamicAtlasPreemptiveLoadTest return Optional.empty(); } }, new SlippyTileSharding(9), INITIAL_SHARD, Rectangle.MAXIMUM) - .withDeferredLoading(true).withExtendIndefinitely(true) - .withAtlasEntitiesToConsiderForExpansion(new Predicate<>() - { - private final Map identifiersChecked = new HashMap<>(); + .withDeferredLoading(true).withExtendIndefinitely(true) + .withAtlasEntitiesToConsiderForExpansion(new Predicate<>() + { + private final Map identifiersChecked = new HashMap<>(); - @Override - public boolean test(final AtlasEntity atlasEntity) + @Override + public boolean test(final AtlasEntity atlasEntity) + { + final AtlasEntityKey key = AtlasEntityKey.from(atlasEntity.getType(), + atlasEntity.getIdentifier()); + if (this.identifiersChecked.containsKey(key) + && this.identifiersChecked.get(key) > 9) + { + throw new CoreException("Checked {} {} times!", key, + this.identifiersChecked.get(key)); + } + else + { + int newCount = 1; + if (this.identifiersChecked.containsKey(key)) { - final AtlasEntityKey key = AtlasEntityKey.from(atlasEntity.getType(), - atlasEntity.getIdentifier()); - if (this.identifiersChecked.containsKey(key) - && this.identifiersChecked.get(key) > 9) - { - throw new CoreException("Checked {} {} times!", key, - this.identifiersChecked.get(key)); - } - else - { - int newCount = 1; - if (this.identifiersChecked.containsKey(key)) - { - newCount += this.identifiersChecked.get(key); - } - this.identifiersChecked.put(key, newCount); - } - return true; + newCount += this.identifiersChecked.get(key); } - }); + this.identifiersChecked.put(key, newCount); + } + return true; + } + }); @Test public void loadPreemptivelyCapExpansionCheckTest() diff --git a/src/test/java/org/openstreetmap/atlas/geography/atlas/items/complex/restriction/ComplexTurnRestrictionTest.java b/src/test/java/org/openstreetmap/atlas/geography/atlas/items/complex/restriction/ComplexTurnRestrictionTest.java index 40b89d2c60..802b3f86f0 100644 --- a/src/test/java/org/openstreetmap/atlas/geography/atlas/items/complex/restriction/ComplexTurnRestrictionTest.java +++ b/src/test/java/org/openstreetmap/atlas/geography/atlas/items/complex/restriction/ComplexTurnRestrictionTest.java @@ -43,7 +43,7 @@ public void testBigNodeWithNoRestrictions() { final Atlas atlas = new TextAtlasBuilder().read(new InputStreamResource( () -> ComplexTurnRestrictionTest.class.getResourceAsStream("bigNode.txt.gz")) - .withDecompressor(Decompressor.GZIP).withName("bigNode.txt.gz")); + .withDecompressor(Decompressor.GZIP).withName("bigNode.txt.gz")); final List bigNodes = Iterables.asList(new BigNodeFinder().find(atlas)); diff --git a/src/test/java/org/openstreetmap/atlas/geography/atlas/raw/sectioning/AtlasSectionProcessorTest.java b/src/test/java/org/openstreetmap/atlas/geography/atlas/raw/sectioning/AtlasSectionProcessorTest.java index 843542489c..6399d94c3d 100644 --- a/src/test/java/org/openstreetmap/atlas/geography/atlas/raw/sectioning/AtlasSectionProcessorTest.java +++ b/src/test/java/org/openstreetmap/atlas/geography/atlas/raw/sectioning/AtlasSectionProcessorTest.java @@ -42,7 +42,7 @@ public class AtlasSectionProcessorTest COUNTRY_BOUNDARY_MAP = CountryBoundaryMap .fromPlainText(new InputStreamResource(() -> RawAtlasSlicerTest.class .getResourceAsStream("CIV_GIN_LBR_osm_boundaries.txt.gz")) - .withDecompressor(Decompressor.GZIP)); + .withDecompressor(Decompressor.GZIP)); } @Rule diff --git a/src/test/java/org/openstreetmap/atlas/geography/atlas/raw/slicing/RawAtlasSlicerTest.java b/src/test/java/org/openstreetmap/atlas/geography/atlas/raw/slicing/RawAtlasSlicerTest.java index 0afba288d5..d4f1da436d 100644 --- a/src/test/java/org/openstreetmap/atlas/geography/atlas/raw/slicing/RawAtlasSlicerTest.java +++ b/src/test/java/org/openstreetmap/atlas/geography/atlas/raw/slicing/RawAtlasSlicerTest.java @@ -43,7 +43,7 @@ public class RawAtlasSlicerTest boundary = CountryBoundaryMap .fromPlainText(new InputStreamResource(() -> RawAtlasSlicerTest.class .getResourceAsStream("CIV_GIN_LBR_osm_boundaries.txt.gz")) - .withDecompressor(Decompressor.GZIP)); + .withDecompressor(Decompressor.GZIP)); } @Rule diff --git a/src/test/java/org/openstreetmap/atlas/geography/boundary/CountryBoundaryMapTest.java b/src/test/java/org/openstreetmap/atlas/geography/boundary/CountryBoundaryMapTest.java index 0544dc174e..9d73062cfa 100644 --- a/src/test/java/org/openstreetmap/atlas/geography/boundary/CountryBoundaryMapTest.java +++ b/src/test/java/org/openstreetmap/atlas/geography/boundary/CountryBoundaryMapTest.java @@ -50,7 +50,7 @@ public void testAntiMeridian() final CountryBoundaryMap map = CountryBoundaryMap .fromPlainText(new InputStreamResource(() -> CountryBoundaryMapTest.class .getResourceAsStream("HTI_DOM_osm_boundaries.txt.gz")) - .withDecompressor(Decompressor.GZIP)); + .withDecompressor(Decompressor.GZIP)); final LineString lineString = (LineString) TestUtility .createJtsGeometryFromWKT("LINESTRING ( -179 18.84927, 179 18.84927 )"); @@ -85,7 +85,7 @@ public void testBoundaryLoading() throws ParseException { final CountryBoundaryMap map = CountryBoundaryMap.fromPlainText(new InputStreamResource( () -> CountryBoundaryMapTest.class.getResourceAsStream("CIV_osm_boundaries.txt.gz")) - .withDecompressor(Decompressor.GZIP)); + .withDecompressor(Decompressor.GZIP)); Assert.assertEquals("CIV", firstCountryName(map)); final Location locationInsideInner1 = Location.forString("4.5847047, -7.573053"); @@ -122,7 +122,7 @@ public void testExtensionBoundariesFilter() final CountryBoundaryMap map = CountryBoundaryMap .fromPlainText(new InputStreamResource(() -> CountryBoundaryMapTest.class .getResourceAsStream("MAF_AIA_osm_boundaries_with_grid_index.txt.gz")) - .withDecompressor(Decompressor.GZIP)); + .withDecompressor(Decompressor.GZIP)); final PolyLine line = PolyLine.wkt( "LINESTRING(-63.069960775034794 18.20724437315409,-63.056442441599735 18.203616100626693,-63.058416547434696 18.211076399156397)"); @@ -140,7 +140,7 @@ public void testFeatureCrossingCountryBoundary() throws ParseException final CountryBoundaryMap map = CountryBoundaryMap .fromPlainText(new InputStreamResource(() -> CountryBoundaryMapTest.class .getResourceAsStream("HTI_DOM_osm_boundaries.txt.gz")) - .withDecompressor(Decompressor.GZIP)); + .withDecompressor(Decompressor.GZIP)); final WKTReader reader = new WKTReader(); final PackedAtlasBuilder builder = new PackedAtlasBuilder(); @@ -166,7 +166,7 @@ public void testFeatureRightByCountryBoundary() throws ParseException final CountryBoundaryMap map = CountryBoundaryMap .fromPlainText(new InputStreamResource(() -> CountryBoundaryMapTest.class .getResourceAsStream("HTI_DOM_osm_boundaries.txt.gz")) - .withDecompressor(Decompressor.GZIP)); + .withDecompressor(Decompressor.GZIP)); // Slice a line along the border final PolyLine geometry = PolyLine.wkt( @@ -212,7 +212,7 @@ public void testGetCountryCode() final CountryBoundaryMap map = CountryBoundaryMap .fromPlainText(new InputStreamResource(() -> CountryBoundaryMapTest.class .getResourceAsStream("HTI_DOM_osm_boundaries.txt.gz")) - .withDecompressor(Decompressor.GZIP)); + .withDecompressor(Decompressor.GZIP)); Point point = JTS_POINT_CONVERTER .convert(Location.forString("19.068387997775737, -71.7029007844633")); diff --git a/src/test/java/org/openstreetmap/atlas/geography/boundary/CountryShardListingTest.java b/src/test/java/org/openstreetmap/atlas/geography/boundary/CountryShardListingTest.java index 9619398939..2585ff354d 100644 --- a/src/test/java/org/openstreetmap/atlas/geography/boundary/CountryShardListingTest.java +++ b/src/test/java/org/openstreetmap/atlas/geography/boundary/CountryShardListingTest.java @@ -25,7 +25,7 @@ public void testMultiPolygonBoundary() final CountryBoundaryMap boundaries = CountryBoundaryMap .fromPlainText(new InputStreamResource(() -> CountryShardListingTest.class .getResourceAsStream("ZAF_osm_boundary.txt.gz")) - .withDecompressor(Decompressor.GZIP)); + .withDecompressor(Decompressor.GZIP)); final Sharding sharding = Sharding.forString("dynamic@" + CountryShardListingTest.class.getResource("tree-6-14-100000.txt.gz").getPath()); final MultiMapWithSet shardSetPerCountry = CountryShardListing @@ -51,7 +51,7 @@ public void testSmallCountry() final CountryBoundaryMap boundaries = CountryBoundaryMap .fromPlainText(new InputStreamResource(() -> CountryShardListingTest.class .getResourceAsStream("DMA_as_world_osm_boundaries.txt.gz")) - .withDecompressor(Decompressor.GZIP)); + .withDecompressor(Decompressor.GZIP)); final Sharding sharding = Sharding.forString("dynamic@" + CountryShardListingTest.class.getResource("tree-6-13-100000.txt.gz").getPath()); final MultiMapWithSet shardSetPerCountry = CountryShardListing diff --git a/src/test/java/org/openstreetmap/atlas/geography/converters/MultiplePolyLineToPolygonsConverterTest.java b/src/test/java/org/openstreetmap/atlas/geography/converters/MultiplePolyLineToPolygonsConverterTest.java index a09b056811..0e97947aea 100644 --- a/src/test/java/org/openstreetmap/atlas/geography/converters/MultiplePolyLineToPolygonsConverterTest.java +++ b/src/test/java/org/openstreetmap/atlas/geography/converters/MultiplePolyLineToPolygonsConverterTest.java @@ -166,13 +166,16 @@ public void testJtsException() final List list = new ArrayList<>(); list.add(PolyLine.wkt(new InputStreamResource( () -> MultiplePolyLineToPolygonsConverterTest.class.getResourceAsStream( - "MultiplePolyLineToPolygonsConverterTest_jtsErrorOuter.wkt")).all())); + "MultiplePolyLineToPolygonsConverterTest_jtsErrorOuter.wkt")) + .all())); list.add(PolyLine.wkt(new InputStreamResource( () -> MultiplePolyLineToPolygonsConverterTest.class.getResourceAsStream( - "MultiplePolyLineToPolygonsConverterTest_jtsErrorInner1.wkt")).all())); + "MultiplePolyLineToPolygonsConverterTest_jtsErrorInner1.wkt")) + .all())); list.add(PolyLine.wkt(new InputStreamResource( () -> MultiplePolyLineToPolygonsConverterTest.class.getResourceAsStream( - "MultiplePolyLineToPolygonsConverterTest_jtsErrorInner2.wkt")).all())); + "MultiplePolyLineToPolygonsConverterTest_jtsErrorInner2.wkt")) + .all())); Assert.assertEquals(3, Iterables.size(CONVERTER.convert(list))); } @@ -237,13 +240,13 @@ public void testSingleClosedPolyLineWithinGroup() final List input = new InputStreamResource( () -> MultiplePolyLineToPolygonsConverterTest.class.getResourceAsStream( "MultiplePolyLineToPolygonsConverterTest_multiplePolyLines.txt")) - .linesList().stream().map(WKT_POLY_LINE_CONVERTER::backwardConvert) - .collect(Collectors.toList()); + .linesList().stream().map(WKT_POLY_LINE_CONVERTER::backwardConvert) + .collect(Collectors.toList()); final List expected = new InputStreamResource( () -> MultiplePolyLineToPolygonsConverterTest.class.getResourceAsStream( - "MultiplePolyLineToPolygonsConverterTest_expectedPolygons.txt")).linesList() - .stream().map(WKT_POLYGON_CONVERTER::backwardConvert) - .collect(Collectors.toList()); + "MultiplePolyLineToPolygonsConverterTest_expectedPolygons.txt")) + .linesList().stream().map(WKT_POLYGON_CONVERTER::backwardConvert) + .collect(Collectors.toList()); Iterables.asList(CONVERTER.convert(input)).forEach(System.out::println); Assert.assertEquals(expected.stream().map(Polygon::length).collect(Collectors.toList()), Iterables.asList(CONVERTER.convert(input)).stream().map(Polygon::length) diff --git a/src/test/java/org/openstreetmap/atlas/geography/geojson/parser/impl/jackson/GeoJsonParserJacksonImplTest.java b/src/test/java/org/openstreetmap/atlas/geography/geojson/parser/impl/jackson/GeoJsonParserJacksonImplTest.java index ece717cc7e..e1dc9b7972 100644 --- a/src/test/java/org/openstreetmap/atlas/geography/geojson/parser/impl/jackson/GeoJsonParserJacksonImplTest.java +++ b/src/test/java/org/openstreetmap/atlas/geography/geojson/parser/impl/jackson/GeoJsonParserJacksonImplTest.java @@ -146,7 +146,7 @@ public void geometryCollectionRecursiveNested() final int innermostLevelSize = (((GeometryCollection) ((GeometryCollection) ((GeometryCollection) ((GeometryCollection) geoJsonItem) .getGeometries().get(3)).getGeometries().get(3)).getGeometries().get(3))) - .getGeometries().size(); + .getGeometries().size(); Assert.assertEquals(3, innermostLevelSize); } diff --git a/src/test/java/org/openstreetmap/atlas/tags/LocalizedTaggableTestCase.java b/src/test/java/org/openstreetmap/atlas/tags/LocalizedTaggableTestCase.java index c0f28e3221..5b78c7cc1e 100644 --- a/src/test/java/org/openstreetmap/atlas/tags/LocalizedTaggableTestCase.java +++ b/src/test/java/org/openstreetmap/atlas/tags/LocalizedTaggableTestCase.java @@ -78,8 +78,8 @@ public void findRussianName() public void findRussianNameFromRussianAndDefaults() { final Optional value = new TestTaggable( - Maps.hashMap(NameTag.KEY + ":ru", "dah", NameTag.KEY, "nyet")).getTag(NameTag.class, - Optional.of(IsoLanguage.forLanguageCode("ru").get())); + Maps.hashMap(NameTag.KEY + ":ru", "dah", NameTag.KEY, "nyet")) + .getTag(NameTag.class, Optional.of(IsoLanguage.forLanguageCode("ru").get())); Assert.assertTrue(value.isPresent()); Assert.assertEquals("dah", value.get()); } diff --git a/src/test/java/org/openstreetmap/atlas/utilities/caching/strategies/NamespaceCachingStrategiesTest.java b/src/test/java/org/openstreetmap/atlas/utilities/caching/strategies/NamespaceCachingStrategiesTest.java index b169b47810..3df51652b9 100644 --- a/src/test/java/org/openstreetmap/atlas/utilities/caching/strategies/NamespaceCachingStrategiesTest.java +++ b/src/test/java/org/openstreetmap/atlas/utilities/caching/strategies/NamespaceCachingStrategiesTest.java @@ -257,6 +257,6 @@ private void setupFilesystem1(final FileSystem filesystem) */ gzippedFile.copyFrom(new InputStreamResource( () -> NamespaceCachingStrategiesTest.class.getResourceAsStream("hello.txt.gz")) - .withDecompressor(Decompressor.GZIP)); + .withDecompressor(Decompressor.GZIP)); } } diff --git a/src/test/java/org/openstreetmap/atlas/utilities/command/subcommands/CountryBoundaryMapPrinterCommandTest.java b/src/test/java/org/openstreetmap/atlas/utilities/command/subcommands/CountryBoundaryMapPrinterCommandTest.java index 97c51646f6..c0197ae493 100644 --- a/src/test/java/org/openstreetmap/atlas/utilities/command/subcommands/CountryBoundaryMapPrinterCommandTest.java +++ b/src/test/java/org/openstreetmap/atlas/utilities/command/subcommands/CountryBoundaryMapPrinterCommandTest.java @@ -29,7 +29,8 @@ public void testCommandWithInputFile() .withCompressor(Compressor.GZIP); inputText.writeAndClose(new InputStreamResource( () -> CountryBoundaryMapPrinterCommandTest.class.getResourceAsStream( - "CountryBoundaryMapPrinterCommandTestBoundaries.txt")).all()); + "CountryBoundaryMapPrinterCommandTestBoundaries.txt")) + .all()); final ByteArrayOutputStream outContent = new ByteArrayOutputStream(); final CountryBoundaryMapPrinterCommand command = new CountryBoundaryMapPrinterCommand(); command.setNewFileSystem(filesystem); diff --git a/src/test/java/org/openstreetmap/atlas/utilities/command/subcommands/JavaToProtoSerializationCommandTest.java b/src/test/java/org/openstreetmap/atlas/utilities/command/subcommands/JavaToProtoSerializationCommandTest.java index 2231673eff..f626da12dd 100644 --- a/src/test/java/org/openstreetmap/atlas/utilities/command/subcommands/JavaToProtoSerializationCommandTest.java +++ b/src/test/java/org/openstreetmap/atlas/utilities/command/subcommands/JavaToProtoSerializationCommandTest.java @@ -47,7 +47,7 @@ public void test() Assert.assertEquals(PackedAtlas.AtlasSerializationFormat.PROTOBUF, ((PackedAtlas) new AtlasResourceLoader() .load(new File("/work/java-atlas.atlas", filesystem))) - .getSerializationFormat()); + .getSerializationFormat()); } catch (final IOException exception) @@ -112,7 +112,7 @@ public void testReverse() Assert.assertEquals(PackedAtlas.AtlasSerializationFormat.JAVA, ((PackedAtlas) new AtlasResourceLoader() .load(new File("/work/proto-atlas.atlas", filesystem))) - .getSerializationFormat()); + .getSerializationFormat()); } catch (final IOException exception) { diff --git a/src/test/java/org/openstreetmap/atlas/utilities/identifiers/EntityIdentifierGeneratorTest.java b/src/test/java/org/openstreetmap/atlas/utilities/identifiers/EntityIdentifierGeneratorTest.java index e5d2db8e6a..9ce8ea1c0d 100644 --- a/src/test/java/org/openstreetmap/atlas/utilities/identifiers/EntityIdentifierGeneratorTest.java +++ b/src/test/java/org/openstreetmap/atlas/utilities/identifiers/EntityIdentifierGeneratorTest.java @@ -33,7 +33,8 @@ public void testEmptyConfigException() Assert.assertTrue((new EntityIdentifierGenerator.Configuration().getGenerator() .getBasicPropertyString(point) + new EntityIdentifierGenerator.Configuration().getGenerator() - .getTypeSpecificPropertyString(point)).isEmpty()); + .getTypeSpecificPropertyString(point)) + .isEmpty()); this.expectedException.expect(CoreException.class); this.expectedException.expectMessage(