Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Matching on one of an annotation's values in a multivalued property?

Hmmm.  While I see your point, it does fit the mold when you consider that
multivalued annotation properties still accept a single-valued notation in
Java itself.  The form "@Gimme(Serializable.class)" is equivalent to
"@Gimme({Serializable.class})".

I suppose that I'm a bit more pragmatic about it, and would accept
overloading "=" to mean "contains".  I know that my annotation property
started single-valued, then I change to multivalued when I discovered its
limitation.  Had aspectj supported multivalued attribute properties as
strictly as you're suggesting, then I would've had to also update my type
expression accordingly, which would've been kind of a pain.

Since Java itself is willing to provide the single-valued shortcut, I'm also
willing to do the same in pointcut matching.  You could even argue that by
not overloading "=", you are violating the principle of least surprise.

I propose that "=" support the single-valued case and, in the future, be
overloaded to mean "contains" when full multivalued support is introduced.

-matthew



--
View this message in context: http://aspectj.2085585.n4.nabble.com/Matching-on-one-of-an-annotation-s-values-in-a-multivalued-property-tp4650839p4650846.html
Sent from the AspectJ - users mailing list archive at Nabble.com.


Back to the top