fix compiler warnings

* nullness
* unnecessary else
* wrong javadoc