Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] Can we access any static join point information in declare error/warning?

I created a new bug: Bug 305705 - Need context information (flexible would be nice) in declare warning/error messages

Anything that allow at least to show method and its parameters type will be a huge gain.

-----Original Message-----
From: aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Andy Clement
Sent: Friday, March 12, 2010 11:40 AM
To: aspectj-users@xxxxxxxxxxx
Subject: Re: [aspectj-users] Can we access any static join point information in declare error/warning?

> Looks like the feature you describe is a vaporware: http://en.wikipedia.org/wiki/Vaporware
>
> The bug do not have any patch attachment and I'm unable to find the code in latest source code release of AspectJ.

Yes, I never said it was implemented yet, I was discussing what could
be done.  After re-reading 48080 I see that it looks to have been
closed implementing something other than it was opened for (nice...) -
and I could see how you might be thinking it was already possible.

> At runtime I get no substitution: "warning at com.test.LookupSvcBD.java:411::0 Please change EJB remoteSignature to local call: %DT%.%N%"

Nope, you won't, as I just made up that syntax as a possible thing we could do.

> So many related bugs under 48080 have been closed and at the end we get no improvement of any kind.
>
> Declare warning/error is executed by AspectJ compiler so I don't think it's awkward that it compile declare section to be executed.

Supporting that is far more complicated than just allowing inserts in
the message.  As inserts would address every case I know of, why would
I spend extra effort on the unnecessary complexity?  If you have a
situation that cannot be handled by supporting inserts, please let me
know.

Andy

>
>
> -----Original Message-----
> From: aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Andy Clement
> Sent: Wednesday, March 03, 2010 1:02 PM
> To: aspectj-users@xxxxxxxxxxx
> Subject: Re: [aspectj-users] Can we access any static join point information in declare error/warning?
>
> Declare warning and error are matched during compilation.  This means
> it would be a little awkward to run any code being compiled as part of
> producing the message.  However, with appropriate definition of
> inserts, we are basically talking about the same feature:
>
> %DT% - declaring type name
> %N% - name
>
> declare warning: call(* Hello.*(..)): "Illegal call to %DT%.%N%(..)";
>
>
> Andy
>
> On 3 March 2010 09:34, Sebastien Tardif <stardif@xxxxxxxxxxxx> wrote:
>> This bug exist: https://bugs.eclipse.org/bugs/show_bug.cgi?id=48080
>>
>> The following syntax is obviously very natural and I was surprise it doesn't work:
>>
>>  declare warning: call(* Hello.*(..)) {
>>        Signature sig = thisJoinPointStaticPart.getSignature();
>>        return "Illegal call to " + sig.getDeclaringType().getName() +
>>            "." + sig.getName() + "(..)";
>>    }
>>
>>
>> ________________________________
>>
>> From: aspectj-users-bounces@xxxxxxxxxxx on behalf of Andy Clement
>> Sent: Wed 3/3/2010 12:17 PM
>> To: aspectj-users@xxxxxxxxxxx
>> Subject: Re: [aspectj-users] Can we access any static join point information in declare error/warning?
>>
>>
>>
>> I thought we already had an enhancement request open for that, but I
>> couldn't find it.  Feel free to raise it.  But just to check we both
>> mean the same thing, in my mind this feature means the static join
>> point information can be inserted into the message string:
>>
>> declare warning: execution(@Foo *(..)): "Method %M is annotated Foo!!";
>>
>> Is that what you mean too?
>>
>> You can get some way along by registering your own message handler
>> with AspectJ and processing declare errors/warnings in it.  It at
>> least gives you the source location to do some extra processing and
>> possibly augment the text, but I can't quite recall it if gives you
>> the joinpoint too.
>>
>> Andy
>>
>> On 2 March 2010 19:05, Sebastien Tardif <stardif@xxxxxxxxxxxx> wrote:
>>> Can we access any static join point information in declare error/warning message?
>>>
>>> Looks like that should be easy to support.
>>>
>>> I want to use this feature to error out only on new policy violation, so first pass is to use warning to find all the violation, and I prefer getting a useful string so that it is easy to copy/paste to the declare error.
>>>
>>> End result will be that legacy policy violation will show warning, new policy violation will generate error.
>>>
>>>
>>> _______________________________________________
>>> 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
>>
>>
>>
>> _______________________________________________
>> 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
> _______________________________________________
> 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


Back to the top