解決思路:首先根據報錯定位到關鍵的一句話
list<charginPileVO>......
然後斷點,並且將這句話 add to watch 會出現真正的異常:java.lang.NullPointerException: cannot unbox null value
是因爲拆箱的時候對象爲空,所以拆箱報錯,integer對象到int基本類型會自動拆箱。而integer爲空,所以報錯。
解決思路:首先根據報錯定位到關鍵的一句話
list<charginPileVO>......
然後斷點,並且將這句話 add to watch 會出現真正的異常:java.lang.NullPointerException: cannot unbox null value
是因爲拆箱的時候對象爲空,所以拆箱報錯,integer對象到int基本類型會自動拆箱。而integer爲空,所以報錯。