Skip to content

Commit 741d979

Browse files
committed
Replace null check with default
1 parent 1aa40fc commit 741d979

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/main/java/org/openrewrite/java/migrate/UseTabsOrSpaces.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,8 @@ public TreeVisitor<?, ExecutionContext> getVisitor() {
5454
public J visit(@Nullable Tree tree, ExecutionContext ctx) {
5555
if (tree instanceof JavaSourceFile) {
5656
JavaSourceFile cu = (JavaSourceFile) requireNonNull(tree);
57-
TabsAndIndentsStyle style = Style.from(TabsAndIndentsStyle.class, cu);
58-
if (style == null) {
59-
style = IntelliJ.tabsAndIndents();
60-
}
61-
style = style.withUseTabCharacter(useTabs);
57+
TabsAndIndentsStyle style = Style.from(TabsAndIndentsStyle.class, cu, IntelliJ::tabsAndIndents)
58+
.withUseTabCharacter(useTabs);
6259
return new NormalizeTabsOrSpacesVisitor<>(style).visit(tree, ctx);
6360
}
6461
return (J) tree;

0 commit comments

Comments
 (0)