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.

UnfoundConstructor.java 517B

123456789101112131415161718192021222324252627
  1. import org.aspectj.testing.Tester;
  2. /** @testcase no such constructor for proceed argument (error) */
  3. public class UnfoundConstructor {
  4. public static void main (String[] args) {
  5. I i = new B();
  6. String s = i.toString();
  7. }
  8. }
  9. interface I { }
  10. class B implements I { }
  11. class Mock implements I {
  12. Mock(B toMock) { }
  13. }
  14. aspect A {
  15. Object around(I targ) :
  16. target(targ) && target(B) && call(* *(..)) {
  17. return proceed(new Mock(targ)); // CE 25: no such constructor
  18. }
  19. }