Polish Logging and Tests
Removing debug statements which would have prematurely terminated the stream, changing to AssertJ, and adding another test. Issue: gh-3743
This commit is contained in:
committed by
Josh Cummings
parent
92e68a589a
commit
50d26c9d28
@@ -175,21 +175,12 @@ public class DefaultMethodSecurityExpressionHandler extends
|
||||
|
||||
if (filterTarget instanceof Stream) {
|
||||
final Stream<?> original = (Stream<?>) filterTarget;
|
||||
if (debug) {
|
||||
logger.debug("Filtering stream with " + original.count() + " elements");
|
||||
}
|
||||
|
||||
Stream<?> filtered = original.filter(filterObject -> {
|
||||
return original.filter(filterObject -> {
|
||||
rootObject.setFilterObject(filterObject);
|
||||
return ExpressionUtils.evaluateAsBoolean(filterExpression, ctx);
|
||||
})
|
||||
.onClose(original::close);
|
||||
|
||||
if (debug) {
|
||||
logger.debug("Retaining elements: " + filtered.collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
return filtered;
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException(
|
||||
|
||||
Reference in New Issue
Block a user