Merge pull request #515 from n-shiota/refactor

Removed warnings reported by FindBugs.