From 22810ec21e6991d4d0ecb7ef65791e9bc1618d99 Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Sun, 15 Dec 2024 17:25:58 +0100 Subject: [PATCH] Ensure there is no change for a nested Setter --- .../migrate/lombok/UseLombokSetterTest.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/test/java/org/openrewrite/java/migrate/lombok/UseLombokSetterTest.java b/src/test/java/org/openrewrite/java/migrate/lombok/UseLombokSetterTest.java index 33e02601f..bab9ddf25 100644 --- a/src/test/java/org/openrewrite/java/migrate/lombok/UseLombokSetterTest.java +++ b/src/test/java/org/openrewrite/java/migrate/lombok/UseLombokSetterTest.java @@ -464,4 +464,23 @@ public void unrelated2() { ) ); } + + @Test + void noChangeNestedClassSetter() { + rewriteRun(// language=java + java( + """ + class Outer { + int foo = 9; + + class Inner { + public void setFoo(int foo) { + Outer.this.foo = foo; + } + } + } + """ + ) + ); + } }