Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spotless Plugin Update #694

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
id 'signing'
id 'checkstyle'
id 'jacoco'
id "com.diffplug.gradle.spotless" version "3.27.0"
id "com.diffplug.spotless" version "6.18.0"
id 'org.sonarqube' version '2.8'
// id "io.codearte.nexus-staging" version "0.12.0"
id 'com.github.johnrengelman.shadow' version '5.0.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public void start(final CommandMap commandMap)
EventService.get(country)
.register(new CheckFlagTippecanoeProcessor(fileHelper,
tippecanoeOutput.getTemporaryPath())
.withCompression(compressOutput));
.withCompression(compressOutput));
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,8 @@ private FlatMapFunction<ShardedCheckFlagsTask, UniqueCheckFlagContainer> produce
final DynamicAtlasPolicy policy = new DynamicAtlasPolicy(fetcher,
sharding.getValue(), Collections.singleton(task.getShard()),
task.getShard().bounds().expand(shardDistanceExpansion))
.withDeferredLoading(true).withAggressivelyExploreRelations(true)
.withExtendIndefinitely(false);
.withDeferredLoading(true).withAggressivelyExploreRelations(true)
.withExtendIndefinitely(false);
atlas = new DynamicAtlas(policy);
((DynamicAtlas) atlas).preemptiveLoad();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,10 @@ protected Optional<CheckFlag> flag(final AtlasObject object)
.map(toFlag -> FeatureChange.add(
(AtlasEntity) ((CompleteEntity) CompleteEntity
.shallowFrom((AtlasEntity) toFlag))
.withTags(toFlag.getTags())
.withReplacedTag(HighwayTag.KEY,
HighwayTag.KEY,
HighwayTag.PEDESTRIAN
.getTagValue()),
.withTags(toFlag.getTags()).withReplacedTag(
HighwayTag.KEY, HighwayTag.KEY,
HighwayTag.PEDESTRIAN
.getTagValue()),
object.getAtlas()))
.collect(Collectors.toSet()));
}
Expand All @@ -104,8 +103,8 @@ protected Optional<CheckFlag> flag(final AtlasObject object)
.map(toFlag -> FeatureChange.add(
(AtlasEntity) ((CompleteEntity) CompleteEntity
.shallowFrom((AtlasEntity) toFlag))
.withTags(toFlag.getTags())
.withRemovedTag(AreaTag.KEY),
.withTags(toFlag.getTags())
.withRemovedTag(AreaTag.KEY),
object.getAtlas()))
.collect(Collectors.toSet()));
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,17 +230,14 @@ private Optional<CheckFlag> flagIncorrectlyTagged(final AtlasObject object)
.addFixSuggestion(FeatureChange.add(
(AtlasEntity) ((CompleteEntity) CompleteEntity
.from((AtlasEntity) object))
.withTags(object.getTags())
.withReplacedTag(RailwayTag.KEY,
RailwayTag.KEY,
RailwayTag.CROSSING.name()
.toLowerCase().intern())
.withAddedTag(BicycleTag.KEY,
BicycleTag.YES.toString()
.toLowerCase())
.withAddedTag(FootTag.KEY,
FootTag.NO.toString()
.toLowerCase()),
.withTags(object.getTags())
.withReplacedTag(RailwayTag.KEY, RailwayTag.KEY,
RailwayTag.CROSSING.name().toLowerCase()
.intern())
.withAddedTag(BicycleTag.KEY,
BicycleTag.YES.toString().toLowerCase())
.withAddedTag(FootTag.KEY,
FootTag.NO.toString().toLowerCase()),
object.getAtlas())));
case NODE_PED_ONLY_HIGHWAY:
return Optional.of(this
Expand All @@ -249,14 +246,15 @@ private Optional<CheckFlag> flagIncorrectlyTagged(final AtlasObject object)
NODE_INVALID_LC_TAG_PED_ONLY_HIGHWAY_INDEX,
object.getOsmIdentifier(), this.railwayTagKey,
this.railwayTagValue))
.addFixSuggestion(FeatureChange.add(
(AtlasEntity) ((CompleteEntity) CompleteEntity
.from((AtlasEntity) object))
.addFixSuggestion(
FeatureChange.add(
(AtlasEntity) ((CompleteEntity) CompleteEntity
.from((AtlasEntity) object))
.withTags(object.getTags()).withReplacedTag(
RailwayTag.KEY, RailwayTag.KEY,
RailwayTag.CROSSING.name()
.toLowerCase().intern()),
object.getAtlas())));
object.getAtlas())));
case NODE_NO_RAILWAY:
instructIndex = NODE_INVALID_LC_TAG_NO_RAILWAY_INDEX;
break;
Expand All @@ -283,22 +281,23 @@ private Optional<CheckFlag> flagIncorrectlyTagged(final AtlasObject object)
.createFlag(object,
this.getLocalizedInstruction(NODE_CROSSING_MISSING_LC_TAG_INDEX,
object.getOsmIdentifier(), this.railwayTagKey))
.addFixSuggestion(FeatureChange.add(
(AtlasEntity) ((CompleteEntity) CompleteEntity
.from((AtlasEntity) object)).withTags(object.getTags())
.withReplacedTag(RailwayTag.KEY,
this.railwayTagKey,
.addFixSuggestion(
FeatureChange.add(
(AtlasEntity) ((CompleteEntity) CompleteEntity
.from((AtlasEntity) object))
.withTags(object.getTags()).withReplacedTag(
RailwayTag.KEY, this.railwayTagKey,
this.railwayTagValue),
object.getAtlas())));
object.getAtlas())));
}
return Optional.of(this
.createFlag(object,
this.getLocalizedInstruction(NODE_MISSING_LC_TAG_INDEX,
object.getOsmIdentifier(), this.railwayTagKey))
.addFixSuggestion(FeatureChange.add(
(AtlasEntity) ((CompleteEntity) CompleteEntity
.from((AtlasEntity) object)).withAddedTag(
this.railwayTagKey, this.railwayTagValue),
.from((AtlasEntity) object))
.withAddedTag(this.railwayTagKey, this.railwayTagValue),
object.getAtlas())));

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,18 @@ protected Optional<CheckFlag> flag(final AtlasObject object)
roundaboutEdgeSet.forEach(
roundaboutEdge -> this.markAsFlagged(roundaboutEdge.getIdentifier()));

