Skip to content

Conversation

@kmw10693
Copy link

#18440

Here's an explanation of the compiler warnings fixed in this PR:

Fixed Warnings
1. WebSecurityConfigurationTests.java
image

Issue: Raw type warning due to missing generic type specification in ClassUtils.getMethod() call

Fix: Added (Class<?>[]) cast to ensure generic type safety


2. OneTimeTokenAuthenticationTokenTests.java
image

Issue: Warning from using deprecated functionality

Fix: Added @SuppressWarnings("removal") annotation to suppress the deprecation warning


3. OneTimeTokenReactiveAuthenticationManagerTests.java
image

Issue: Deprecation warnings from using deprecated OneTimeTokenAuthenticationToken or related deprecated APIs throughout the test methods

Fix: Added @SuppressWarnings("removal") annotation to each test method that uses the deprecated functionality


4. AuthorityAuthorizationManagerTests.java
image

Issue: Ambiguous method call warnings. Passing null directly to varargs methods like hasAnyRole(String...) and hasAnyAuthority(String...) creates ambiguity - the compiler can't determine if null represents a null array or an array containing a single null element

Fix: Added explicit (String[]) cast to clarify that null represents a null array, not a single null element


5. DefaultMethodSecurityExpressionHandlerKotlinTests.kt
image

Issue: Kotlin's "unchecked cast" warnings when casting generic types. The compiler cannot verify at runtime that the cast to parameterized types like Map<String, String>, Collection, Array, or Stream is type-safe, since generic type information is erased at runtime
Fix: Added @Suppress("UNCHECKED_CAST") annotation to explicitly acknowledge and suppress these unavoidable warnings


6/ DelegatingAuthenticationEntryPointTests.java
image

Issue: Deprecation warnings from using the deprecated DelegatingAuthenticationEntryPoint class or its constructors/methods

Fix: Added @SuppressWarnings("removal") annotation to each test method that uses the deprecated functionality


7. OneTimeTokenAuthenticationFilterTests.java
Issue: Deprecation warnings from using deprecated OneTimeTokenAuthenticationFilter or related one-time token authentication APIs
image

Fix: Added @SuppressWarnings("removal") annotation to each test method that uses the deprecated functionality

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 26, 2026
Signed-off-by: Minu Kim <kmw106933@naver.com>
@kmw10693 kmw10693 force-pushed the gh-18440-spring-security-test branch from 8dc0386 to 15a34fa Compare January 26, 2026 15:11
Signed-off-by: Minu Kim <kmw106933@naver.com>
@rwinch rwinch changed the title fix compile warning in spring-security-test Fix compile warning in spring-security-test Jan 26, 2026
@rwinch rwinch self-assigned this Jan 26, 2026
@rwinch rwinch added in: build An issue in the build in: test An issue in spring-security-test type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 26, 2026
@rwinch rwinch added this to the 7.1.0-M2 milestone Jan 26, 2026
@rwinch
Copy link
Member

rwinch commented Jan 26, 2026

Thanks for the Pull Request! This is will be merged into main when the build passes 😄

Signed-off-by: Minu Kim <kmw106933@naver.com>
@kmw10693
Copy link
Author

Thanks for the Pull Request! This is will be merged into main when the build passes 😄

Thanks! I fixed the code format style

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: build An issue in the build in: test An issue in spring-security-test type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants