News for hackers. Stuff that matters.

Ask HN: Tooling for Improving Java Codebase

What are some of your favourite projects that you rely on to improve the quality of your codebases? I'm thinking along the lines of Lombok and equalsverifier. And, ostensibly, linters such as checking that utility classes don't contain any non-static methods etcetera. I'm not thinking Sonar, but if anyone wants to share any resources on how to make Sonar a better tool (signal/noise) please share.
( 3 comments | 4 points | on HN )
Re:Ask HN: Tooling for Improving Java Codebase by kevinherron on Wednesday March 27, 2019 @08:13AM (#19500073)
Checkstyle is a must for any project with more than 1 developer (or even with 1).

Findbugs/spotbugs maven/gradle plugins are nice, but require a little bit of tuning to eliminate false positives. Nothing near the amount of tuning or upkeep a Sonar instance requires though.

Use @Nullable, @Nonnull, @ParametersAreNonNullByDefault annotations. I prefer "non-null by default" via a package-level annotation from @ParametersAreNonNullByDefault and using @Nullable where appropriate.

Use the Error Prone compiler/build plugin.

Re:Ask HN: Tooling for Improving Java Codebase by k0t0n0 on Wednesday March 27, 2019 @01:15PM (#19503150)
Shift+Delete
Re:Ask HN: Tooling for Improving Java Codebase by phakding on Wednesday March 27, 2019 @05:13PM (#19506093)
wow! aren't you edgy?