diff options
Diffstat (limited to 'ajdoc/testdata/declareForms')
-rw-r--r-- | ajdoc/testdata/declareForms/A.aj | 19 | ||||
-rw-r--r-- | ajdoc/testdata/declareForms/DeclareAtConstructor.aj | 17 | ||||
-rw-r--r-- | ajdoc/testdata/declareForms/DeclareAtField.aj | 16 | ||||
-rw-r--r-- | ajdoc/testdata/declareForms/DeclareAtMethod.aj | 17 | ||||
-rw-r--r-- | ajdoc/testdata/declareForms/DeclareAtType.aj (renamed from ajdoc/testdata/declareForms/AnnotationTest.aj) | 2 | ||||
-rw-r--r-- | ajdoc/testdata/declareForms/DeclareCoverage2.aj | 27 | ||||
-rw-r--r-- | ajdoc/testdata/declareForms/DeclareParents.aj | 12 |
7 files changed, 97 insertions, 13 deletions
diff --git a/ajdoc/testdata/declareForms/A.aj b/ajdoc/testdata/declareForms/A.aj new file mode 100644 index 000000000..947d9d2cb --- /dev/null +++ b/ajdoc/testdata/declareForms/A.aj @@ -0,0 +1,19 @@ +package foo; + +public aspect A { + + pointcut p() : execution(* C.amethod(..)); + + declare warning : p() : "warning"; + + before() : p() { + } + +} + +class C { + + public void amethod() { + } + +} diff --git a/ajdoc/testdata/declareForms/DeclareAtConstructor.aj b/ajdoc/testdata/declareForms/DeclareAtConstructor.aj new file mode 100644 index 000000000..1d43cac39 --- /dev/null +++ b/ajdoc/testdata/declareForms/DeclareAtConstructor.aj @@ -0,0 +1,17 @@ +package foo; + +@interface MyAnnotation { +} + +public aspect DeclareAtConstructor { + + declare @constructor : C.new(..) : @MyAnnotation; + +} + +class C { + + public C(String s) { + } + +} diff --git a/ajdoc/testdata/declareForms/DeclareAtField.aj b/ajdoc/testdata/declareForms/DeclareAtField.aj new file mode 100644 index 000000000..ea5230a86 --- /dev/null +++ b/ajdoc/testdata/declareForms/DeclareAtField.aj @@ -0,0 +1,16 @@ +package foo; + +@interface MyAnnotation { +} + +public aspect DeclareAtField { + + declare @field : int C.* : @MyAnnotation; + +} + +class C { + + int x = 1; + +} diff --git a/ajdoc/testdata/declareForms/DeclareAtMethod.aj b/ajdoc/testdata/declareForms/DeclareAtMethod.aj new file mode 100644 index 000000000..2dc6ca739 --- /dev/null +++ b/ajdoc/testdata/declareForms/DeclareAtMethod.aj @@ -0,0 +1,17 @@ +package foo; + +@interface MyAnnotation { +} + +public aspect DeclareAtMethod { + + declare @method : public * C.*(..) : @MyAnnotation; + +} + +class C { + + public void amethod() { + } + +} diff --git a/ajdoc/testdata/declareForms/AnnotationTest.aj b/ajdoc/testdata/declareForms/DeclareAtType.aj index 28a72736a..44f60b633 100644 --- a/ajdoc/testdata/declareForms/AnnotationTest.aj +++ b/ajdoc/testdata/declareForms/DeclareAtType.aj @@ -3,7 +3,7 @@ package foo; @interface MyAnnotation { } -public aspect AnnotationTest { +public aspect DeclareAtType { declare @type : C : @MyAnnotation; diff --git a/ajdoc/testdata/declareForms/DeclareCoverage2.aj b/ajdoc/testdata/declareForms/DeclareCoverage2.aj index 6300298e9..1ea6b6322 100644 --- a/ajdoc/testdata/declareForms/DeclareCoverage2.aj +++ b/ajdoc/testdata/declareForms/DeclareCoverage2.aj @@ -2,20 +2,23 @@ package foo; public aspect DeclareCoverage2 { - pointcut illegalNewFigElt(): call(Point.new(..)) && !withincode(* *.doIt(..)); + pointcut illegalNewFigElt(): call(Point2.new(..)) && !withincode(* *.doIt(..)); declare error: illegalNewFigElt(): "Illegal constructor call."; - declare warning: call(* Point.setX(..)): "Illegal call."; + declare warning: call(* Point2.setX(..)): "Illegal call."; + declare warning : execution(* Point2.setX(..)) : "blah"; - declare parents: Point extends java.io.Serializable; - declare parents: Line implements java.util.Observable; - declare soft: SizeException : call(* Point.getX()); - declare precedence: DeclareCoverage2, InterTypeDecCoverage, *; + declare parents: Point2 implements java.io.Serializable; + declare soft: SizeException2 : call(* Point2.getX()); + declare precedence: DeclareCoverage2, InterTypeDecCoverage2, *; } -aspect InterTypeDecCoverage {} +aspect InterTypeDecCoverage2 {} -class Point { +/** + * comment about class Point2 + */ +class Point2 { int x = 2; public void setX(int x) { @@ -27,18 +30,18 @@ class Point { } } -class Line { +class Line2 { } -class SizeException extends Throwable { } +class SizeException2 extends Throwable { } -class Main { +class Main2 { public static void main(String[] args) { } public void doIt() { - Point p = new Point(); + Point2 p = new Point2(); p.setX(3); p.getX(); } diff --git a/ajdoc/testdata/declareForms/DeclareParents.aj b/ajdoc/testdata/declareForms/DeclareParents.aj new file mode 100644 index 000000000..c86784690 --- /dev/null +++ b/ajdoc/testdata/declareForms/DeclareParents.aj @@ -0,0 +1,12 @@ +package foo; + +public aspect DeclareParents { + declare parents: Class1 implements java.io.Serializable; + declare parents: Class2 extends java.util.Observable; +} + +class Class1 { +} + +class Class2 { +} |