Skip to main content

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

Thanks, Andy,

you are right, code and advice are in the same project. That means
execute() is fine, right?

I'll try to follow your recommendations regarding the lowering of the
constraint barrier.

Jochen

On Tue, Jun 15, 2010 at 5:22 PM, Andy Clement <andrew.clement@xxxxxxxxx> wrote:
> 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
>>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>



-- 
Germanys national anthem is the most boring in the world - how telling!


Back to the top