[External] : Re: Proposal: Allow annotations on module directives

Alex Buckley alex.buckley at oracle.com
Tue Nov 12 19:01:18 UTC 2024


On 11/12/2024 10:47 AM, Alessandro Autiero wrote:
> I've included this possibility as last as I don't see any indication 
> that any similar work was done for JEP 120, where the only claimed 
> motivation
> 
>     Frequently-used idioms of programming with annotations in EE and
>     elsewhere awkwardly use a container annotation just to simulate the
>     ability to apply multiple annotations
> 
> seems to be purely anecdotal.

The claim about needing awkward container annotations came directly from 
a Java EE spec lead. Here's an example:

https://docs.oracle.com/cd/E13222_01/wls/docs100/programming/annotate_dependency.html#wp1111955

I forget the other examples, but the use cases are easily found:

https://stackoverflow.com/questions/17000193/can-we-have-more-than-one-path-annotation-for-same-rest-method

https://stackoverflow.com/questions/2513031/how-to-use-multiple-requestmapping-annotations-in-spring?noredirect=1&lq=1

Alex



More information about the compiler-dev mailing list