[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [aspectj-users] array pointcuts?
|
Mark,
>but I wonder if 'call' type joint points would be feasible.
If the join point doesn't exist then neither execution nor call pointcuts
will match. This isn't a question of the target class not being exposed to
the weaver e.g. you are tying to advise the construction of a library class
so you must use call rather than execution. I think what you are thinking
of is a "call to object allocation" join point which exists at the bytecode
level (new, newarray, ...) but not in the Java language: Java doesn't give
you uninitialized objects (array elements are initialized to their default
values).
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/
"Mark van der Kraan" <mark@xxxxxxxxxxxxxxxx>@eclipse.org on 22/09/2004
11:07:59
Please respond to aspectj-users@xxxxxxxxxxx
Sent by: aspectj-users-admin@xxxxxxxxxxx
To: <aspectj-users@xxxxxxxxxxx>
cc:
Subject: Re: [aspectj-users] array pointcuts?
Hi Matthew,
Thank you for your extensive answer. You guys must sometimes get a little
bit tired of these "why can't I do X" questions :-)
I can understand that you can't have 'execute' array construction join
points
(since the type is created at runtime), but I wonder if 'call' type joint
points
would be feasible. I'll take my questions to the dev list as you suggested.
Cheers,
Mark
> Mark,
>
> There is no initialization (or preinitialization) joint point for array
> types as they do not have constructors. They do have a
staticinitialization
> join point but this is not accessible as array classes are generated at
> runtime by the JVM.
>
> String s = new String(); // Call constructor
> String sa = new String[1]; // No constructor
>
> See this thread:
> http://dev.eclipse.org/mhonarc/lists/aspectj-users/msg02494.html
>
> In addition there is no array element get/set pointcut, these are both
> treated as get join points on the array object itself, so there is no way
> of telling which array element is being accessed or what it's value is.
The
> initial array allocation is a set join point. There has been some
> discussion on this subject
> http://dev.eclipse.org/mhonarc/lists/aspectj-users/msg00932.html before
> although none on aspectj-dev so you might like to request an enhancement
to
> the pointcut language there.
>
> 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/
>
>
> "Mark van der Kraan" <mark@xxxxxxxxxxxxxxxx>@eclipse.org on 21/09/2004
> 14:53:53
> To: <aspectj-users@xxxxxxxxxxx>
> cc:
> Subject: [aspectj-users] array pointcuts?
>
>
> Hi,
>
> I am somewhat surprised that there seems to be no support for pointcut
> expressions
> for array creation and array read/write access, similar to pointcuts for
> object creation and
> get/set field access. Am I wrong? And if I'm right, are there any plans
for
> adding
> these in the future?
>
> Cheers,
> Mark
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users