FindBugs 使用 及 常见错误解决方法
2016-04-15 17:04
459 查看
目录
FindBugs 使用 及 错误解决方法
idea 安装findbugs我这里已经安装过了
使用findbugs检查代码
常见错误
This private method is never called. Although it is possible that the method will be invoked through reflection, it is more likely that the method is never used, and should be removed.(私人方法永远不会被调用这种私人方法永远不会被调用。虽然这是可能的,通过反射的方法将被调用,它是更可能的方法是从未使用过,并且应该被删除。)
2、Comparison of String parameter using == or !=
This code compares a java.lang.String parameter for reference equality using the == or != operators. Requiring callers to pass only String constants or interned strings to a method is unnecessarily fragile, and rarely leads to measurable performance gains. Consider using the equals(Object) method instead.(使用=或字符串参数的比较!=这个代码比较java.lang.string参数使用= =或引用相等!=运算符。要求调用方通过只有字符串常量或拘留一种字符串是不必要的脆弱,很少获得显著的性能提升。考虑使用等于(对象)方法。)
FindBugs 使用 及 错误解决方法
idea 安装findbugs我这里已经安装过了
使用findbugs检查代码
常见错误
FindBugs 使用 及 错误解决方法
idea 安装findbugs,我这里已经安装过了
使用findbugs检查代码
常见错误
1、Private method is never calledThis private method is never called. Although it is possible that the method will be invoked through reflection, it is more likely that the method is never used, and should be removed.(私人方法永远不会被调用这种私人方法永远不会被调用。虽然这是可能的,通过反射的方法将被调用,它是更可能的方法是从未使用过,并且应该被删除。)
2、Comparison of String parameter using == or !=
This code compares a java.lang.String parameter for reference equality using the == or != operators. Requiring callers to pass only String constants or interned strings to a method is unnecessarily fragile, and rarely leads to measurable performance gains. Consider using the equals(Object) method instead.(使用=或字符串参数的比较!=这个代码比较java.lang.string参数使用= =或引用相等!=运算符。要求调用方通过只有字符串常量或拘留一种字符串是不必要的脆弱,很少获得显著的性能提升。考虑使用等于(对象)方法。)
相关文章推荐
- [转]ExtJs入门之filefield:文件上传的配置+结合Ajax完美实现文件上传的asp.net示例
- 设计模式——装饰者模式
- PHP mongodb AR
- Linux下 RabbitMQ的安装与配置
- Linux下删除非空文件夹代码
- 常用简单SQL语句
- QT中的插件
- javascript除call函数外实现继承的方式之一
- Array.isArray 函数 (JavaScript)以及其IE兼容性解决方案
- 多进程并发编程----进程间传递文件描述符基础~发送接收附属数据结构体介绍
- java截取字符串
- Unity AssetBundle 爬坑!!!!!!!
- windows编程
- 拆半插入
- Android 基本控件
- [SPM_LAB]持续集成实验
- [转] 10多年码代码经验腾讯管理谈职业规划
- IOS开发中UITableView(表视图)的滚动优化及自定义Cell
- 键盘事件之keydown keypress keyup区别
- ubuntu 查看本机网卡信息