Details
-
Bug
-
Resolution: Fixed
-
Major
-
17.0.0-rc-1
-
None
-
Unit
-
Unknown
-
N/A
-
N/A
-
Description
The Spoon build check InjectAnnotationProcessor of xwiki-commons-tool-spoon verifies that @Inject is only used on fields and only with component roles, which catches the injection of a component implementation class instead of its role. It only looks at javax.inject.Inject, so since XCOMMONS-2777 added support for the jakarta.inject annotations, fields annotated with jakarta.inject.Inject, which new code is supposed to use, aren't checked at all.
STEPS TO REPRODUCE:
- In a component of a module that runs the Spoon checks, inject a component implementation class (not its role) with @jakarta.inject.Inject.
- Build the module.
EXPECTED RESULTS: the build fails with "You must inject a component role", as it does with @javax.inject.Inject.
ACTUAL RESULTS: the build passes.
Attachments
Issue Links
- relates to
-
XCOMMONS-2777 Support both javax.inject and jakarta.inject annotations
-
- Closed
-