mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
使用equals避免int值比较错误
This commit is contained in:
parent
d6118fe057
commit
173211eaef
@ -108,7 +108,7 @@ public class Opt<T> {
|
||||
* @since 5.7.17
|
||||
*/
|
||||
public static <T, R extends Collection<T>> Opt<R> ofEmptyAble(final R value) {
|
||||
return CollUtil.isEmpty(value) || Collections.frequency(value, null) == value.size() ? empty() : new Opt<>(value);
|
||||
return CollUtil.isEmpty(value) || Objects.equals(Collections.frequency(value, null), value.size()) ? empty() : new Opt<>(value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user