-
Notifications
You must be signed in to change notification settings - Fork 813
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
WW-5406 Ensure Action excluded patterns are reinjected #910
Conversation
b27a28d
to
6f6b136
Compare
6f6b136
to
efa2042
Compare
Ignore SonarCloud results, they are incorrect again |
Probably because the last scan was for Struts 7 branch, I will fix that |
@Inject(value = StrutsConstants.STRUTS_ACTION_EXCLUDE_PATTERN_SEPARATOR, required = false) | ||
public void setActionExcludedPatternsSeparator(String separator) { | ||
this.actionExcludedPatternsSeparator = separator; | ||
} | ||
|
||
@Inject(value = StrutsConstants.STRUTS_ACTION_EXCLUDE_PATTERN, required = false) | ||
public void setActionExcludedPatterns(String excludedPatterns) { | ||
this.actionExcludedPatterns = buildExcludedPatternsList(excludedPatterns, actionExcludedPatternsSeparator); | ||
} | ||
|
||
private static List<Pattern> buildExcludedPatternsList(String patterns, String separator) { | ||
if (patterns == null || patterns.trim().isEmpty()) { | ||
return emptyList(); | ||
} | ||
return unmodifiableList(Arrays.stream(patterns.split(separator)).map(String::trim).map(Pattern::compile).collect(toList())); | ||
} | ||
|
||
public List<Pattern> getActionExcludedPatterns() { | ||
return actionExcludedPatterns; | ||
} |
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.
It's getting crowd'y here, what about moving all the injectable options into DispatcherOptions
? It doesn't have to happen now, but I can create a ticket to address that later
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.
Yep I think that's a fair call, I'll create an issue for it
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.
@@ -43,6 +43,8 @@ public class StrutsPrepareFilter implements StrutsStatics, Filter { | |||
protected static final String REQUEST_EXCLUDED_FROM_ACTION_MAPPING = StrutsPrepareFilter.class.getName() + ".REQUEST_EXCLUDED_FROM_ACTION_MAPPING"; | |||
|
|||
protected PrepareOperations prepare; | |||
|
|||
@Deprecated |
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 document why it's deprecated and what to use instead. Also since
should be added, and feel free to create a ticket in JIRA to remove this deprecated element in Struts 7. An example deprecation
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.
Yep let me rectify
Regarding a ticket for the deletion - my assumption would be that all deprecated elements are deleted in the next major version. Do we still require individual follow-up issues in the case of a deprecation?
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.
We can have one general ticket to remove all the deprecated options, just to be sure we won't miss this one at some point (so since
would be needed)
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.
Fixed and created this general issue - WW-5411
Ah wait, just realised I made a breaking change in PrepareOperations.java, let me fix that |
Done - looks like the quality gate is failing due to the deprecations |
Quality Gate failedFailed conditions See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
WW-5406