`
Teok
  • 浏览: 147692 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

About unread field or unused method

UP 
阅读更多
这几天被要求该用findbug找出来的问题,其实全部都是warnings,各种warning,用过findbug的童鞋应该知道的。

关于unused field或者unused method、import,编译器会在编译class的时候把它们优化掉,是加上它们不会对实际的程序产生什么影响。所以该不该都无所谓了。自己没法定论,然后去搜答案,果然有一篇不错的帖子说明了这个问题:Any reason to clean up unused imports in Java, other than reducing clutter?

引用

As always unused code will distract you and other people while reading the code and leaving something in your active code because of maybe I need it later is mostly seen as bad practice.


红字的部分化解了我的忧虑,其实往往觉得以后会用到,结果经常是不会再用到,等到用到时早已经有另外的办法了。
分享到:
评论

相关推荐

    Ruby-Unread管理ActiveRecord对象的已读未读状态

    Unread - 管理ActiveRecord对象的已读/未读状态

    spark 核心架包

    解决java.lang.IllegalStateException: unread block data的架包

    book.unread

    book.unread

    MAILPLANE 3.8.2 FOR MAC

    Mailplane’s notifier tells you everything about unread messages. It integrates with OS X notification center and the ‘Do Not Disturb’ mode allows you to stay focused. Mailplane talks to apps like ...

    This Application checks for unread email using outlook. MS A

    This Application checks for unread email using outlook. MS Agent will popup to announce how many unread mails you got. This also checks sub-folders on your inbox. Configuration is added to choose ...

    findbug 常见异常处理

    Unread field 描述:某个对象的属性不会被读取 处理方式:确认此局部变量是否会被使用,如果确实不会被用到,请去掉,和 Dead store to local variable一样处理,只是这里针对的是不是局部变量; Call to static ...

    Messenger Unread-crx插件

    语言:English 检查信使,确保没有压力。 请勿发送打字指示或阅读收据。 免费和开源,只有30行代码。 检查信使,确保没有压力。 请勿发送打字指示或阅读收据。...:shushing_face:不要向别人显示您已经阅读过他们的消息或...

    unread_issues:Redmine 未读问题

    未读问题 Redmine 插件 该插件实现了监控问题变化的便捷功能。 在问题列表中会出现彩色指示器,显示问题的当前状态。... git clone https://github.com/tdvsdv/unread_issues.git 如果你想支持计数器的ajax

    unread-decorator:Python 模块允许 unread() 从任何流中 read() 的数据

    1 add_unread 的用法 from unread_decorator import add_unreadf = add_unread ( open ( filename , mode , buffering ))# assume f contains "one\ntwo\nthree"f = add_unread ( f ) # decoratedata = f ....

    tmux-telegram-unread

    set -g status-right "#[fg=colour39]Tg: #{telegram_unread} #[fg=yellow] | %a %d-%h-%y %H:%M " 依赖 取决于 更新时间取决于状态间隔选项 使用安装(推荐) 将插件添加到.tmux.conf中的 TPM 插件列表: set -...

    UnreadFiles

    http://zgynhqf.cnblogs.com/ 一个 WP7 系统上的稍后读软件源码。

    Android代码-dashclock

    DashClock Widget and API Install on Google Play | Read the API Docs About DashClock ...Unread Gmail inbox or priority inbox conversations Your next scheduled alarm Extensibility DashClo

    HN Unread Comments-crx插件

    语言:English (UK) ...此扩展名将跟踪您在Hacker News上阅读的评论,然后向您显示哪些是新的(可在“主题”页面和单个项目中使用)。...源代码可在GitHub上免费获得:http://github.com/janhancic/hn-unread-comments

    phpbb-3.1-ext-editedposts_unread:如果已编辑,此扩展将主题的最后一篇文章和第一篇文章标记为未读

    phpbb-3.1-ext-editedposts_unread 如果已编辑,此扩展将主题的最后一篇文章和第一篇文章标记为未读。安装1. 克隆将存储库克隆(或下载并移动)到文件夹 /ext/phpbbmodders/editedposts_unread 中: cd phpBB3git ...

    tmux-telegram-daemon-unread:tmux 的电报未读对话框计数小部件(netcat 版本)

    set -g status-right "#[fg=colour39]Tg: #{telegram_unread} #[fg=yellow] | %a %d-%h-%y %H:%M " 配置 您可以配置插件消息格式,指定telegram-cli 实例的端口和netcat 超时。 在.tmux.conf设置

    GMail Unread-crx插件

    语言:English (United States) 显示“未读”按钮以按“未读”状态过滤电子邮件。

    Unread Cats-crx插件

    语言:English 用猫视频链接您的未读电子邮件。 未读猫是马学院创建的名为“隐藏通讯”的项目的一部分。 此chrome扩展程序会根据您收到的未读电子邮件的数量,用猫视频填充您的gmail。 未读猫旨在鼓励用户不要阅读其...

    Herc Unread-crx插件

    语言:English 获取窗口标题中的未读消息计数,如它们在Gmail上有于Gmail google收件箱未读电子邮件计数 想念在浏览器窗口的标题区域中看到未读电子邮件计数? 这个延伸带回了! 此扩展将Gmail与收件箱中的未读电子...

    Clearly Unread-crx插件

    语言:English (UK) get vigher,更清晰的未读gmail徽章在您的选项卡中 显然未读是非常,非常基本的。 它替换了Gmail的未读数选项卡图标(Favicon),具有大,清晰,高分辨率(视网膜准备),颜色协调号码。...

Global site tag (gtag.js) - Google Analytics