File tree Expand file tree Collapse file tree
main/java/org/openrewrite/groovy
test/java/org/openrewrite/groovy/tree Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -489,7 +489,7 @@ class A {
489489 Iterator <InnerClassNode > innerClassIterator = clazz .getInnerClasses ();
490490 while (innerClassIterator .hasNext ()) {
491491 InnerClassNode icn = innerClassIterator .next ();
492- if (icn .isSynthetic () || fieldInitializers .contains (icn ) || icn .getName ().contains ("$Trait$" )) {
492+ if (icn .isSynthetic () || fieldInitializers .contains (icn ) || icn .getName ().contains ("$Trait$" ) || ! appearsInSource ( icn ) ) {
493493 continue ;
494494 }
495495 sortedByPosition .put (pos (icn ), icn );
Original file line number Diff line number Diff line change @@ -260,6 +260,24 @@ class Inner {
260260 );
261261 }
262262
263+ @ Test
264+ void innerClassWithBuilderAnnotation () {
265+ rewriteRun (
266+ groovy (
267+ """
268+ import groovy.transform.builder.Builder
269+
270+ class Outer {
271+ @Builder
272+ class Inner {
273+ String controller
274+ }
275+ }
276+ """
277+ )
278+ );
279+ }
280+
263281 @ Issue ("https://github.com/openrewrite/rewrite/issues/4705" )
264282 @ Test
265283 void constructorWithDef () {
You can’t perform that action at this time.
0 commit comments