LoginSignup
0
1

More than 5 years have passed since last update.

FindBugs(SpotBugs)の自分用メモ

Posted at

調べたことをメモしていきます。

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

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1