Describe the bug
The digit16 method in file throws a generic IllegalArgumentException when encountering an invalid hexadecimal digit during baggage header decoding. This should be replaced with NumberFormatException, which is more semantically correct for parsing failures.
Steps to reproduce
Replacing the IllegalArgumentException to NumberFormatException.
What did you expect to see?
• Exception type: NumberFormatException
• Error message: Clear indication of the invalid character with byte representation
• JavaDoc: @throws clause documenting the exception
What did you see instead?
Exception type: IllegalArgumentException (generic, not semantically correct for parsing)
JavaDoc: also add @throws documentation
What version and what artifacts are you using?
Artifacts: opentelemetry-api
Version: Latest main branch
How did you reference these artifacts? (excerpt from your build.gradle, pom.xml, etc)
This is part of the core OpenTelemetry Java API for W3C Baggage propagation
Environment
Compiler: Oracle JDK 25.0.1 LTS (64-bit)
OS: Windows 11
Runtime (if different from JDK above): Oracle Java SE Runtime Environment (build 25.0.1+8-LTS-27)
OS (if different from OS compiled on): NA
Additional context
• This addresses a FIXME comment in the original code
• All existing tests pass with this change
• No behavioral changes, only exception type refinement
• Improves code quality
I'm happy to be assigned this issue and work on fixing it!
Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
Describe the bug
The digit16 method in file throws a generic IllegalArgumentException when encountering an invalid hexadecimal digit during baggage header decoding. This should be replaced with NumberFormatException, which is more semantically correct for parsing failures.
Steps to reproduce
Replacing the IllegalArgumentException to NumberFormatException.
What did you expect to see?
• Exception type: NumberFormatException
• Error message: Clear indication of the invalid character with byte representation
• JavaDoc: @throws clause documenting the exception
What did you see instead?
Exception type: IllegalArgumentException (generic, not semantically correct for parsing)
JavaDoc: also add @throws documentation
What version and what artifacts are you using?
Artifacts: opentelemetry-api
Version: Latest main branch
How did you reference these artifacts? (excerpt from your
build.gradle,pom.xml, etc)This is part of the core OpenTelemetry Java API for W3C Baggage propagation
Environment
Compiler: Oracle JDK 25.0.1 LTS (64-bit)
OS: Windows 11
Runtime (if different from JDK above): Oracle Java SE Runtime Environment (build 25.0.1+8-LTS-27)
OS (if different from OS compiled on): NA
Additional context
• This addresses a FIXME comment in the original code
• All existing tests pass with this change
• No behavioral changes, only exception type refinement
• Improves code quality
I'm happy to be assigned this issue and work on fixing it!
Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding
+1orme too, to help us triage it. Learn more here.