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

« back to all changes in this revision

Viewing changes to org.aspectj/modules/tests/java5/ataspectj/annotationGen/PerThisAspect.aj

  • 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 org.aspectj.lang.annotation.Aspect;
2
 
import java.lang.annotation.*;
3
 
 
4
 
public aspect PerThisAspect perthis(execution(* Foo.foo(..))) {
5
 
        
6
 
        public static void main(String[] args) {
7
 
                Annotation[] annotations = PerThisAspect.class.getAnnotations();
8
 
                if (annotations.length != 1) throw new RuntimeException("Should have one annotation");
9
 
                Aspect aspectAnnotation = (Aspect) annotations[0];
10
 
                if (!aspectAnnotation.value().equals("perthis(execution(* Foo.foo(..)))")) throw new RuntimeException("value should be equal to perclause");
11
 
        }
12
 
        
13
 
}
14
 
 
15
 
class Foo {
16
 
        
17
 
        void foo() {}
18
 
        
19
 
}
 
 
b'\\ No newline at end of file'