-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Conditional check for data-source-ref is incorrect #14742
Conditional check for data-source-ref is incorrect #14742
Conversation
@sheriumair Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
@sheriumair Thank you for signing the Contributor License Agreement! |
@sheriumair thanks for the PR! It's possible the original code was incorrect (this code goes back to 2007), but the null check appears to have been intended to handle the situation where the
I'm not sure the fix is correct. Can you please update the PR to correctly fix the issue and add a test asserting the behavior you are fixing (e.g. an XML with missing |
Hey @sjohnr ! Thanks for pointing out this issue in my PR. |
Hey @sjohnr! Can you kindly review the PR, please? |
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 PR @sheriumair. Please see my comments below.
...springframework/security/config/authentication/JdbcUserServiceBeanDefinitionParserTests.java
Outdated
Show resolved
Hide resolved
...springframework/security/config/authentication/JdbcUserServiceBeanDefinitionParserTests.java
Outdated
Show resolved
Hide resolved
.../org/springframework/security/config/authentication/JdbcUserServiceBeanDefinitionParser.java
Outdated
Show resolved
Hide resolved
Hey @sjohnr. Thank you for your review. I have changed to |
Hey @sjohnr ! Apologies for the oversight, I committed the code without running the Checkstyle analysis. I have now corrected the code to adhere to the coding standards and have ensured that it passes the Checkstyle checks. Please review the updated PR. Thank you for your understanding. |
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 updates @sheriumair! Please see additional comments below.
...springframework/security/config/authentication/JdbcUserServiceBeanDefinitionParserTests.java
Outdated
Show resolved
Hide resolved
...springframework/security/config/authentication/JdbcUserServiceBeanDefinitionParserTests.java
Outdated
Show resolved
Hide resolved
Once you are finished with the above updates, would you mind please squashing your commits? |
c45d309
to
e084eef
Compare
Hey @sjohnr! I have squashed my commits and changed the XML to multi line |
Hi @sheriumair! Looks like there's still two commits? I think there should only be one. |
Fixed data source validation
e084eef
to
f99c58d
Compare
Hey @sjohnr . I hope my latest PR solves all the issues. |
Hey @sjohnr! Is there anything else that is left on my side? |
@sheriumair I don't believe so. I will work on getting this merged tomorrow. If anything is remaining I will apply a polish commit. Thanks for your contribution! |
Thanks @sheriumair! This has now been merged as 33ebd54 with polish commit 39dbd24. |
This PR removes a redundant conditional check in the doParse method of the specified class. The condition dataSource != null is always evaluated as true because the getAttribute method always returns a value. By removing this redundant check, the code becomes more concise and easier to read while maintaining the error handling logic when necessary. This change aligns with best practices for code simplification and improves code quality.