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

Replace usage of @AlternativePriority with @Alternative + @Priority #243

Merged
merged 1 commit into from
Feb 16, 2023

Conversation

Ladicek
Copy link
Contributor

@Ladicek Ladicek commented Feb 9, 2023

The @AlternativePriority annotation has been deprecated since Quarkus 2.6 and is being removed in Quarkus 3.0 (see quarkusio/quarkus#30963 and quarkusio/quarkus#31033). The replacement is a combination of @Alternative and @Priority.

There are in fact two @Priority annotations to choose from:

  • javax.annotation.Priority
  • io.quarkus.arc.Priority

The javax.annotation.Priority annotation cannot be put on methods, and its jakarta.annotation.Priority counterpart can only be put on methods since Common Annotations 2.1 (Jakarta EE 10).

Therefore, this commit uses io.quarkus.arc.Priority, even though it is getting deprecated in Quarkus 3.0, to allow maintaining Quarkus 2.x and 3.x compatibility in this project through mechanical transformation. If that is not necessary and this project moves to Quarkus 3.x unconditionally, using jakarta.annotation.Priority would be a better choice.

The `@AlternativePriority` annotation has been deprecated since Quarkus 2.6
and is being removed in Quarkus 3.0. The replacement is a combination of
`@Alternative` and `@Priority`.

There are in fact _two_ `@Priority` annotations to choose from:

- `javax.annotation.Priority`
- `io.quarkus.arc.Priority`

The `javax.annotation.Priority` annotation cannot be put on methods, and
its `jakarta.annotation.Priority` counterpart can only be put on methods
since Common Annotations 2.1 (Jakarta EE 10).

Therefore, this commit uses `io.quarkus.arc.Priority`, even though it is
getting deprecated in Quarkus 3.0, to allow maintaining Quarkus 2.x and 3.x
compatibility through mechanical transformation.
@ebullient ebullient merged commit a46ff3e into quarkiverse:main Feb 16, 2023
@Ladicek Ladicek deleted the remove-alternativepriority branch February 16, 2023 19:18
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 this pull request may close these issues.

3 participants