Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Checker framework, enable format string and interning checkers #1239

Draft
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

AutonomicPerfectionist
Copy link
Contributor

@AutonomicPerfectionist AutonomicPerfectionist commented Jan 6, 2023

This PR adds the Checker framework, a compile-time annotation-based static analyzer. Checker is built from a large assortment of discrete pluggable checkers, including some for nullability and units. This PR only enables the format string checker and the interning checker for now. For the checkers to succeed, a substantial number of annotations needed to be added across the codebase. As a result, there is a lot of noise in the changed files; the most important changes exist in the pom.xml.template and RuntimeMeta.java files. Service.java also had a bit of code cleanup due to an abnormally high number of warnings in one of the most critical classes. There were also numerous bug fixes across the codebase as the checkers successfully located incorrect equality comparisons and format strings. One or two locations also used reference equality checks as an optimization strategy; errors concerning these were suppressed.

Finally, due to how Swing action listeners are implemented, there were many false positives in old GUI code. These have simply been ignored with @SuppressWarnings("not.interned") pending the removal of such code.

Notes

Checker adds substantial time to the first-time compilation phase, Maven will perform incremental building thereafter and the time used by checker will therefore be usually unnoticeable, but on my Ryzen 5 5600g system the first-time build now takes around 2.5 minutes. This will likely increase further as we add more checkers.

@supertick supertick marked this pull request as draft July 2, 2023 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant