Skip to content

Fix MIMEParse null-guard to eliminate huge number of NPE traps/sec#1159

Merged
jcleezer merged 1 commit intolinkedin:masterfrom
sashagavrilov:sashagavrilov/fix-mimeparse-npe-traps
Apr 7, 2026
Merged

Fix MIMEParse null-guard to eliminate huge number of NPE traps/sec#1159
jcleezer merged 1 commit intolinkedin:masterfrom
sashagavrilov:sashagavrilov/fix-mimeparse-npe-traps

Conversation

@sashagavrilov
Copy link
Copy Markdown
Contributor

NumberUtils.toFloat(null, default) internally calls Float.parseFloat(null) which throws NullPointerException before returning the default value. This fires fillInStackTrace on every request for each media type without a "q" parameter (the common case). Add null checks to short-circuit the call and return the default directly, preserving identical behavior without the exception overhead.

NumberUtils.toFloat(null, default) internally calls Float.parseFloat(null)
which throws NullPointerException before returning the default value.
This fires fillInStackTrace on every request for each media type without
a "q" parameter (the common case). Add null checks to short-circuit
the call and return the default directly, preserving identical behavior
without the exception overhead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jcleezer jcleezer merged commit 1d26a18 into linkedin:master Apr 7, 2026
2 checks passed
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.

4 participants