Update hutool-core/src/main/java/cn/hutool/core/tree/BeanTree.java

This commit is contained in:
Createsequence 2022-11-28 09:34:49 +00:00 committed by Gitee
parent 720476f95c
commit 01bc7e6c16
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -129,7 +129,7 @@ public class BeanTree<T, R extends Comparable<R>> {
}
if (Objects.isNull(parentPredicate)) {
final Map<R, List<T>> pIdValuesMap = EasyStream.of(list)
.peek(e -> Objects.requireNonNull(idGetter.apply(e), "The id of tree node must not be null")
.peek(e -> Assert.notNull(idGetter.apply(e), "The id of tree node must not be null {}", e))
).group(pidGetter);
final List<T> parents = pIdValuesMap.getOrDefault(pidValue, new ArrayList<>());
findChildren(list, pIdValuesMap);