fix code issues reported by PMD
add javadoc and fix checkstyle errors in DI