diff options
Diffstat (limited to 'ajdoc/testdata/declareForms/DeclareCoverage2.aj')
-rw-r--r-- | ajdoc/testdata/declareForms/DeclareCoverage2.aj | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/ajdoc/testdata/declareForms/DeclareCoverage2.aj b/ajdoc/testdata/declareForms/DeclareCoverage2.aj new file mode 100644 index 000000000..6300298e9 --- /dev/null +++ b/ajdoc/testdata/declareForms/DeclareCoverage2.aj @@ -0,0 +1,46 @@ +package foo; + +public aspect DeclareCoverage2 { + + pointcut illegalNewFigElt(): call(Point.new(..)) && !withincode(* *.doIt(..)); + + declare error: illegalNewFigElt(): "Illegal constructor call."; + declare warning: call(* Point.setX(..)): "Illegal call."; + + declare parents: Point extends java.io.Serializable; + declare parents: Line implements java.util.Observable; + declare soft: SizeException : call(* Point.getX()); + declare precedence: DeclareCoverage2, InterTypeDecCoverage, *; +} + +aspect InterTypeDecCoverage {} + +class Point { + + int x = 2; + public void setX(int x) { + this.x = x; + } + + public int getX() { + return x; + } +} + +class Line { +} + +class SizeException extends Throwable { } + +class Main { + + public static void main(String[] args) { + } + + public void doIt() { + Point p = new Point(); + p.setX(3); + p.getX(); + } + +} |