删除Java中的冗余转换 [英] Remove redundant casts in Java

查看:547
本文介绍了删除Java中的冗余转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经 使用了一些使用了很多转换的Java代码,现在大多数是多余的和不必要的。

I've been generifying some Java code that used lots of casts, and now most of them are redundant and unnecessary.

可以非常繁琐地检查代码的所有用法以删除它们,因此:是否有任何工具来帮助识别(和删除)多余的铸造?

It could be very tedious to inspect all the usages of the code to remove them, so: are there any tools to help to identify (and remove) superfluous casts?

推荐答案

这可以使用Eclipse Helios自动完成。在您的项目中,转到属性 - > Java代码样式 - >清理。在此处,编辑个人资料,转到不必要的代码标签,然后选中删除不必要的投票。然后右键单击源根目录,并点击Source-> Clean up。工作完成。

This can be automatically done using Eclipse Helios. In your project, go to Properties -> Java code Style -> Clean Up. There, edit a profile, go to the "Unnecessary Code" Tab and check "Remove unnecessary casts". Then right-click your source root and klick Source-> Clean up. Job done.

这篇关于删除Java中的冗余转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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