x 类型的表达式被装箱为 X?
我对我的 Eclipse IDE 当前正在自动装箱或自动取消装箱类型的每个表达式旁边写入的警告感到有点困惑:
The expression of type x is boxed into X
The expression of type X is unboxed into x
这是我应该做出反应的警告吗?我以为自动装箱是 Java 语言的一项功能 - 但现在我似乎每次使用此功能时都会收到警告。
I'm a little confused by a warning that my Eclipse IDE is currently writing next to every expression where types are autoboxed or autounboxed:
The expression of type x is boxed into X
The expression of type X is unboxed into x
Is this a warning I should react on? I thought autoboxing was a Java language feature - but now I seem to get warnings everytime this feature is used.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为 Eclipse 默认情况下不会这样做(我的没有),但您可以使用 Preferences > 来打开或关闭它。爪哇>编译器>错误/警告>潜在的编程问题>>装箱和拆箱转换。
除非您真的想了解这一点,否则应该是“忽略”。
I don't think Eclipse does this by default (mine does not), but you can turn it on or off using Preferences > Java > Compiler > Errors/Warnings > Potential programming problems > Boxing and Unboxing Conversions.
It should be "Ignore" unless you really want to know about this.