疯狂的狮子Li
2023-01-30 f0eae7cdb565ab6ef5fad3359fee428a4bd0ef0d
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/StreamUtils.java
@@ -30,7 +30,8 @@
        if (CollUtil.isEmpty(collection)) {
            return CollUtil.newArrayList();
        }
        return collection.stream().filter(function).toList();
        // 注意此处不要使用 .toList() 新语法 因为返回的是不可变List 会导致序列化问题
        return collection.stream().filter(function).collect(Collectors.toList());
    }
    /**
@@ -70,7 +71,8 @@
        if (CollUtil.isEmpty(collection)) {
            return CollUtil.newArrayList();
        }
        return collection.stream().sorted(comparing).toList();
        // 注意此处不要使用 .toList() 新语法 因为返回的是不可变List 会导致序列化问题
        return collection.stream().sorted(comparing).collect(Collectors.toList());
    }
    /**
@@ -188,7 +190,8 @@
            .stream()
            .map(function)
            .filter(Objects::nonNull)
            .toList();
            // 注意此处不要使用 .toList() 新语法 因为返回的是不可变List 会导致序列化问题
            .collect(Collectors.toList());
    }
    /**