Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
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



Back to the top