~ubuntu-branches/ubuntu/natty/aspectj/natty

« back to all changes in this revision

Viewing changes to org.aspectj/modules/tests/bugs150/pr115252/AnnotationDeclaringType.java

  • Committer: Bazaar Package Importer
  • Author(s): Damien Raude-Morvan
  • Date: 2009-10-04 16:37:23 UTC
  • mfrom: (1.1.3 upstream) (3.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20091004163723-ck4y7j7fhjxskkie
Tags: 1.6.6+dfsg-1
* New upstream release.
  - Update 02_use_gjdoc.diff patch
* Update my email address

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import java.lang.annotation.Target;
2
 
import java.lang.annotation.ElementType;
3
 
 
4
 
@Target({ElementType.TYPE})
5
 
@interface TypeAnnotation{}
6
 
 
7
 
@Target({ElementType.METHOD})
8
 
@interface MethodAnnotation{}
9
 
 
10
 
@TypeAnnotation
11
 
public class AnnotationDeclaringType {
12
 
 
13
 
        public void method1() {
14
 
        }
15
 
        
16
 
}
17
 
 
18
 
aspect A {
19
 
        
20
 
        // matches the execution of any method where the declaring type
21
 
        // has the @TypeAnnotation - should compile ok and get no xlint errors
22
 
        pointcut pc() : execution(* (@TypeAnnotation *).*(..));
23
 
        declare warning : pc() : "* (@TypeAnnotation *).*(..)";
24
 
        
25
 
        // should get an xlint warning because declaring types can only
26
 
        // have the default @Target or @Target{ElementType.TYPE} target
27
 
        pointcut pc2() : execution(* (@MethodAnnotation *).*(..));
28
 
        declare warning : pc2() : "* (@MethodAnnotation *).*(..)";
29
 
}