Commit ffbce6a
camel-mail: fix incorrect guard in MailConverters multipart loop
The inner while loop in toString(Multipart) was checking
multipart.getCount() (the outer method parameter) instead of the
inner MimeMultipart obtained from content. This made the guard
dead code since the outer count is always >= 1 when reached.
Fix the guard to check the inner MimeMultipart's count and apply
instanceof pattern matching to eliminate the separate cast.
Claude Code on behalf of Otavio R. Piske
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent dba5a0f commit ffbce6a
File tree
1 file changed
+4
-5
lines changed- components/camel-mail/src/main/java/org/apache/camel/component/mail
1 file changed
+4
-5
lines changedLines changed: 4 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
| 64 | + | |
66 | 65 | | |
67 | 66 | | |
68 | 67 | | |
| |||
85 | 84 | | |
86 | 85 | | |
87 | 86 | | |
88 | | - | |
89 | | - | |
| 87 | + | |
| 88 | + | |
90 | 89 | | |
91 | 90 | | |
92 | | - | |
| 91 | + | |
93 | 92 | | |
94 | 93 | | |
95 | 94 | | |
| |||
0 commit comments