diff options
Diffstat (limited to 'tests/bugs/fieldsOnInterfaces/IntFieldOnInterface.java')
-rw-r--r-- | tests/bugs/fieldsOnInterfaces/IntFieldOnInterface.java | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/bugs/fieldsOnInterfaces/IntFieldOnInterface.java b/tests/bugs/fieldsOnInterfaces/IntFieldOnInterface.java new file mode 100644 index 000000000..9d9f7e205 --- /dev/null +++ b/tests/bugs/fieldsOnInterfaces/IntFieldOnInterface.java @@ -0,0 +1,37 @@ +import org.aspectj.testing.Tester; + +/** @testcase PR#52107 declare int field on interface */ +public class IntFieldOnInterface implements Runnable { + public static final int caseid = 2; + public static void main(String[] args) { + Tester.expectEvent("A name=2"); + Tester.expectEvent("R name=2"); + IntFieldOnInterface test + = new IntFieldOnInterface(); + test.run(); + test.blah(); + Tester.checkAllEvents(); + } + public void run() { + switch (name) { + case (IntFieldOnInterface.caseid) : + Tester.event("R name=" + name); + break; + default : + throw new Error("bad switch"); + } + } +} + +aspect A { + public int Runnable.name = IntFieldOnInterface.caseid; + public void Runnable.blah() { + switch (name) { + case (IntFieldOnInterface.caseid) : + Tester.event("A name=" + name); + break; + default : + throw new Error("bad switch"); + } + } +}
\ No newline at end of file |