aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2020-09-18 02:31:44 +0200
committerGitHub <noreply@github.com>2020-09-18 02:31:44 +0200
commit1dd84581c0a0f3c843ac59d5b6bca3d5f674c7b8 (patch)
treed225c675cae91a7182d60296174d04d2cbd09cdc /test/transform/resource
parentf43a63b1d988a703dddbc61c47076d616bb3d639 (diff)
parent4d2ae4ba3261ab2963c13649b3ba8f4b3881e9c3 (diff)
downloadlombok-1dd84581c0a0f3c843ac59d5b6bca3d5f674c7b8.tar.gz
lombok-1dd84581c0a0f3c843ac59d5b6bca3d5f674c7b8.tar.bz2
lombok-1dd84581c0a0f3c843ac59d5b6bca3d5f674c7b8.zip
Merge pull request #2558 from Rawi01/extensionmethod-suppress
Fix suppressBaseMethods in ecj/eclipse
Diffstat (limited to 'test/transform/resource')
-rw-r--r--test/transform/resource/after-delombok/ExtensionMethodSuppress.java33
-rw-r--r--test/transform/resource/after-ecj/ExtensionMethodSuppress.java41
-rw-r--r--test/transform/resource/before/ExtensionMethodSuppress.java43
-rw-r--r--test/transform/resource/messages-ecj/ExtensionMethodSuppress.java.messages1
4 files changed, 118 insertions, 0 deletions
diff --git a/test/transform/resource/after-delombok/ExtensionMethodSuppress.java b/test/transform/resource/after-delombok/ExtensionMethodSuppress.java
new file mode 100644
index 00000000..d9e7cb28
--- /dev/null
+++ b/test/transform/resource/after-delombok/ExtensionMethodSuppress.java
@@ -0,0 +1,33 @@
+class ExtensionMethodSuppress {
+ public void test() {
+ Test.staticMethod();
+ Test test = new Test();
+ Extensions.instanceMethod(test);
+ Extensions.staticMethod(test);
+ }
+}
+
+class ExtensionMethodKeep {
+ public void test() {
+ Test.staticMethod();
+ Test test = new Test();
+ test.instanceMethod();
+ test.staticMethod();
+ }
+}
+
+class Test {
+ public static void staticMethod() {
+ }
+
+ public void instanceMethod() {
+ }
+}
+
+class Extensions {
+ public static void staticMethod(Test test) {
+ }
+
+ public static void instanceMethod(Test test) {
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/after-ecj/ExtensionMethodSuppress.java b/test/transform/resource/after-ecj/ExtensionMethodSuppress.java
new file mode 100644
index 00000000..83e4b57f
--- /dev/null
+++ b/test/transform/resource/after-ecj/ExtensionMethodSuppress.java
@@ -0,0 +1,41 @@
+import lombok.experimental.ExtensionMethod;
+@ExtensionMethod(Extensions.class) class ExtensionMethodSuppress {
+ ExtensionMethodSuppress() {
+ super();
+ }
+ public void test() {
+ Test.staticMethod();
+ Test test = new Test();
+ Extensions.instanceMethod(test);
+ Extensions.staticMethod(test);
+ }
+}
+@ExtensionMethod(value = Extensions.class,suppressBaseMethods = false) class ExtensionMethodKeep {
+ ExtensionMethodKeep() {
+ super();
+ }
+ public void test() {
+ Test.staticMethod();
+ Test test = new Test();
+ test.instanceMethod();
+ test.staticMethod();
+ }
+}
+class Test {
+ Test() {
+ super();
+ }
+ public static void staticMethod() {
+ }
+ public void instanceMethod() {
+ }
+}
+class Extensions {
+ Extensions() {
+ super();
+ }
+ public static void staticMethod(Test test) {
+ }
+ public static void instanceMethod(Test test) {
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/before/ExtensionMethodSuppress.java b/test/transform/resource/before/ExtensionMethodSuppress.java
new file mode 100644
index 00000000..d30652d3
--- /dev/null
+++ b/test/transform/resource/before/ExtensionMethodSuppress.java
@@ -0,0 +1,43 @@
+import lombok.experimental.ExtensionMethod;
+
+@ExtensionMethod(Extensions.class)
+class ExtensionMethodSuppress {
+ public void test() {
+ Test.staticMethod();
+
+ Test test = new Test();
+ test.instanceMethod();
+ test.staticMethod();
+ }
+}
+
+@ExtensionMethod(value = Extensions.class, suppressBaseMethods = false)
+class ExtensionMethodKeep {
+ public void test() {
+ Test.staticMethod();
+
+ Test test = new Test();
+ test.instanceMethod();
+ test.staticMethod();
+ }
+}
+
+class Test {
+ public static void staticMethod() {
+
+ }
+
+ public void instanceMethod() {
+
+ }
+}
+
+class Extensions {
+ public static void staticMethod(Test test) {
+
+ }
+
+ public static void instanceMethod(Test test) {
+
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/messages-ecj/ExtensionMethodSuppress.java.messages b/test/transform/resource/messages-ecj/ExtensionMethodSuppress.java.messages
new file mode 100644
index 00000000..dfa778a4
--- /dev/null
+++ b/test/transform/resource/messages-ecj/ExtensionMethodSuppress.java.messages
@@ -0,0 +1 @@
+21 The static method staticMethod() from the type Test should be accessed in a static way \ No newline at end of file