Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rlacksgus97
Copy link

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
Copy link

linux-foundation-easycla bot commented Apr 2, 2025

CLA Signed


The committers listed above are authorized under a signed CLA.

Copy link

codecov bot commented Apr 2, 2025

Codecov Report

Attention: Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.

Project coverage is 89.94%. Comparing base (e34049b) to head (a446cb0).

Files with missing lines Patch % Lines
...elemetry/api/baggage/propagation/BaggageCodec.java 71.42% 1 Missing and 1 partial ⚠️

❌ Your patch check has failed because the patch coverage (71.42%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7239      +/-   ##
============================================
- Coverage     89.95%   89.94%   -0.01%     
- Complexity     6685     6686       +1     
============================================
  Files           751      751              
  Lines         20191    20193       +2     
  Branches       1978     1980       +2     
============================================
  Hits          18162    18162              
- Misses         1436     1437       +1     
- Partials        593      594       +1     

☔ 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() {
Copy link
Contributor

@breedx-splk breedx-splk Apr 2, 2025

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. 👍🏻

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

@Test
void shouldThrowIfMalformedData() {
assertThatThrownBy(() -> BaggageCodec.decode("%1", StandardCharsets.UTF_8))
.isInstanceOf(IllegalArgumentException.class);
assertThatNoException().isThrownBy(() -> BaggageCodec.decode("%1", StandardCharsets.UTF_8));
Copy link
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!

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.

2 participants