我应该关闭哪些编译器警告?
我正在重构 java 1.3 遗留代码,大约 700 个类。 由于此代码中缺少泛型,我目前看到数千个警告,我应该禁用其中哪些警告?我不想讨论每一个警告,只是根据错误/警告对话框中显示的组的经验法则。
I am refactoring java 1.3 legacy code, around 700 classes.
Due to the lack of generics in this code I see currently thousands of warnings, which of them should I simply disable? I don't wan't to discuss of every single warning, just a rule of thumb in terms of groups displayed in eclipses the errors/warnings dialog.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
忽略您不关心的警告...:)
我只会接受第一个警告...如果您不理解它,请研究它。一旦你理解了它,就决定是否忽略它。
重复直到完成:)
Ignore the warnings you don't care about... :)
I'd just take the first warning... if you don't understand it, research it. Once you understand it decide whether or not to ignore it.
Repeat until done :)
首先抑制“未经检查/原始”警告。这应该可以解决与泛型相关的大部分问题
Start with suppressing "unchecked/raw" warnings. That should clear up most of the issues related to generics
“你正在重构代码,对吧?如果你这样做......你应该重构所有代码以使用通用,直到你没有收到任何警告。你不这样做,你的重构还没有完成!
如果您确实需要警告,请抑制该警告,但要谨慎行事。
`You're refactoring the code, right? If you do that.. you should refactor all code to use generic until you don't get any warning. You don't do that, your refactoring is not finished!
Supress the warning if you really need it, but do it very sparingly.