Skip to content

Commit 8e2067b

Browse files
ngocnhan-tran1996jzheaux
authored andcommitted
Remove deprecated MemberCategory#DECLARED_FIELDS
Issue gh-16889 Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
1 parent 88369cd commit 8e2067b

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

core/src/main/java/org/springframework/security/aot/hint/AuthorizeReturnObjectHintsRegistrar.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -122,7 +122,7 @@ private void registerProxy(RuntimeHints hints, Class<?> clazz) {
122122
.registerType(clazz, MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
123123
MemberCategory.INVOKE_DECLARED_METHODS)
124124
.registerType(proxied, MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
125-
MemberCategory.INVOKE_DECLARED_METHODS, MemberCategory.DECLARED_FIELDS);
125+
MemberCategory.INVOKE_DECLARED_METHODS, MemberCategory.ACCESS_DECLARED_FIELDS);
126126
}
127127
}
128128

core/src/main/java/org/springframework/security/aot/hint/CoreSecurityRuntimeHints.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -79,7 +79,7 @@ private void registerExpressionEvaluationHints(RuntimeHints hints) {
7979
.registerTypes(
8080
List.of(TypeReference.of(SecurityExpressionOperations.class),
8181
TypeReference.of(SecurityExpressionRoot.class)),
82-
(builder) -> builder.withMembers(MemberCategory.DECLARED_FIELDS,
82+
(builder) -> builder.withMembers(MemberCategory.ACCESS_DECLARED_FIELDS,
8383
MemberCategory.INVOKE_DECLARED_METHODS));
8484
}
8585

core/src/test/java/org/springframework/security/aot/hint/CoreSecurityRuntimeHintsTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -81,15 +81,15 @@ void springSecurityMessagesBundleHasHints() {
8181
void securityExpressionOperationsHasHints() {
8282
assertThat(RuntimeHintsPredicates.reflection()
8383
.onType(SecurityExpressionOperations.class)
84-
.withMemberCategories(MemberCategory.DECLARED_FIELDS, MemberCategory.INVOKE_DECLARED_METHODS))
84+
.withMemberCategories(MemberCategory.ACCESS_DECLARED_FIELDS, MemberCategory.INVOKE_DECLARED_METHODS))
8585
.accepts(this.hints);
8686
}
8787

8888
@Test
8989
void securityExpressionRootHasHints() {
9090
assertThat(RuntimeHintsPredicates.reflection()
9191
.onType(SecurityExpressionRoot.class)
92-
.withMemberCategories(MemberCategory.DECLARED_FIELDS, MemberCategory.INVOKE_DECLARED_METHODS))
92+
.withMemberCategories(MemberCategory.ACCESS_DECLARED_FIELDS, MemberCategory.INVOKE_DECLARED_METHODS))
9393
.accepts(this.hints);
9494
}
9595

test/src/main/java/org/springframework/security/test/aot/hint/WebTestUtilsRuntimeHints.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -58,12 +58,12 @@ private void registerFilterChainProxyHints(RuntimeHints hints) {
5858
}
5959

6060
private void registerCsrfTokenRepositoryHints(RuntimeHints hints) {
61-
hints.reflection().registerType(CsrfFilter.class, MemberCategory.DECLARED_FIELDS);
61+
hints.reflection().registerType(CsrfFilter.class, MemberCategory.ACCESS_DECLARED_FIELDS);
6262
}
6363

6464
private void registerSecurityContextRepositoryHints(RuntimeHints hints) {
65-
hints.reflection().registerType(SecurityContextPersistenceFilter.class, MemberCategory.DECLARED_FIELDS);
66-
hints.reflection().registerType(SecurityContextHolderFilter.class, MemberCategory.DECLARED_FIELDS);
65+
hints.reflection().registerType(SecurityContextPersistenceFilter.class, MemberCategory.ACCESS_DECLARED_FIELDS);
66+
hints.reflection().registerType(SecurityContextHolderFilter.class, MemberCategory.ACCESS_DECLARED_FIELDS);
6767
}
6868

6969
}

test/src/test/java/org/springframework/security/test/aot/hint/WebTestUtilsRuntimeHintsTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -72,21 +72,21 @@ void compositeFilterChainProxyHasHints() {
7272
void csrfFilterHasHints() {
7373
assertThat(RuntimeHintsPredicates.reflection()
7474
.onType(CsrfFilter.class)
75-
.withMemberCategories(MemberCategory.DECLARED_FIELDS)).accepts(this.hints);
75+
.withMemberCategories(MemberCategory.ACCESS_DECLARED_FIELDS)).accepts(this.hints);
7676
}
7777

7878
@Test
7979
void securityContextPersistenceFilterHasHints() {
8080
assertThat(RuntimeHintsPredicates.reflection()
8181
.onType(SecurityContextPersistenceFilter.class)
82-
.withMemberCategories(MemberCategory.DECLARED_FIELDS)).accepts(this.hints);
82+
.withMemberCategories(MemberCategory.ACCESS_DECLARED_FIELDS)).accepts(this.hints);
8383
}
8484

8585
@Test
8686
void securityContextHolderFilterHasHints() {
8787
assertThat(RuntimeHintsPredicates.reflection()
8888
.onType(SecurityContextHolderFilter.class)
89-
.withMemberCategories(MemberCategory.DECLARED_FIELDS)).accepts(this.hints);
89+
.withMemberCategories(MemberCategory.ACCESS_DECLARED_FIELDS)).accepts(this.hints);
9090
}
9191

9292
}

web/src/main/java/org/springframework/security/web/aot/hint/WebMvcSecurityRuntimeHints.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -36,7 +36,7 @@ class WebMvcSecurityRuntimeHints implements RuntimeHintsRegistrar {
3636
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
3737
hints.reflection()
3838
.registerType(WebSecurityExpressionRoot.class, (builder) -> builder
39-
.withMembers(MemberCategory.INVOKE_DECLARED_METHODS, MemberCategory.DECLARED_FIELDS));
39+
.withMembers(MemberCategory.INVOKE_DECLARED_METHODS, MemberCategory.ACCESS_DECLARED_FIELDS));
4040
hints.reflection()
4141
.registerType(
4242
TypeReference

web/src/test/java/org/springframework/security/web/aot/hint/WebMvcSecurityRuntimeHintsTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -50,7 +50,7 @@ void setup() {
5050
void webSecurityExpressionRootHasHints() {
5151
assertThat(RuntimeHintsPredicates.reflection()
5252
.onType(WebSecurityExpressionRoot.class)
53-
.withMemberCategories(MemberCategory.INVOKE_DECLARED_METHODS, MemberCategory.DECLARED_FIELDS))
53+
.withMemberCategories(MemberCategory.INVOKE_DECLARED_METHODS, MemberCategory.ACCESS_DECLARED_FIELDS))
5454
.accepts(this.hints);
5555
}
5656

0 commit comments

Comments
 (0)