diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2020-09-18 02:32:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-18 02:32:34 +0200 |
commit | 25f91eb7b21ec0330db66ad962898d10b8da262d (patch) | |
tree | d7b7e233e10d1ec1b925a3560448e91b963838e6 /test/transform | |
parent | 1dd84581c0a0f3c843ac59d5b6bca3d5f674c7b8 (diff) | |
parent | 75b7a88a45f08dda24bb8dfe466acee0b10f3b40 (diff) | |
download | lombok-25f91eb7b21ec0330db66ad962898d10b8da262d.tar.gz lombok-25f91eb7b21ec0330db66ad962898d10b8da262d.tar.bz2 lombok-25f91eb7b21ec0330db66ad962898d10b8da262d.zip |
Merge pull request #2560 from Rawi01/extensionmethod-names
Detect static method access properly
Diffstat (limited to 'test/transform')
3 files changed, 92 insertions, 0 deletions
diff --git a/test/transform/resource/after-delombok/ExtensionMethodNames.java b/test/transform/resource/after-delombok/ExtensionMethodNames.java new file mode 100644 index 00000000..45f76ee4 --- /dev/null +++ b/test/transform/resource/after-delombok/ExtensionMethodNames.java @@ -0,0 +1,27 @@ +package a; + +class ExtensionMethodNames { + + public void instanceCalls() { + a.Extensions.ext((new Test())); + Test t = new Test(); + a.Extensions.ext(t); + Test Test = new Test(); + a.Extensions.ext(Test); + } + + public void staticCalls() { + Test.ext(); + a.Test.ext(); + } +} + +class Extensions { + public static void ext(Test t) { + } +} + +class Test { + public static void ext() { + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/ExtensionMethodNames.java b/test/transform/resource/after-ecj/ExtensionMethodNames.java new file mode 100644 index 00000000..015e8ac2 --- /dev/null +++ b/test/transform/resource/after-ecj/ExtensionMethodNames.java @@ -0,0 +1,32 @@ +package a; +import lombok.experimental.ExtensionMethod; +@ExtensionMethod(Extensions.class) class ExtensionMethodNames { + ExtensionMethodNames() { + super(); + } + public void instanceCalls() { + a.Extensions.ext(new Test()); + Test t = new Test(); + a.Extensions.ext(t); + Test Test = new Test(); + a.Extensions.ext(Test); + } + public void staticCalls() { + Test.ext(); + a.Test.ext(); + } +} +class Extensions { + Extensions() { + super(); + } + public static void ext(Test t) { + } +} +class Test { + Test() { + super(); + } + public static void ext() { + } +}
\ No newline at end of file diff --git a/test/transform/resource/before/ExtensionMethodNames.java b/test/transform/resource/before/ExtensionMethodNames.java new file mode 100644 index 00000000..4ca63a63 --- /dev/null +++ b/test/transform/resource/before/ExtensionMethodNames.java @@ -0,0 +1,33 @@ +package a; + +import lombok.experimental.ExtensionMethod; + +@ExtensionMethod(Extensions.class) +class ExtensionMethodNames { + + public void instanceCalls() { + (new Test()).ext(); + + Test t = new Test(); + t.ext(); + + Test Test = new Test(); + Test.ext(); + } + + public void staticCalls() { + Test.ext(); + a.Test.ext(); + } +} + +class Extensions { + public static void ext(Test t) { + } +} + +class Test { + public static void ext() { + + } +}
\ No newline at end of file |