[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[aspectj-users] Re: Re: Array Constructor Pointcut ?
|
The fact that the following code compiles suggests that this is not a
language restriction:
public aspect Aspect {
pointcut initArray () :
call(String[].new(..));
after () : initArray() {
System.err.println("? " + thisJoinPoint
.getSignature().getName());
}
pointcut all () :
within(Test);
after () : all() {
System.err.println("? " + thisJoinPoint);
}
}
public class Test {
public static void main(String[] args) {
String s = new String("Hello");
String[] sa = new String[1];
int[] ia = new int[1];
}
}
However the output indicated the array construction join point is not
recognized by AspectJ although there is a bytecode associated with it
(newarray/anewarray):
? staticinitialization(Test.<clinit>)
? call(java.lang.String(String))
? execution(void Test.main(String[]))
This is probably a complier bug.
Matthew Webster
AOSD Project
Java Technology Centre, MP146
IBM Hursley Park, Winchester, SO21 2JN, England
Telephone: +44 196 2816139 (external) 246139 (internal)
Email: Matthew Webster/UK/IBM @ IBMGB, matthew_webster@xxxxxxxxxx
http://w3.hursley.ibm.com/~websterm/