从标题错误来看是 lambada里面变量需要是final类型
所以我下面代码报错 了

使用数组传值 绕过这个规则
days.parallelStream().forEach(n->{
String timeKey = n.replaceAll("-","");
//根据项目名称
List<String> catServiceNames = catService.getCatServiceNames();
Integer[] totalVisitNumForThisTimekey = new Integer[]{0};
catServiceNames.stream().forEach(p->{
totalVisitNumForThisTimekey[0]+=CatVisitStorage.getDayData(timeKey).get(p)==null ? 0 :CatVisitStorage.getDayData(timeKey).get(p);
});
CatVisitStorage.setDayData(timeKey,"total", totalVisitNumForThisTimekey[0]);
});


被折叠的 条评论
为什么被折叠?



