Correctness29 - SpotBugsExtensionForSpringFrameWork/CS5098 GitHub Wiki

Programming Error name: @AliasFor cannot be used on any stereotype annotations (@Component and its specializations).

Description

"Creating aliases for attributes of annotations using yet another annotation @AliasFor does have limitations. @AliasFor cannot be used on any stereotype annotations (@Component and its specializations). The reason is that the special handling of these value attributes was in place years before @AliasFor was invented. Consequently, because of backward compatibility issues, it is simply not possible to use @AliasFor with such value attributes. When writing code to do just so (aliasing value attributes in stereotype annotations), no compile errors will be shown to you, and the code might even run, but any argument provided for the alias will be ignored. The same goes for the @Qualifier annotation as well."

Not sure about this content

Reference List

Pro Spring 5 (105 page)