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.

DeclareInterfaceConstructor.java 447B

12345678910111213141516171819202122
  1. import org.aspectj.testing.Tester;
  2. /** @testcase PR#884 declare constructor on interface subclasses */
  3. public class DeclareInterfaceConstructor {
  4. public static void main(String[] args) {
  5. X x = new Z(1);
  6. if (1 != x.i) {
  7. Tester.check(false, "bad constructor initialization");
  8. }
  9. }
  10. }
  11. interface X {}
  12. class Z implements X {}
  13. aspect Y {
  14. public int X.i;
  15. public X+.new(final int i) {this.i = i;}
  16. }