You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "orpiske (via GitHub)" <gi...@apache.org> on 2026/03/30 12:43:11 UTC
[PR] camel-mail: fix incorrect guard in MailConverters multipart loop [camel]
orpiske opened a new pull request, #22340:
URL: https://github.com/apache/camel/pull/22340
## Summary
- Fix incorrect guard in `MailConverters.toString(Multipart)` inner `while` loop: the original code checked `multipart.getCount() < 1` (the outer method parameter) instead of the inner `MimeMultipart` obtained from `content`, making the guard dead code
- The inner multipart's count is now correctly checked, preventing a potential call to `getBodyPart(0)` on an empty multipart
- Also applies `instanceof` pattern matching (Java 16+) to both `MimeMultipart` checks in the file
Spotted during review of #22303 ([comment](https://github.com/apache/camel/pull/22303#discussion_r3005058293)).
## Test plan
- [x] `mvn -DskipTests install` compiles successfully
- [ ] Existing camel-mail tests pass (one pre-existing test failure unrelated to this change: `SpringMailSplitAttachmentsTest` fails due to missing `ServiceCallConfigurationDefinition` class)
🤖 _Claude Code on behalf of Otavio R. Piske_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] camel-mail: fix incorrect guard in MailConverters multipart loop [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #22340:
URL: https://github.com/apache/camel/pull/22340#issuecomment-4154765889
:star2: Thank you for your contribution to the Apache Camel project! :star2:
:robot: CI automation will test this PR automatically.
:camel: Apache Camel Committers, please review the following items:
* First-time contributors **require MANUAL approval** for the GitHub Actions to run
* You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
* You can label PRs using `build-all`, `build-dependents`, `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
* Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
:warning: Be careful when sharing logs. Review their contents before sharing them publicly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] camel-mail: fix incorrect guard in MailConverters multipart loop [camel]
Posted by "apupier (via GitHub)" <gi...@apache.org>.
apupier commented on PR #22340:
URL: https://github.com/apache/camel/pull/22340#issuecomment-4154817319
/component-test mail
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] camel-mail: fix incorrect guard in MailConverters multipart loop [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #22340:
URL: https://github.com/apache/camel/pull/22340#issuecomment-4154850560
:white_check_mark: `/component-test mail` tests passed successfully.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] camel-mail: fix incorrect guard in MailConverters multipart loop [camel]
Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske merged PR #22340:
URL: https://github.com/apache/camel/pull/22340
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org