element cannot be mapped to a null key 全局異常解決辦法

緣由:出現此異常是因爲stream流中中出現空元素致使的.解決思路和blog 相關代碼以下:stream 在stream流中有groupingBy,若是groupingBy(元素爲空),就會引起異常.im 以下圖,添加一個非空過濾的filter便可.異常
相關文章
相關標籤/搜索