aboutsummaryrefslogtreecommitdiffstats
path: root/ajdoc/testdata/declareForms/DeclareCoverage.java
blob: ff89cb0a78e4556cc3aade5797db3168b8cd30cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package foo;

import java.io.*;
import java.util.List;
 
public aspect DeclareCoverage {

	void foo() { }
	
    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: Point && Line implements java.util.Observable;
    declare soft: SizeException : call(* Point.getX());
	declare precedence: DeclareCoverage, InterTypeDecCoverage, *;
}

aspect InterTypeDecCoverage {
	
	void foo() { } 
	
    public int Point.xxx = 0;
    public int Point.check(int i, int j) { return 1; }
}

class Point { 

}

class Line { 
	
}

class SizeException extends Throwable { }