Skip to content

Fix exception messages that always printed null - #1373

Merged
pjfanning merged 2 commits into
apache:trunkfrom
pjfanning:null-error-messages
Oct 11, 2026
Merged

pjfanning merged 2 commits into
apache:trunkfrom
pjfanning:null-error-messages

Conversation

@pjfanning

Copy link
Copy Markdown
Member

SpotBugs flags these messages: each one is built inside a null check and prints the value that was just found to be null (NP_LOAD_OF_KNOWN_NULL_VALUE). This PR only changes message text; no exception types or code paths change.

Where Before After
AgileEncryptionHeader Invalid hash size: null Missing hash size in the key data
FormulaParser.parseStructuredReference (one column) Cannot parse column: null with formula … Cannot parse column: missing column name in formula …
XDGF Ellipse Invalid cell 'null' in Ellipse row Cell without a name in Ellipse row
PackageRelationshipCollection.getRelationshipByID … provided ID is empty: null, having relationships: … … no ID provided, having relationships: …
HWMF WmfDibCreatePatternBrush Could not read color-usage null Could not read color-usage <value read>

The HWMF message printed the enum lookup that had failed; it now prints the raw value read from the file, which is what's useful when investigating.

No tests assert on these messages.

🤖 Generated with Claude Code

pjfanning and others added 2 commits October 11, 2026 12:17
Each message was built inside a null check and printed the null value
itself (SpotBugs NP_LOAD_OF_KNOWN_NULL_VALUE), or in HwmfMisc the value
that failed to resolve instead of the raw value read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pjfanning
pjfanning merged commit 3ebc5e5 into apache:trunk Oct 11, 2026
4 checks passed
@pjfanning
pjfanning deleted the null-error-messages branch October 11, 2026 12:18
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