Implement and conform to checkstyle; see etc/checkstyle.xml

NOTE: although code changed, there should be NO SEMANTIC CHANGES here