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.

DeclareCoverage.java 789B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package foo;
  2. import java.io.*;
  3. import java.util.List;
  4. public aspect DeclareCoverage {
  5. void foo() { }
  6. pointcut illegalNewFigElt(): call(Point.new(..)) && !withincode(* *.doIt(..));
  7. declare error: illegalNewFigElt(): "Illegal constructor call.";
  8. declare warning: call(* Point.setX(..)): "Illegal call.";
  9. declare parents: Point extends java.io.Serializable;
  10. declare parents: Point && Line implements java.util.Observable;
  11. declare soft: SizeException : call(* Point.getX());
  12. declare precedence: DeclareCoverage, InterTypeDecCoverage, *;
  13. }
  14. aspect InterTypeDecCoverage {
  15. void foo() { }
  16. public int Point.xxx = 0;
  17. public int Point.check(int i, int j) { return 1; }
  18. }
  19. class Point {
  20. }
  21. class Line {
  22. }
  23. class SizeException extends Throwable { }