[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Advice doesn't match

Hi,

I presume your aspect and the code you are trying to weave are in the
same project?  More specifically the joinpoint for execution of your
fromString(String) method is in the same project as your aspect?  If
fromString() were in a library, you would probably need to use a call
pointcut instead.

Other things to try - relax some of the constraints in the pointcut,
can you get it to match?  That will help work out which piece is
causing you problems.  First I'd recommend removing the declaring type
from the pointcut - does that cause it to match?

cheers,
Andy

> String around(String s): execution(public static String fromString(String))

On 10 June 2010 02:05, Jochen Wiedmann <jochen.wiedmann@xxxxxxxxx> wrote:
> Hi,
>
> sorry for the beginners question, but I am currently lost. I am trying
> to apply the following advice. Unfortunately, the Eclipse plugin
> insists in displaying the warning
>
>    advice defined in ... has not been applied [Xlint:adviceDidNotMatch]
>
> and, indeed, the System.err line never seems to be executed, although
> it seems to be sufficiently clear and unambiguous. I tried both the
> Eclipse plugin and the Maven plugin, same results.
>
> Thanks,
>
> Jochen
>
>
> package com.tsystems.icto.tom.cssadapter.mapper;
>
> public aspect CssSmbbMappings {
>        String around(String s): execution(public static String
> com.tsystems.icto.tom.cssadapter.smbb.vo.ItemType.fromString(String))
> && args(s) {
>        System.err.println("Inside around, value = " + s);
>        if (s == null  ||  s.trim().length() == 0) {
>            return null;
>        }
>        return proceed(s);
>        }
> }
>
>
>
> --
> Germanys national anthem is the most boring in the world - how telling!
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>