Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] execution pointcut questions

...

The bug was caused because the code for ThrowsPattern mistakenly
used the internal protected method TypePattern.matchesExactly instead of
the external public method TypePattern.matchesStatically. Because the
classes were in the same package, Java's accessibility rules allowed
this. It would be nice if there was an easy way to specify that a
method could only be accessed from subtypes.

This sounds like another opportunity to add standards enforcement aspects with AspectJ:

declare error: call(* TypePattern.matchesExactly()) && !within(TypePattern+):
"call matchesExactly only from TypePattern and its subtypes";

As I recall, there's already one standards-enforcement aspect in the code.


Back to the top