Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-dev] type pattern "+" for declaring class

In each documentation about AspectJ that I found, it is stated that without "+" a type pattern specifies the exact type without sub types. However this documentation is at least ambiguous for type patterns used for the declaring class. Look at the following example:

class Shape {
  void moveBy(int x, int y) { (1) ... }
}

class Point extends Shape {
  void moveBy(int x, int y) { (2) ... }
}

Consider the pointcut: execution(* Shape.moveBy(int, int))

After reading the documentation, I expected that the pointcut only matches at point (1). But it matches at point (1) and point (2). I think, given that Java provides polymorphism, this behavior is correct. However I think that this breaks the invariant (which is stated in the documentation) that type patterns without "+" always specify the exact class.

I would be happy to hear from you how the semantics for type patterns with and without "+" in the declaring class are intended to be.

Thanks in advance,
Christoph Bockisch


--
Dipl.-Inform. Christoph Bockisch    bockisch@xxxxxxxxxxxxxxxxxxxxxxxxxx
Software Technology Group           Phone:  ++49 (0) 6151-16-3608
Darmstadt University of Technology  Fax:    ++49 (0) 6151-16-5410
Hochschulstr. 10, 64289 Darmstadt, Germany http://www.st.informatik.tu-darmstadt.de/


Back to the top