調べたことをメモしていきます。
FindBugsのバージョン
- 最新は3.0.1(2015年)で、Java8に対応している
- SpotBugsは開発が止まったFindBugsの後継ツール
https://www.slideshare.net/WorksApplications/spotbugsfindbugs-erp
http://blog.kengo-toda.jp/entry/2016/11/14/235642
FindBugsで見つけたバグ
Integer の参照比較は疑わしいです。
Integer a = 1000;
Integer b = 1000;
boolean rtn = a == b; //equalsメソッドを使うべき
- 比較している値が127以下だったので、不具合にはならなかった。。。
条件テストを繰り返しています
if (a != null && a != null) {
boolean c = true;
}
非直列化可能オブジェクト ~ に格納しています。
- HttpSessionにはシリアライズ可能なオブジェクトを格納する必要がある。
http://www.ne.jp/asahi/hishidama/home/tech/java/j2ee/session.html
http://konnichiwa-dou.cocolog-nifty.com/blog/2006/06/objectserializa_dd5d.html