出现以下告警信息
Statement lambda can be replaced with expression lambda less... (Ctrl+F1)
This inspection reports lambda expressions with code block bodies when expression-style bodies can be used
将
List<StudentDetailDto> studentDetailDtoList = linkedHashMapList.stream().map(map -> {
return JSONObject.parseObject(JSONObject.toJSONString(map), StudentDetailDto.class);
}).collect(Collectors.toList());
改为以下
List<StudentDetailDto> studentDetailDtoList = linkedHashMapList.stream().map(map ->
JSONObject.parseObject(JSONObject.toJSONString(map), StudentDetailDto.class)
).collect(Collectors.toList());
即将
stream().map(map -> {
return express;
})
改为
stream().map(map ->
express
)