-
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
fixes setting paramName only when it is not null #6332
Conversation
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 @ankurpathak! I have provided feedback inline.
|
||
@Override | ||
public void setVariable(String name, @Nullable Object value) { | ||
if (name == null) |
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.
Please add {
to follow Spring Security's code conventions
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.
Added { to if part.
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.
Do we need to add it for else part as well??
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.
Yes. We do not use implied {
for one line statements
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.
Added for else part as well.
@@ -112,7 +112,9 @@ private void addArgumentsAsVariables() { | |||
} | |||
|
|||
for (int i = 0; i < args.length; i++) { | |||
super.setVariable(paramNames[i], args[i]); | |||
if (paramNames[i] != null) { | |||
super.setVariable(paramNames[i], args[i]); |
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.
For the test below to work, you need to remove super.
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.
Removed super.
private AuthenticationTrustResolver trustResolver; | ||
|
||
@Test | ||
public void setVariableTest() { |
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.
please rename to lookupVariableWhenParameterNameNullThenNotSet
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.
renamed test to lookupVariableWhenParameterNameNullThenNotSet
e6a0212
to
dad649d
Compare
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.
I just noticed that the commit references an invalid ticket. Can you update it to be Fixes: gh-6223
?
dad649d
to
7d437a4
Compare
changed commit message to reflect Fixes: gh-6223. |
Thanks @ankurpathak! This is now merged into master |
Fixes: gh-6223