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.

SubClass.java 1.0KB

1234567891011121314151617181920212223242526272829303132
  1. import pack.SuperClass;
  2. import org.aspectj.testing.Tester;
  3. /** @testcase PR#585 PUREJAVA subclass unable to access protected static methods using type-qualified references */
  4. public class SubClass extends SuperClass {
  5. private static int i;
  6. static {
  7. while (i<6) {
  8. Tester.expectEvent(label() + SuperClass.SUPERCLASS);
  9. }
  10. i = 0;
  11. }
  12. static void register(Object o) {
  13. Tester.event(""+o);
  14. }
  15. public static String label() { return "label() " + i++; }
  16. public static void main(String[] args) {
  17. Object o = protectedStaticObject;
  18. register(""+protectedStatic(label() + o));
  19. register(""+SuperClass.protectedStatic(label() + o));
  20. register(""+pack.SuperClass.protectedStatic(label() + o));
  21. new SubClass().run();
  22. Tester.checkAllEvents();
  23. }
  24. public void run() {
  25. Object o = protectedObject;
  26. register(label() + protectedObject);
  27. register(""+protectedMethod(label()+o));
  28. register(""+this.protectedMethod(label()+o));
  29. }
  30. }