[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!