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 did flinch a bit when I saw your syntax proposal of "%...%" (very
Windows shell-esque) with cryptic tokens "DT" and "N".  I'm never
going to remember those (my brain's getting full & needs to do some
garbage collection, but the GC thread isn't at a high enough priority
yet :) ).

Please consider other Java-centric syntaxes that are already out there
for replacement, like Ant/Servlet-Unified-EL/Bash ("${...}"), printf
("%..."), and SpEL/JSF ("#{...}").  I would prefer to use a syntax
that is as close to Java as possible, since that's the environment in
which it will be used.

Also, I'd vote for spelled out implicit objects, like in JSP
("session", "request", etc).  For example, "declaredType" and "name"
instead of "DT" & "N".  It's just more Java-like.

WDYT?

-matthew

On Fri, Mar 12, 2010 at 8:39 AM, Andy Clement <andrew.clement@xxxxxxxxx> wrote:
>> 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
>



-- 
mailto:matthew@xxxxxxxxxxxxxxx
skype:matthewadams12
yahoo:matthewadams
aol:matthewadams12
google-talk:matthewadams12@xxxxxxxxx
msn:matthew@xxxxxxxxxxxxxxx
http://matthewadams.me
http://www.linkedin.com/in/matthewadams


Back to the top