Added javadoc and fixed static analysis tools issues. [3]