x的表达式被装入X?

B.E*_*.E. 9 java eclipse autoboxing

我有点担心我的Eclipse IDE当前正在写入自动编码或自动装箱类型的每个表达式旁边的警告:

The expression of type x is boxed into X

The expression of type X is unboxed into x
Run Code Online (Sandbox Code Playgroud)

这是一个我应该做出反应的警告吗?我认为autoboxing是一种Java语言功能 - 但现在每次使用此功能时我似乎都会收到警告.

Thi*_*ilo 6

我不认为Eclipse默认情况下这样做(我没有),但你可以使用Preferences> Java> Compiler> Errors/Warnings> Potential programming problems> Boxing and Unboxing Conversions打开或关闭它.

它应该是"忽略",除非你真的想知道这一点.