Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jakarta Inject package name incorrect in BE_ANNOTATED_WITH_AN_INJECTION_ANNOTATION rule #1285

Closed
bbadjari opened this issue Apr 8, 2024 · 1 comment · Fixed by #1286
Closed

Comments

@bbadjari
Copy link

bbadjari commented Apr 8, 2024

Jakarta's Inject annotation package name used for the BE_ANNOTATED_WITH_AN_INJECTION_ANNOTATION rule in the GeneralCodingRules class is set to javax.inject.Inject when it should be jakarta.inject.Inject. See the related API documentation.

hankem added a commit that referenced this issue Apr 8, 2024
The condition `BE_ANNOTATED_WITH_AN_INJECTION_ANNOTATION` and the rule `NO_CLASSES_SHOULD_USE_FIELD_INJECTION`
previously considered the `javax.inject.Inject` and `javax.annotation.Resource` annotations,
but not their jakarta variants (`jakarta.inject.Inject` and `jakarta.annotation.Resource`).

Resolves: #1285

Signed-off-by: Manfred Hanke <[email protected]>
@hankem
Copy link
Member

hankem commented Apr 8, 2024

You're right: The rule had been added (#289) before Jakarta EE9 was introduced, and it was overlooked to update it to consider the jakarta package, too.

codecholeric pushed a commit that referenced this issue Apr 10, 2024
The condition `BE_ANNOTATED_WITH_AN_INJECTION_ANNOTATION` and the rule `NO_CLASSES_SHOULD_USE_FIELD_INJECTION`
previously considered the `javax.inject.Inject` and `javax.annotation.Resource` annotations,
but not their jakarta variants (`jakarta.inject.Inject` and `jakarta.annotation.Resource`).

Resolves: #1285

Signed-off-by: Manfred Hanke <[email protected]>
codecholeric added a commit that referenced this issue Apr 10, 2024
…1286)

The condition `BE_ANNOTATED_WITH_AN_INJECTION_ANNOTATION` and the rule
`NO_CLASSES_SHOULD_USE_FIELD_INJECTION` previously considered the
`javax.inject.Inject` and `javax.annotation.Resource` annotations, but
not their jakarta variants (`jakarta.inject.Inject` and
`jakarta.annotation.Resource`).

Resolves: #1285
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants