Reinstate qualifier support for JSR-330 @⁠javax.inject.Named

This commit revises QualifierAnnotationAutowireCandidateResolver to
reinstate "qualifier" support for the legacy JSR-330
@⁠javax.inject.Named annotation.

See gh-31090
Closes gh-33345
This commit is contained in:
Sam Brannen
2024-08-08 12:25:31 +03:00
parent f9d2641fd5
commit bcffa15c7d
5 changed files with 155 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,6 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* Tests for {@link JakartaAnnotationsRuntimeHints}.
*
* @author Brian Clozel
* @author Sam Brannen
*/
class JakartaAnnotationsRuntimeHintsTests {
@@ -62,4 +63,14 @@ class JakartaAnnotationsRuntimeHintsTests {
assertThat(RuntimeHintsPredicates.reflection().onType(Qualifier.class)).accepts(this.hints);
}
@Test // gh-33345
void javaxInjectAnnotationHasHints() {
assertThat(RuntimeHintsPredicates.reflection().onType(javax.inject.Inject.class)).accepts(this.hints);
}
@Test // gh-33345
void javaxQualifierAnnotationHasHints() {
assertThat(RuntimeHintsPredicates.reflection().onType(javax.inject.Qualifier.class)).accepts(this.hints);
}
}