Visitar URL original
fix: add guard against the ArrayIndexOutOfBoundsException in BaggageCodec… by rlacksgus97 · Pull Request #7239 · open-telemetry/opentelemetry-java · GitHub
Skip to content

fix: add guard against the ArrayIndexOutOfBoundsException in BaggageCodec… - #7239

Merged
jkwatson merged 4 commits into
open-telemetry:mainfrom
rlacksgus97:main
Aug 26, 2025
Merged

jkwatson merged 4 commits into
open-telemetry:mainfrom
rlacksgus97:main

Conversation

@rlacksgus97

Copy link
Copy Markdown
Contributor

added guard against the ArrayIndexOutOfBoundsException in BaggageCodec class

@rlacksgus97
rlacksgus97 requested a review from a team as a code owner April 2, 2025 16:25
@linux-foundation-easycla

linux-foundation-easycla Bot commented Apr 2, 2025 •

Copy link
Copy Markdown

CLA Signed

The committers listed above are authorized under a signed CLA.

@codecov

codecov Bot commented Apr 2, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.03%. Comparing base (5c4a0ad) to head (f9ef4ed).
⚠️ Report is 207 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7239      +/-   ##
============================================
- Coverage     90.04%   90.03%   -0.01%     
- Complexity     6907     6909       +2     
============================================
  Files           787      787              
  Lines         20853    20855       +2     
  Branches       2023     2025       +2     
============================================
  Hits          18777    18777              
- Misses         1439     1441       +2     
  Partials        637      637              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@@ -36,7 +36,6 @@ void shouldDecodePercentEncodedValues(String percentEncoded, String expectedDeco

@Test
void shouldThrowIfMalformedData() {

@breedx-splk breedx-splk Apr 2, 2025 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's rename this because the behavior has changed. 👍🏻

void shouldThrowIfMalformedData() {
assertThatThrownBy(() -> BaggageCodec.decode("%1", StandardCharsets.UTF_8))
.isInstanceOf(IllegalArgumentException.class);
assertThatNoException().isThrownBy(() -> BaggageCodec.decode("%1", StandardCharsets.UTF_8));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also add a few chars and make sure that they come through in the output? In other words, lets assert on the result in addition to no exception being thrown. Thanks!

@breedx-splk breedx-splk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

@jkwatson
jkwatson merged commit f459f80 into open-telemetry:main Aug 26, 2025
the-clam pushed a commit to the-clam/opentelemetry-java that referenced this pull request Nov 6, 2025
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.

3 participants