You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

StringFieldOnInterface.java 526B

123456789101112131415161718192021
  1. import org.aspectj.testing.Tester;
  2. /** @testcase PR#52107 declare String field on interface */
  3. public class StringFieldOnInterface implements Runnable {
  4. public static void main(String[] args) {
  5. Tester.expectEvent("length=1");
  6. new StringFieldOnInterface().blah();
  7. Tester.checkAllEvents();
  8. }
  9. public void run() {
  10. }
  11. }
  12. aspect A {
  13. public String Runnable.name = "a";
  14. public void Runnable.blah() {
  15. int i = name.length();
  16. Tester.event("length="+i);
  17. }
  18. }