Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Does target() work when calling static methods

That is correct interpretation. target() and this() work only for
non-static methods.

-Ramnivas

On Mon, Mar 9, 2009 at 4:16 AM, Jochen Wuttke <jochen.wuttke@xxxxxx> wrote:
> Hi,
>
> I have an aspect that does not do what I expect. The pointcut looks like
> this:
>
>    pointcut initMethod(): target(JspFactory)
>        && call(* javax.servlet.jsp.JspFactory.setDefaultFactory(..));
>
> The advice addressed by this joinpoint doesn't get woven and I start
> suspecting that this is because #setDefaultFactory is static, and hence
> there is no target object. Is that a correct interpretation or am I missing
> something else?
>
> Jochen
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


Back to the top