refactor(flow-task): 使用collect(Collectors.toList())替换toList()方法

refactor(flow-engine): 在`AssignUserFormStrategyImpl`中添加`Collectors`导入并使用`collect(Collectors.toList())`替换`toList()`方法

本次提交主要将Java 16引入的`toList()`方法替换为`collect(Collectors.toList())`,以确保代码在更低版本的Java环境中兼容。
This commit is contained in:
冷冷 committed 2025-03-10 13:30:21 +08:00
1 parent 71fe1e8de0
commit 2e3b4effe0
2 files changed
+3 -2

No files matched your search

@@ -14,6 +14,7 @@ import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 来自表单
@@ -37,7 +38,7 @@ public class AssignUserFormStrategyImpl implements AssignUserStrategy {
if (variable != null && !StrUtil.isBlankIfStr(variable)) {
String jsonString = objectMapper.writeValueAsString(variable);
List<NodeUser> nodeUserDtoList = JSONUtil.toList(jsonString, NodeUser.class);
assignList.addAll(nodeUserDtoList.stream().map(NodeUser::getId).toList());
assignList.addAll(nodeUserDtoList.stream().map(NodeUser::getId).collect(Collectors.toList()));
}
return assignList;
@@ -134,7 +134,7 @@ public class RemoteServiceImpl implements IRemoteService {
.getData()
.stream()
.map(SysUser::getUserId)
.toList();
.collect(Collectors.toList());
return R.ok(list);
}