`UnnecessarilyFullyQualified` is inconsistent between `module-info.java` and `package-info.java`

Author: anthonyvdotbeCreated Aug 21, 2026Updated Aug 21, 2026

UnnecessarilyFullyQualified occurs for module-info.java:

java
@org.jspecify.annotations.NullMarked
module foo {}

but not for package-info.java:

java
@org.jspecify.annotations.NullMarked
package bar;

This inconsistency is troublesome. I'd much prefer to have the check apply to all files, changing the behavior for package-info.java files. However, package-info.java files were explicitly excluded from the check in https://github.com/google/error-prone/issues/1652. Ideally there would be a flag to indicate whether to exclude package-info.java and module-info.java files from the check.