From d42a6fe40eacd8aca9697adda0eed61f66ab7d6c Mon Sep 17 00:00:00 2001 From: Rawi01 Date: Sun, 7 Feb 2021 21:22:07 +0100 Subject: [fixes #2741] Handle inner method invocations first --- .../resource/after-delombok/ExtensionMethodChain.java | 15 +++++++++++++++ .../resource/after-ecj/ExtensionMethodChain.java | 19 +++++++++++++++++++ .../resource/before/ExtensionMethodChain.java | 17 +++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 test/transform/resource/after-delombok/ExtensionMethodChain.java create mode 100644 test/transform/resource/after-ecj/ExtensionMethodChain.java create mode 100644 test/transform/resource/before/ExtensionMethodChain.java (limited to 'test/transform') diff --git a/test/transform/resource/after-delombok/ExtensionMethodChain.java b/test/transform/resource/after-delombok/ExtensionMethodChain.java new file mode 100644 index 00000000..77f79dea --- /dev/null +++ b/test/transform/resource/after-delombok/ExtensionMethodChain.java @@ -0,0 +1,15 @@ +import java.util.Arrays; +import java.util.List; + +class ExtensionMethodChain { + public void test() { + ExtensionMethodChain.Extensions.intValue("1").intValue(); + } + + + static class Extensions { + public static Integer intValue(String s) { + return Integer.valueOf(s); + } + } +} \ No newline at end of file diff --git a/test/transform/resource/after-ecj/ExtensionMethodChain.java b/test/transform/resource/after-ecj/ExtensionMethodChain.java new file mode 100644 index 00000000..8eda4bf8 --- /dev/null +++ b/test/transform/resource/after-ecj/ExtensionMethodChain.java @@ -0,0 +1,19 @@ +import java.util.Arrays; +import java.util.List; +import lombok.experimental.ExtensionMethod; +@ExtensionMethod(ExtensionMethodChain.Extensions.class) class ExtensionMethodChain { + static class Extensions { + Extensions() { + super(); + } + public static Integer intValue(String s) { + return Integer.valueOf(s); + } + } + ExtensionMethodChain() { + super(); + } + public void test() { + ExtensionMethodChain.Extensions.intValue("1").intValue(); + } +} \ No newline at end of file diff --git a/test/transform/resource/before/ExtensionMethodChain.java b/test/transform/resource/before/ExtensionMethodChain.java new file mode 100644 index 00000000..f7960ed4 --- /dev/null +++ b/test/transform/resource/before/ExtensionMethodChain.java @@ -0,0 +1,17 @@ +import java.util.Arrays; +import java.util.List; +import lombok.experimental.ExtensionMethod; + +@ExtensionMethod(ExtensionMethodChain.Extensions.class) +class ExtensionMethodChain { + + public void test() { + "1".intValue().intValue(); + } + + static class Extensions { + public static Integer intValue(String s) { + return Integer.valueOf(s); + } + } +} -- cgit