aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource
diff options
context:
space:
mode:
Diffstat (limited to 'test/transform/resource')
-rw-r--r--test/transform/resource/after-ecj/ExtensionMethodNonStaticAccess.java22
-rw-r--r--test/transform/resource/before/ExtensionMethodNonStaticAccess.java18
-rw-r--r--test/transform/resource/messages-ecj/ExtensionMethodNonStaticAccess.java.messages2
3 files changed, 42 insertions, 0 deletions
diff --git a/test/transform/resource/after-ecj/ExtensionMethodNonStaticAccess.java b/test/transform/resource/after-ecj/ExtensionMethodNonStaticAccess.java
new file mode 100644
index 00000000..c930a329
--- /dev/null
+++ b/test/transform/resource/after-ecj/ExtensionMethodNonStaticAccess.java
@@ -0,0 +1,22 @@
+class ExtensionMethodNonStaticAccess {
+ ExtensionMethodNonStaticAccess() {
+ super();
+ }
+ public void method() {
+ Derived derived = new Derived();
+ derived.staticMethod();
+ }
+}
+class Base {
+ Base() {
+ super();
+ }
+ static String staticMethod() {
+ return "";
+ }
+}
+class Derived extends Base {
+ Derived() {
+ super();
+ }
+}
diff --git a/test/transform/resource/before/ExtensionMethodNonStaticAccess.java b/test/transform/resource/before/ExtensionMethodNonStaticAccess.java
new file mode 100644
index 00000000..0d317c35
--- /dev/null
+++ b/test/transform/resource/before/ExtensionMethodNonStaticAccess.java
@@ -0,0 +1,18 @@
+//issue #2752: this test triggers an indirect static access and a non static access warning for the same method call
+//platform ecj,eclipse
+class ExtensionMethodNonStaticAccess {
+ public void method(){
+ Derived derived = new Derived();
+ derived.staticMethod();
+ }
+}
+
+class Base {
+ static String staticMethod() {
+ return "";
+ }
+}
+
+class Derived extends Base {
+
+} \ No newline at end of file
diff --git a/test/transform/resource/messages-ecj/ExtensionMethodNonStaticAccess.java.messages b/test/transform/resource/messages-ecj/ExtensionMethodNonStaticAccess.java.messages
new file mode 100644
index 00000000..3f5f3988
--- /dev/null
+++ b/test/transform/resource/messages-ecj/ExtensionMethodNonStaticAccess.java.messages
@@ -0,0 +1,2 @@
+6 The static method staticMethod() from the type Base should be accessed directly
+6 The static method staticMethod() from the type Base should be accessed in a static way \ No newline at end of file