Skip to content

Add OnlyNullMarked option and support RequireExplicitNullMarking checker#77

Open
hczedik wants to merge 6 commits intoerroraway:masterfrom
hczedik:nullaway-onlynullmarked
Open

Add OnlyNullMarked option and support RequireExplicitNullMarking checker#77
hczedik wants to merge 6 commits intoerroraway:masterfrom
hczedik:nullaway-onlynullmarked

Conversation

@hczedik
Copy link
Copy Markdown

@hczedik hczedik commented Apr 29, 2026

Upgrade to NullAway version 0.12.15 which supports RequireExplicitNullMarking checker.

Add a boolean OnlyNullMarked configuration option so NullAway only
checks code within @NullMarked scope. When enabled, package-scope
options (AnnotatedPackages, UnannotatedSubPackages) are skipped.

Support dual-key property reading: server-side key (e.g.
nullaway.only.null.marked) and sonar.-prefixed analysis parameter key
(sonar.nullaway.only.null.marked), since the scanner only forwards
sonar.
properties from build tools.

Enable the RequireExplicitNullMarking checker (SUGGESTION severity) to
produce diagnostics by overriding it to WARN level, which avoids a
classloader issue with ErrorProne's auto-fix patch generation.

hczedik added 6 commits April 29, 2026 22:05
 Version 1.21.0.505 silently ignores the <requiredForLanguages>
 configuration, resulting in a missing Plugin-RequiredForLanguages
 manifest entry. This caused the scanner to skip downloading the
 plugin when not all plugins are fetched (the default behavior).
 The previous findRepository implementation used a switch statement that
 only matched "NullAway" literally, plus heuristics for Slf4j (prefix)
 and Picnic (URL in message). Any other plugin checker fell through to
 the default "errorprone" repository, causing its issues to be silently
 dropped.

 This broke the RequireExplicitNullMarking checker (added in NullAway
 0.12.15) which belongs to the "nullaway" repository but was mapped to
 "errorprone", so its issues were never saved.

 Replace with a static lookup map built from ServiceLoader-registered
 plugin checkers, which correctly maps all checkers to their repository.
 createIssuesForRuleRepository() has replacement semantics, so calling it
 in a loop left only the last repository registered, preventing the sensor
 from executing for most rule repositories.
Add a boolean OnlyNullMarked configuration option so NullAway only
checks code within @NullMarked scope. When enabled, package-scope
options (AnnotatedPackages, UnannotatedSubPackages) are skipped.

Support dual-key property reading: server-side key (e.g.
nullaway.only.null.marked) and sonar.*-prefixed analysis parameter key
(sonar.nullaway.only.null.marked), since the scanner only forwards
sonar.* properties from build tools.

Enable the RequireExplicitNullMarking checker (SUGGESTION severity) to
produce diagnostics by overriding it to WARN level, which avoids a
classloader issue with ErrorProne's auto-fix patch generation.
 - Corrected JDK requirement (17+, not 11+)
 - Added SonarQube 26.x to compatibility
 - New Configuration section explaining both server-side and build-tool keys (with sonar. prefix)
 - Full table of all NullAway options including the new only.null.marked
 - Full table of all ErrorAway options
 - Concise error message example
 - Fixed the "SonarQybe" typo
@hczedik
Copy link
Copy Markdown
Author

hczedik commented Apr 30, 2026

Hi @gtoison,

thank you for your work on this plugin!

I hope you are open to contributions like this!

Hermann (from Austria)

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