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.

Driver.java 542B

12345678910111213141516171819202122232425
  1. import org.aspectj.testing.Tester;
  2. public class Driver {
  3. public static void main(String[] args) { test(); }
  4. static public void test() {
  5. SubClass s = new SubClass(0);
  6. Tester.checkEqual(Aspect.count, 2, "introduced constructors");
  7. }
  8. }
  9. class Class {}
  10. class SubClass extends Class {}
  11. // this should introduce a unary constructor for
  12. // Class and SubClass
  13. aspect Aspect {
  14. static int count = 0;
  15. //introduction subtypes(Class) {
  16. Class.new(int i) {this(); count++;}
  17. SubClass.new(int i) {super(2); count++;}
  18. //}
  19. }