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?

Hi,

> 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 :) ).

I only slapped those %..%s out to demonstrate the concept of using
inserts rather than executing code to create the message.

> 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.

Indeed, I am the creator of SpEL after all so should keep that in mind :)


> 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.

This idea of mirroring the API usage is mentioned in bug 48080 (see
the first comment by Jim).  I have just committed the following
support:

  declare warning: execution(* A.m(..)): "joinpoint location is
{joinpoint.sourcelocation.sourcefile}:{joinpoint.sourcelocation.line}";
  declare warning: execution(* A.m(..)): "joinpoint is {joinpoint}";
  declare warning: execution(* A.m(..)): "joinpoint kind is '{joinpoint.kind}'";
  declare warning: execution(* A.m(..)): "joinpoint line is
'{joinpoint.sourcelocation.line}'";
  declare warning: get(int *) && within(A): "joinpoint signature is
{joinpoint.signature}";
  declare warning: execution(* A.m(..)): "joinpoint declaring type is
{joinpoint.signature.declaringType}";
  declare warning: execution(* A.m(..)): "advice sourcelocation is
{advice.sourcelocation.sourcefile}:{advice.sourcelocation.line}";
  declare warning: get(int *): "aspect is {advice.aspecttype}";
  declare warning: get(int *): "signature name for field is
{joinpoint.signature.name}";
  declare warning: execution(* A.m(..)): "signature name for method is
{joinpoint.signature.name}";

Andy


Back to the top