原先代码:
MapeventStatusMap = new HashMap<>(); eventStatusMap.putAll(selectSystemLocations(system.getId()).stream() .collect(Collectors.toMap(SystemEventLocation::getId,SystemEventLocation::getEventStatus));
修改后的代码:
MapeventStatusMap = new HashMap<>(); eventStatusMap.putAll(selectSystemLocations(system.getId()).stream() .collect(HashMap::new ,(map, systemEventLocation)->map.put(systemEventLocation.getId(),systemEventLocation.getEventStatus()) ,HashMap::putAll));



