Skip to content

Reject fully qualified names and wildcard imports - #2338

Merged
hyperxpro merged 1 commit into
mainfrom
checkstyle
Sep 20, 2026
Merged

hyperxpro merged 1 commit into
mainfrom
checkstyle

Conversation

@hyperxpro

Copy link
Copy Markdown
Member

Motivation:

Nothing enforced import hygiene, so fully qualified class names and wildcard imports had accumulated across main and test sources. JDK 11 also caps Error Prone at 2.31.0, and newer JDKs were silently inheriting that cap.

Modification:

Turn on Error Prone's UnnecessarilyFullyQualified and WildcardImport as errors. Test sources compile with only those two checks, keeping NullAway off there. Replace the fully qualified names already in the tree with imports and expand the wildcard imports.

Raise Error Prone to 2.42.0 on JDK 17 and 2.50.0 on JDK 21+, ignore both it and NullAway in Dependabot since a minor bump drops JDK 11, and add a JDK 21 static analysis step to compile-and-check.

Result:

Fully qualified class names and wildcard imports fail the build on every JDK, and CI runs a maintained Error Prone on newer JDKs.

@hyperxpro
hyperxpro merged commit 59d9a53 into main Sep 20, 2026
17 of 19 checks passed
@hyperxpro
hyperxpro deleted the checkstyle branch September 20, 2026 19:07
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.

1 participant