From: aclement Date: Wed, 23 Mar 2005 16:52:04 +0000 (+0000) Subject: reworked, temporarily commented out the MethodSignature stuff as it misbehaves for me. X-Git-Tag: V1_5_0M2~20 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b617e0709eea6164de4e66045d5eba59dc8bc0fd;p=aspectj.git reworked, temporarily commented out the MethodSignature stuff as it misbehaves for me. --- diff --git a/tests/java5/annotations/itds/AnnotationsAndITDs.aj b/tests/java5/annotations/itds/AnnotationsAndITDs.aj index 2e51f3e12..104681419 100644 --- a/tests/java5/annotations/itds/AnnotationsAndITDs.aj +++ b/tests/java5/annotations/itds/AnnotationsAndITDs.aj @@ -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+")"); } }