mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-07-13 22:03:33 +00:00
Converted to use guard clause to reduce nesting.
This commit is contained in:
parent
756be6fed3
commit
28a138f8ec
@ -54,8 +54,11 @@ public class FilterInvocationDefinitionSourceEditor extends PropertyEditorSuppor
|
|||||||
|
|
||||||
if ((s == null) || "".equals(s)) {
|
if ((s == null) || "".equals(s)) {
|
||||||
// Leave target object empty
|
// Leave target object empty
|
||||||
source.setDecorated(new RegExpBasedFilterInvocationDefinitionMap());
|
setValue(new RegExpBasedFilterInvocationDefinitionMap());
|
||||||
} else {
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if we need to override the default definition map
|
// Check if we need to override the default definition map
|
||||||
if (s.lastIndexOf(DIRECTIVE_PATTERN_TYPE_APACHE_ANT) != -1) {
|
if (s.lastIndexOf(DIRECTIVE_PATTERN_TYPE_APACHE_ANT) != -1) {
|
||||||
source.setDecorated(new PathBasedFilterInvocationDefinitionMap());
|
source.setDecorated(new PathBasedFilterInvocationDefinitionMap());
|
||||||
@ -161,8 +164,7 @@ public class FilterInvocationDefinitionSourceEditor extends PropertyEditorSuppor
|
|||||||
FilterInvocationDefinitionSourceMapping mapping = new FilterInvocationDefinitionSourceMapping();
|
FilterInvocationDefinitionSourceMapping mapping = new FilterInvocationDefinitionSourceMapping();
|
||||||
mapping.setUrl(name);
|
mapping.setUrl(name);
|
||||||
|
|
||||||
String[] tokens = org.springframework.util.StringUtils
|
String[] tokens = StringUtils.commaDelimitedListToStringArray(value);
|
||||||
.commaDelimitedListToStringArray(value);
|
|
||||||
|
|
||||||
for (int i = 0; i < tokens.length; i++) {
|
for (int i = 0; i < tokens.length; i++) {
|
||||||
mapping.addConfigAttribute(tokens[i].trim());
|
mapping.addConfigAttribute(tokens[i].trim());
|
||||||
@ -171,7 +173,7 @@ public class FilterInvocationDefinitionSourceEditor extends PropertyEditorSuppor
|
|||||||
mappings.add(mapping);
|
mappings.add(mapping);
|
||||||
}
|
}
|
||||||
source.setMappings(mappings);
|
source.setMappings(mappings);
|
||||||
}
|
|
||||||
|
|
||||||
setValue(source.getDecorated());
|
setValue(source.getDecorated());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user