未验证 提交 155eb559 编写于 作者: runphp's avatar runphp 提交者: Gitee

The 'filter().findAny().isPresent()' chain can be replaced with 'anyMatch()'

上级 27d46fc0
......@@ -44,7 +44,7 @@ public class BlackListUrlFilter extends AbstractGatewayFilterFactory<BlackListUr
public boolean matchBlacklist(String url)
{
return blacklistUrlPattern.isEmpty() ? false : blacklistUrlPattern.stream().filter(p -> p.matcher(url).find()).findAny().isPresent();
return !blacklistUrlPattern.isEmpty() && blacklistUrlPattern.stream().anyMatch(p -> p.matcher(url).find());
}
public List<String> getBlacklistUrl()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册