x型的表达式被装入X? [英] The expression of type x is boxed into X?

查看:188
本文介绍了x型的表达式被装入X?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有点困惑,我的Eclipse IDE正在每个表达式旁边写着类型为autoboxed或autounboxed的警告:

 类型x的表达式被包装到X 

类型X的表达式被取消装箱到x

这是我应该做出的一个警告吗?我认为自动装箱是一种Java语言功能 - 但是现在我每次使用此功能时都会收到警告。

解决方案

不要认为Eclipse默认情况下这样做(我的不),但是您可以使用首选项> 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.

解决方案

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.

这篇关于x型的表达式被装入X?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