Skip to content

Commit a372a61

Browse files
1 parent 7082b93 commit a372a61

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public TreeVisitor<?, ExecutionContext> getVisitor() {
5353
public J visit(@Nullable Tree tree, ExecutionContext ctx) {
5454
if (tree instanceof JavaSourceFile) {
5555
JavaSourceFile cu = (JavaSourceFile) requireNonNull(tree);
56-
TabsAndIndentsStyle style = ((SourceFile) cu).getStyle(TabsAndIndentsStyle.class);
56+
TabsAndIndentsStyle style = Style.from( TabsAndIndentsStyle.class, ((SourceFile) cu) );
5757
if (style == null) {
5858
style = IntelliJ.tabsAndIndents();
5959
}

src/main/java/org/openrewrite/java/migrate/lang/UseTextBlocks.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,7 @@ private J.Literal toTextBlock(J.Binary binary, String content, List<J.Literal> s
145145
}
146146
}
147147

148-
TabsAndIndentsStyle tabsAndIndentsStyle = Optional.ofNullable(getCursor().firstEnclosingOrThrow(SourceFile.class)
149-
.getStyle(TabsAndIndentsStyle.class)).orElse(IntelliJ.tabsAndIndents());
148+
TabsAndIndentsStyle tabsAndIndentsStyle = Optional.ofNullable(Style.from( TabsAndIndentsStyle.class, getCursor().firstEnclosingOrThrow( SourceFile.class ) )).orElse(IntelliJ.tabsAndIndents());
150149
boolean useTab = tabsAndIndentsStyle.getUseTabCharacter();
151150
int tabSize = tabsAndIndentsStyle.getTabSize();
152151

0 commit comments

Comments
 (0)