return Optional.of(this
.createFlag(new OsmWayWalker((Edge) object).collectEdges(),
return Optional
.of(this.createFlag(new OsmWayWalker((Edge) object).collectEdges(),
this.getLocalizedInstruction(1, object.getOsmIdentifier()))
.addFixSuggestion(
FeatureChange.add(
(AtlasEntity) ((CompleteEntity) CompleteEntity
.from((AtlasEntity) object)).withGeometry(
CommonMethods.buildOriginalOsmWayGeometry(
(Edge) object).reversed()),
object.getAtlas())));
.addFixSuggestion(
FeatureChange.add(
(AtlasEntity) ((CompleteEntity) CompleteEntity
.from((AtlasEntity) object))
.withGeometry(CommonMethods
.buildOriginalOsmWayGeometry(
(Edge) object)
.reversed()),
object.getAtlas())));
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected Optional<CheckFlag> flag(final AtlasObject object)
return fixSuggestion.map(suggestion -> flag.addFixSuggestion(FeatureChange.add(
(AtlasEntity) ((CompleteEntity) CompleteEntity
.shallowFrom((AtlasEntity) object)).withTags(object.getTags())
.withReplacedTag(HighwayTag.KEY, HighwayTag.KEY, suggestion),
.withReplacedTag(HighwayTag.KEY, HighwayTag.KEY, suggestion),
object.getAtlas()))).or(() -> Optional.of(flag));
}
return Optional.empty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,10 @@ protected Optional<CheckFlag> flag(final AtlasObject object)
.addFixSuggestion(FeatureChange.add(
(AtlasEntity) ((CompleteEntity) CompleteEntity
.from((AtlasEntity) object))
.withTags(object.getTags())
.withReplacedTag(AddressStreetTag.KEY,
AddressStreetTag.KEY,
this.updateStreetAddress(
splitStreetName,
roadTypeIndex,
listEntry.getKey())),
.withTags(object.getTags()).withReplacedTag(
AddressStreetTag.KEY, AddressStreetTag.KEY,
this.updateStreetAddress(splitStreetName,
roadTypeIndex, listEntry.getKey())),
object.getAtlas())));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,13 @@ protected Optional<CheckFlag> flag(final AtlasObject object)
final String nameSuggestion = matchingInAndOutEdgeNames.iterator().next();
if (edge.getName().isEmpty())
{
return Optional
.of(this.createFlag(object,
this.getLocalizedInstruction(0, edge.getOsmIdentifier()))
.addFixSuggestion(
FeatureChange.add(
(AtlasEntity) ((CompleteEntity) CompleteEntity
.from((AtlasEntity) object)).withAddedTag(
NameTag.KEY, nameSuggestion),
object.getAtlas())));
return Optional.of(this
.createFlag(object, this.getLocalizedInstruction(0, edge.getOsmIdentifier()))
.addFixSuggestion(FeatureChange.add(
(AtlasEntity) ((CompleteEntity) CompleteEntity
.from((AtlasEntity) object))
.withAddedTag(NameTag.KEY, nameSuggestion),
object.getAtlas())));
}
final Optional<String> edgeName = edge.getName();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,9 @@ protected Optional<CheckFlag> flag(final AtlasObject object)
// that are slightly different than edge
final Set<Edge> inconsistentEdgeSet = new RoadNameSpellingConsistencyCheckWalker(edge,
this.maximumSearchDistance).collectEdges().stream()
.filter(incomingEdge -> !this.isFlagged(incomingEdge.getIdentifier()))
.filter(RoadNameSpellingConsistencyCheckWalker
.isEdgeWithInconsistentSpelling(edge))
.collect(Collectors.toSet());
.filter(incomingEdge -> !this.isFlagged(incomingEdge.getIdentifier()))
.filter(RoadNameSpellingConsistencyCheckWalker.isEdgeWithInconsistentSpelling(edge))
.collect(Collectors.toSet());

