Why auto-boxing marked as a warning?

后端 未结 3 2315
误落风尘
误落风尘 2021-02-19 11:54

I understand that auto un-boxing should be done with care because the reference that is being un-boxed can be null. Why is auto-boxing marked as warning as well? Are there some

3条回答
  •  半阙折子戏
    2021-02-19 13:00

    I was going to disable this Eclipse warning but the following article made me consider not to. I'm still not completely sure but it looks to me like those might be good reasons to just avoid autoboxing.

    https://effective-java.com/2010/05/the-advantages-and-traps-of-autoboxing/

提交回复
热议问题