Skip to content

Commit 85c7643

Browse files
committed
Remove use of 'javax.annotation.Resource'
This commit removes the only use of the `javax.annotation.Resource` annotation from the codebase. This ensures that injection point are only defined with Spring's annotation model. Closes gh-9441
1 parent 58a1ed1 commit 85c7643

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2RestOperationsConfiguration.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616

1717
package org.springframework.boot.autoconfigure.security.oauth2.client;
1818

19-
import javax.annotation.Resource;
20-
19+
import org.springframework.beans.factory.ObjectProvider;
2120
import org.springframework.beans.factory.annotation.Qualifier;
2221
import org.springframework.boot.autoconfigure.condition.AnyNestedCondition;
2322
import org.springframework.boot.autoconfigure.condition.ConditionMessage;
@@ -106,9 +105,12 @@ public FilterRegistrationBean oauth2ClientFilterRegistration(
106105
@Configuration
107106
protected static class ClientContextConfiguration {
108107

109-
@Resource
110-
@Qualifier("accessTokenRequest")
111-
protected AccessTokenRequest accessTokenRequest;
108+
private final AccessTokenRequest accessTokenRequest;
109+
110+
public ClientContextConfiguration(@Qualifier("accessTokenRequest")
111+
ObjectProvider<AccessTokenRequest> accessTokenRequest) {
112+
this.accessTokenRequest = accessTokenRequest.getIfAvailable();
113+
}
112114

113115
@Bean
114116
@Scope(value = "session", proxyMode = ScopedProxyMode.INTERFACES)

0 commit comments

Comments
 (0)