// If the Walker found any inconsistent NameTag spellings
if (!inconsistentEdgeSet.isEmpty())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,15 @@ private void generateLogFiles(final File sourceDirectory, final File targetDirec

final CheckFlagGeoJsonProcessor sourceProcessor = new CheckFlagGeoJsonProcessor(
new SparkFileHelper(FILE_SYSTEM_CONFIG), sourceDirectory.getAbsolutePathString())
.withBatchSizeOverride(2).withCompression(compression);
.withBatchSizeOverride(2).withCompression(compression);
sourceProcessor.process(this.setup.getConstantCheckFlagEvent());
sourceProcessor.process(this.setup.getSubtractionCheckFlagEvent());
sourceProcessor.process(this.setup.getPreChangeCheckFlagEvent());
sourceProcessor.process(new ShutdownEvent());

final CheckFlagGeoJsonProcessor targetProcessor = new CheckFlagGeoJsonProcessor(
new SparkFileHelper(FILE_SYSTEM_CONFIG), targetDirectory.getAbsolutePathString())
.withBatchSizeOverride(2).withCompression(compression);
.withBatchSizeOverride(2).withCompression(compression);
targetProcessor.process(this.setup.getConstantCheckFlagEvent());
targetProcessor.process(this.setup.getAdditionCheckFlagEvent());
targetProcessor.process(this.setup.getPostChangeCheckFlagEvent());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,30 +189,30 @@ private void generateLogFiles(final File sourceDirectory, final File targetDirec
// Create first source log file
final FileProcessor<CheckFlagEvent> sourceProcessor = new CheckFlagFileProcessor(
new SparkFileHelper(FILE_SYSTEM_CONFIG), sourceDirectory.getAbsolutePathString())
.withCompression(compression);
.withCompression(compression);
sourceProcessor.process(this.setup.getConstantCheckFlagEvent());
sourceProcessor.process(this.setup.getSubtractionCheckFlagEvent());
sourceProcessor.process(new ShutdownEvent());

// Create second source log file
final FileProcessor<CheckFlagEvent> sourceProcessor2 = new CheckFlagFileProcessor(
new SparkFileHelper(FILE_SYSTEM_CONFIG), sourceDirectory.getAbsolutePathString())
.withCompression(compression);
.withCompression(compression);
sourceProcessor2.process(this.setup.getPreChangeCheckFlagEvent());
sourceProcessor2.process(new ShutdownEvent());

// Create first target log file
final FileProcessor<CheckFlagEvent> targetProcessor = new CheckFlagFileProcessor(
new SparkFileHelper(FILE_SYSTEM_CONFIG), targetDirectory.getAbsolutePathString())
.withCompression(compression);
.withCompression(compression);
targetProcessor.process(this.setup.getConstantCheckFlagEvent());
targetProcessor.process(this.setup.getAdditionCheckFlagEvent());
targetProcessor.process(new ShutdownEvent());

// Create second target log file
final FileProcessor<CheckFlagEvent> targetProcessor2 = new CheckFlagFileProcessor(
new SparkFileHelper(FILE_SYSTEM_CONFIG), targetDirectory.getAbsolutePathString())
.withCompression(compression);
.withCompression(compression);
targetProcessor2.process(this.setup.getPostChangeCheckFlagEvent());
targetProcessor2.process(new ShutdownEvent());
}
Expand Down
Loading