From f202e687505f645c3b01516fb0e759f5227f993c Mon Sep 17 00:00:00 2001 From: Tracey Yoshima Date: Tue, 14 Jun 2022 17:04:57 -0700 Subject: [PATCH] Auto-detect style if the list of styles is empty in MavenMojoProjectParser. (#379) fixes #1916 --- src/main/java/org/openrewrite/maven/MavenMojoProjectParser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/openrewrite/maven/MavenMojoProjectParser.java b/src/main/java/org/openrewrite/maven/MavenMojoProjectParser.java index c7183854..e76eaef7 100644 --- a/src/main/java/org/openrewrite/maven/MavenMojoProjectParser.java +++ b/src/main/java/org/openrewrite/maven/MavenMojoProjectParser.java @@ -474,7 +474,7 @@ private Set pathsToOtherMavenProjects(MavenProject mavenProject) { } private List maybeAutodetectStyles(List sourceFiles, @Nullable Iterable styles) { - if (styles != null) { + if (styles != null && styles.spliterator().getExactSizeIfKnown() > 0) { return sourceFiles; } Autodetect autodetect = Autodetect.detect(sourceFiles);