-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Fix compile warnings for spring-security-config #18596
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
base: main
Are you sure you want to change the base?
Changes from all commits
05becb5
debfd34
2d212dc
66d735b
f3084a2
341a6b4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,3 +8,4 @@ tasks.withType(JavaCompile) { | |
| tasks.withType(KotlinCompile) { | ||
| kotlinOptions.allWarningsAsErrors = true | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -284,6 +284,14 @@ final class SerializationSamples { | |
| Authentication authentication = TestAuthentication.authenticated(user); | ||
| SecurityContext securityContext = new SecurityContextImpl(authentication); | ||
|
|
||
| instancioByClassName.put(OneTimeTokenAuthenticationToken.class, () -> { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that since this is a test, we should leave this alone and suppress the warning
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point. I've reverted the changes to the test setup and instead added @SuppressWarnings("removal") directly to the Instancio.of(OneTimeTokenAuthenticationToken.class) initialization to suppress the deprecation warning. |
||
| @SuppressWarnings("removal") | ||
| InstancioOfClassApi<?> instancio = Instancio.of(OneTimeTokenAuthenticationToken.class); | ||
| instancio.supply(Select.all(OneTimeTokenAuthenticationToken.class), | ||
| (r) -> applyDetails(new OneTimeTokenAuthenticationToken("token"))); | ||
| return instancio; | ||
| }); | ||
|
|
||
| // oauth2-core | ||
| generatorByClassName.put(DefaultOAuth2User.class, (r) -> TestOAuth2Users.create()); | ||
| generatorByClassName.put(OAuth2AuthorizationRequest.class, | ||
|
|
@@ -597,8 +605,7 @@ final class SerializationSamples { | |
| token.setDetails(details); | ||
| return token; | ||
| }); | ||
| generatorByClassName.put(OneTimeTokenAuthenticationToken.class, | ||
| (r) -> applyDetails(new OneTimeTokenAuthenticationToken("username", "token"))); | ||
|
|
||
| generatorByClassName.put(OneTimeTokenAuthentication.class, | ||
| (r) -> applyDetails(new OneTimeTokenAuthentication("username", authentication.getAuthorities()))); | ||
| generatorByClassName.put(AccessDeniedException.class, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this removed? I think that we still need to fail if there are kotlin warnings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback! I've restored kotlinOptions.allWarningsAsErrors = true in the Gradle configuration.