Skip to content

Commit 030ee82

Browse files
Unwrap else block after return or throw statement (#1028)
Use this link to re-run the recipe: https://app.moderne.io/recipes/org.openrewrite.staticanalysis.UnwrapElseAfterReturn?organizationId=QUxML09wZW4gU291cmNlL09wZW5SZXdyaXRl Co-authored-by: Moderne <[email protected]>
1 parent a8531cf commit 030ee82

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/main/java/org/openrewrite/maven/MavenMojoProjectParser.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,8 @@ private boolean isExcluded(Collection<PathMatcher> exclusionMatchers, Path path)
273273
if (workingTreeIterator.getEntryFileMode().equals(FileMode.TREE)) {
274274
if (workingTreeIterator.isEntryIgnored()) {
275275
return true;
276-
} else {
277-
walk.enterSubtree();
278276
}
277+
walk.enterSubtree();
279278
}
280279
}
281280
} catch (IOException e) {

src/main/java/org/openrewrite/maven/ResourceParser.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,8 @@ private boolean isExcluded(Path path) {
305305
if (workingTreeIterator.getEntryFileMode().equals(FileMode.TREE)) {
306306
if (workingTreeIterator.isEntryIgnored()) {
307307
return true;
308-
} else {
309-
walk.enterSubtree();
310308
}
309+
walk.enterSubtree();
311310
}
312311
}
313312
} catch (IOException e) {

0 commit comments

Comments
 (0)