]> source.dussan.org Git - aspectj.git/commitdiff
reworked, temporarily commented out the MethodSignature stuff as it misbehaves for me.
authoraclement <aclement>
Wed, 23 Mar 2005 16:52:04 +0000 (16:52 +0000)
committeraclement <aclement>
Wed, 23 Mar 2005 16:52:04 +0000 (16:52 +0000)
tests/java5/annotations/itds/AnnotationsAndITDs.aj

index 2e51f3e12918bfc2b0c75decefef2f0f58952e90..104681419300aa4cc153395b90214a86b562bed7 100644 (file)
@@ -93,71 +93,71 @@ aspect AnnotationTests {
        // binding tests
        
        before(SomeAnnotation sa) : execution(public ITDMe.new(String)) && @annotation(sa) {
-               print(sa);
+               print(sa,thisJoinPoint.getSourceLocation().toString());
        }
        
        after(SomeAnnotation sa) : execution(private ITDMe.new(int)) && @annotation(sa) {
-               print(sa);
+               print(sa,thisJoinPoint.getSourceLocation().toString());
        }
        
        before(SomeAnnotation sa) : execution(private ITDMe.new(int)) && @annotation(sa) {
-               print(sa);
+               print(sa,thisJoinPoint.getSourceLocation().toString());
        }
        
        after(SomeAnnotation sa) : execution(public void ITDMe.bar(int)) && @annotation(sa) {
-               print(sa);
-               MethodSignature sig = (MethodSignature) thisJoinPoint.getSignature();
-               Method meth = sig.getMethod();
-               Annotation[][] anns = meth.getParameterAnnotations();
-               System.out.println("method bar has " + anns.length + " params, first param annotation is " 
-                               + anns[0][0].toString());
+               print(sa,thisJoinPoint.getSourceLocation().toString());
+//             MethodSignature sig = (MethodSignature) thisJoinPoint.getSignature(); 
+//             Method meth = sig.getMethod();
+//             Annotation[][] anns = meth.getParameterAnnotations();
+//             System.out.println("method bar has " + anns.length + " params, first param annotation is " 
+//                             + anns[0][0].toString());
        }
        
        before(SomeAnnotation sa) : set(public Double ITDMe.d) && @annotation(sa) {
-               print(sa);
+               print(sa,thisJoinPoint.getSourceLocation().toString());
        }
        
        after(SomeAnnotation sa) : set(private Float ITDMe.f) && @annotation(sa) {
-               print(sa);
+               print(sa,thisJoinPoint.getSourceLocation().toString());
        }
        
-       after(SomeAnnotation sa) returning : staticinitialization(@SomeAnnotation *) && @annotation(sa){
-               print(sa);
+        after(SomeAnnotation sa) returning : staticinitialization(@SomeAnnotation *) && @annotation(sa){
+               print(sa,thisJoinPoint.getSourceLocation().toString());
        }
        
        // now repeat for the @declared versions
 
        before(SomeAnnotation sa) : execution(public ITDMe2.new(String)) && @annotation(sa) {
-               print(sa);
+               print(sa,thisJoinPoint.getSourceLocation().toString());
        }
        
        after(SomeAnnotation sa) : execution(private ITDMe2.new(int)) && @annotation(sa) {
-               print(sa);
+               print(sa,thisJoinPoint.getSourceLocation().toString());
        }
        
        before(SomeAnnotation sa) : execution(private ITDMe2.new(int)) && @annotation(sa) {
-               print(sa);
+               print(sa,thisJoinPoint.getSourceLocation().toString());
        }
        
        after(SomeAnnotation sa) : execution(public void ITDMe2.bar(int)) && @annotation(sa) {
-               print(sa);
-               MethodSignature sig = (MethodSignature) thisJoinPoint.getSignature();
-               Method meth = sig.getMethod();
-               Annotation[][] anns = meth.getParameterAnnotations();
-               System.out.println("method bar has " + anns.length + " params, first param annotation is " 
-                               + anns[0][0].toString());
+               print(sa,thisJoinPoint.getSourceLocation().toString());
+//             MethodSignature sig = (MethodSignature) thisJoinPoint.getSignature();
+//             Method meth = sig.getMethod();
+//             Annotation[][] anns = meth.getParameterAnnotations();
+//             System.out.println("method bar has " + anns.length + " params, first param annotation is " 
+//                             + anns[0][0].toString());
        }
        
        before(SomeAnnotation sa) : set(public Double ITDMe2.d) && @annotation(sa) {
-               print(sa);
+               print(sa,thisJoinPoint.getSourceLocation().toString());
        }
        
        after(SomeAnnotation sa) : set(private Float ITDMe2.f) && @annotation(sa) {
-               print(sa);
+               print(sa,thisJoinPoint.getSourceLocation().toString());
        }
                
-       private void print(SomeAnnotation sa) {
-               System.out.println(sa.s() + " " + sa.clazz().getName());
+       private void print(SomeAnnotation sa,String loc) {
+               System.err.println(sa.s() + " " + sa.clazz().getName()+" ("+loc+")");
        }
 }