@@ -57,30 +57,30 @@ public J visit(@Nullable Tree tree, P p, Cursor cursor) {
5757
5858 t = new MinimumViableSpacingVisitor <>(stopAfter ).visit (t , p , cursor .fork ());
5959
60- t = new BlankLinesVisitor <>(Optional .ofNullable ((( SourceFile ) cu ) .getStyle (BlankLinesStyle .class ))
60+ t = new BlankLinesVisitor <>(Optional .ofNullable (cu .getStyle (BlankLinesStyle .class ))
6161 .orElse (IntelliJ .blankLines ()), stopAfter )
6262 .visit (t , p , cursor .fork ());
6363
64- t = new WrappingAndBracesVisitor <>(Optional .ofNullable ((( SourceFile ) cu ) .getStyle (WrappingAndBracesStyle .class ))
64+ t = new WrappingAndBracesVisitor <>(Optional .ofNullable (cu .getStyle (WrappingAndBracesStyle .class ))
6565 .orElse (IntelliJ .wrappingAndBraces ()), stopAfter )
6666 .visit (t , p , cursor .fork ());
6767
6868 t = new SpacesVisitor <>(
69- Optional .ofNullable ((( SourceFile ) cu ) .getStyle (SpacesStyle .class )).orElse (IntelliJ .spaces ()),
70- (( SourceFile ) cu ) .getStyle (EmptyForInitializerPadStyle .class ),
71- (( SourceFile ) cu ) .getStyle (EmptyForIteratorPadStyle .class ),
69+ Optional .ofNullable (cu .getStyle (SpacesStyle .class )).orElse (IntelliJ .spaces ()),
70+ cu .getStyle (EmptyForInitializerPadStyle .class ),
71+ cu .getStyle (EmptyForIteratorPadStyle .class ),
7272 stopAfter
7373 ).visit (t , p , cursor .fork ());
7474
75- t = new NormalizeTabsOrSpacesVisitor <>(Optional .ofNullable ((( SourceFile ) cu ) .getStyle (TabsAndIndentsStyle .class ))
75+ t = new NormalizeTabsOrSpacesVisitor <>(Optional .ofNullable (cu .getStyle (TabsAndIndentsStyle .class ))
7676 .orElse (IntelliJ .tabsAndIndents ()), stopAfter )
7777 .visit (t , p , cursor .fork ());
7878
79- t = new TabsAndIndentsVisitor <>(Optional .ofNullable ((( SourceFile ) cu ) .getStyle (TabsAndIndentsStyle .class ))
79+ t = new TabsAndIndentsVisitor <>(Optional .ofNullable (cu .getStyle (TabsAndIndentsStyle .class ))
8080 .orElse (IntelliJ .tabsAndIndents ()), stopAfter )
8181 .visit (t , p , cursor .fork ());
8282
83- t = new NormalizeLineBreaksVisitor <>(Optional .ofNullable ((( SourceFile ) cu ) .getStyle (GeneralFormatStyle .class ))
83+ t = new NormalizeLineBreaksVisitor <>(Optional .ofNullable (cu .getStyle (GeneralFormatStyle .class ))
8484 .orElse (autodetectGeneralFormatStyle (cu )), stopAfter )
8585 .visit (t , p , cursor .fork ());
8686
@@ -101,26 +101,26 @@ public J visit(@Nullable Tree tree, P p) {
101101 }
102102 JavaSourceFile t = (JavaSourceFile ) new RemoveTrailingWhitespaceVisitor <>(stopAfter ).visit (cu , p );
103103
104- t = (JavaSourceFile ) new BlankLinesVisitor <>(Optional .ofNullable ((( SourceFile ) cu ) .getStyle (BlankLinesStyle .class ))
104+ t = (JavaSourceFile ) new BlankLinesVisitor <>(Optional .ofNullable (cu .getStyle (BlankLinesStyle .class ))
105105 .orElse (IntelliJ .blankLines ()), stopAfter )
106106 .visit (t , p );
107107
108108 t = (JavaSourceFile ) new SpacesVisitor <P >(Optional .ofNullable (
109- (( SourceFile ) cu ) .getStyle (SpacesStyle .class )).orElse (IntelliJ .spaces ()),
110- (( SourceFile ) cu ) .getStyle (EmptyForInitializerPadStyle .class ),
111- (( SourceFile ) cu ) .getStyle (EmptyForIteratorPadStyle .class ),
109+ cu .getStyle (SpacesStyle .class )).orElse (IntelliJ .spaces ()),
110+ cu .getStyle (EmptyForInitializerPadStyle .class ),
111+ cu .getStyle (EmptyForIteratorPadStyle .class ),
112112 stopAfter )
113113 .visit (t , p );
114114
115- t = (JavaSourceFile ) new WrappingAndBracesVisitor <>(Optional .ofNullable ((( SourceFile ) cu ) .getStyle (WrappingAndBracesStyle .class ))
115+ t = (JavaSourceFile ) new WrappingAndBracesVisitor <>(Optional .ofNullable (cu .getStyle (WrappingAndBracesStyle .class ))
116116 .orElse (IntelliJ .wrappingAndBraces ()), stopAfter )
117117 .visit (t , p );
118118
119- t = (JavaSourceFile ) new NormalizeTabsOrSpacesVisitor <>(Optional .ofNullable ((( SourceFile ) cu ) .getStyle (TabsAndIndentsStyle .class ))
119+ t = (JavaSourceFile ) new NormalizeTabsOrSpacesVisitor <>(Optional .ofNullable (cu .getStyle (TabsAndIndentsStyle .class ))
120120 .orElse (IntelliJ .tabsAndIndents ()), stopAfter )
121121 .visit (t , p );
122122
123- t = (JavaSourceFile ) new TabsAndIndentsVisitor <>(Optional .ofNullable ((( SourceFile ) cu ) .getStyle (TabsAndIndentsStyle .class ))
123+ t = (JavaSourceFile ) new TabsAndIndentsVisitor <>(Optional .ofNullable (cu .getStyle (TabsAndIndentsStyle .class ))
124124 .orElse (IntelliJ .tabsAndIndents ()), stopAfter )
125125 .visit (t , p );
126126
0 commit comments