Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-dev] type patterns: member types of generic classes?

Hi all,

( I hope this question is appropriate on aspectj-dev. I'm new on this
list, but thought this was too technical for aspectj-users ... I'm
sorry if this is the wrong place)

I've been reviewing the syntactic changes of AspectJ in 5.0 and I was
wondering if there is any reason why type patterns have not been
extended to match member types of generic classes. I've looked into
the bugzilla database, but cannot find anything there about this.

Example:
-------------------------------------------------------------
public class TypePattern {
  public static Foo<String>.Bar<String> x;

  public static void main(String[] ps) {
    Object f = x;
  }
}

class Foo<T> {
  class Bar<S> {
  }
}

aspect Get {
  pointcut foo() : get(Foo<String>.Bar<String> *.x);

  before() : foo() {
    System.out.println("Get of x!");
  }
}
-------------------------------------------------------------

The advice is applied if I use Foo.Bar<String>, but I think it would
be nice if you could specify the actual type parameter of the
enclosing class as well.

Has this been left out on purpose or is this a new issue and should I
file a bug?

Cheers,
--
Martin Bravenboer
---------------------------------------------------------------------
Center for Software Technology
Institute of Information and Computing Sciences
Utrecht University


Back to the top