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.

TargetClassCP.java 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import org.aspectj.testing.Tester;
  2. public class TargetClassCP {
  3. /** run PUREJAVA variant of the tests */
  4. public static void main(String[] args) {
  5. SubClass me = new SubClass();
  6. Tester.check(me.field, "me.field");
  7. Tester.check(me.f.valid(), "me.f.valid()");
  8. Tester.check(me.new inner().run(), "me.new inner().run() ");
  9. Tester.check(me.result_cast, "me.result_cast");
  10. }
  11. }
  12. class TargetClass {
  13. boolean ok = true;
  14. boolean getboolean() { return (this != null); }
  15. public class InnerClass {
  16. public boolean valid() {
  17. return (null != this);
  18. }
  19. }
  20. }
  21. /** @testcase enclosing class available as this qualifier in inner classes */
  22. class SubClass extends TargetClass {
  23. public class inner {
  24. public boolean run() {
  25. InnerClass j = SubClass.this.new InnerClass();
  26. boolean boolean_4 = SubClass.this.getboolean();
  27. return (boolean_4 && j.valid());
  28. }
  29. }
  30. boolean result_cast = SubClass.this.getboolean();
  31. InnerClass f = SubClass.this.new InnerClass();
  32. boolean field = SubClass.this.ok;
  33. }