Community
Participate
Working Groups
In this program: import java.lang.annotation.*; @Retention(RetentionPolicy.RUNTIME) @interface Anno {} public class Code { public Code(@Anno String boo) {} public Code(Object boo) {} } aspect X { before(): execution(new(!@Anno (*))) { } } It is incorrectly advising both constructors.
There is a behaviour in SignaturePattern.matchesExactlyMethod() that needs copying to matchesExactlyConstructor() - to pass the parameters annotations through on a second call to parameterTypes.matches() when considering the generic form of the parameters. Without that it is matching !@Anno against an empty set of annotations which is considered a valid match.
Fixed