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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to