From da10e291edc2c4b0edc3a0ebad8e5e1ff7be7ddf Mon Sep 17 00:00:00 2001 From: Sam Snyder Date: Fri, 22 Sep 2023 17:29:07 -0700 Subject: [PATCH] Polish --- .../gradle/isolated/DefaultProjectParser.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugin/src/main/java/org/openrewrite/gradle/isolated/DefaultProjectParser.java b/plugin/src/main/java/org/openrewrite/gradle/isolated/DefaultProjectParser.java index 0442d6566..2656bd9cf 100644 --- a/plugin/src/main/java/org/openrewrite/gradle/isolated/DefaultProjectParser.java +++ b/plugin/src/main/java/org/openrewrite/gradle/isolated/DefaultProjectParser.java @@ -268,7 +268,7 @@ private static StringBuilder repeat(int repeat) { public Collection listSources() { // Use a sorted collection so that gradle input detection isn't thrown off by ordering - Set result = new TreeSet<>(omniParser(emptySet()).build().acceptedPaths(baseDir, project.getProjectDir().toPath())); + Set result = new TreeSet<>(omniParser(emptySet()).acceptedPaths(baseDir, project.getProjectDir().toPath())); //noinspection deprecation JavaPluginConvention javaConvention = project.getConvention().findPlugin(JavaPluginConvention.class); if (javaConvention != null) { @@ -806,7 +806,7 @@ public Stream parse(Project subproject, Set alreadyParsed, Exe for (File resourcesDir : sourceSet.getResources().getSourceDirectories()) { if (resourcesDir.exists()) { - OmniParser omniParser = omniParser(alreadyParsed).build(); + OmniParser omniParser = omniParser(alreadyParsed); List accepted = omniParser.acceptedPaths(baseDir, resourcesDir.toPath()); sourceSetSourceFiles = Stream.concat( sourceSetSourceFiles, @@ -939,14 +939,13 @@ private SourceFileStream parseGradleFiles( protected SourceFileStream parseNonProjectResources(Project subproject, Set alreadyParsed, ExecutionContext ctx, List projectProvenance, Stream sourceFiles) { //Collect any additional yaml/properties/xml files that are NOT already in a source set. - OmniParser omniParser = omniParser(alreadyParsed) - .build(); + OmniParser omniParser = omniParser(alreadyParsed); List accepted = omniParser.acceptedPaths(baseDir, subproject.getProjectDir().toPath()); return SourceFileStream.build("", s -> {}) .concat(omniParser.parse(accepted, baseDir, ctx), accepted.size()); } - private OmniParser.Builder omniParser(Set alreadyParsed) { + private OmniParser omniParser(Set alreadyParsed) { return OmniParser.builder( OmniParser.RESOURCE_PARSERS, PlainTextParser.builder() @@ -956,7 +955,8 @@ private OmniParser.Builder omniParser(Set alreadyParsed) { ) .exclusionMatchers(pathMatchers(baseDir, mergeExclusions(project, baseDir, extension))) .exclusions(alreadyParsed) - .sizeThresholdMb(extension.getSizeThresholdMb()); + .sizeThresholdMb(extension.getSizeThresholdMb()) + .build(); } private static Collection mergeExclusions(Project project, Path baseDir, RewriteExtension extension) {