camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] Updated: (CAMEL-3713) Duplicate mail attachment names breaks the Message.getAttachments() interface contract
Date Thu, 24 Feb 2011 05:08:38 GMT

     [ https://issues.apache.org/jira/browse/CAMEL-3713?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Claus Ibsen updated CAMEL-3713:
-------------------------------

    Priority: Major  (was: Critical)

> Duplicate mail attachment names breaks the Message.getAttachments() interface contract
> --------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3713
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3713
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-mail
>    Affects Versions: 2.6.0
>         Environment: Mac OSX 10.6.6
> java version "1.6.0_22"
> Java(TM) SE Runtime Environment (build 1.6.0_22-b04-307-10M3261)
> Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03-307, mixed mode)
>            Reporter: Paul Mietz Egli
>            Assignee: Hadrian Zbarcea
>             Fix For: 2.7.0
>
>         Attachments: camel-3713.diff
>
>
> If the camel-mail component consumes a Multipart email message that contains two parts
with the same filename, subsequent calls to {{DataHandler dh = Message.getAttachments().get("filename")}}
result in a ClassCastException.  This occurs because {{MailBinding.extractAttachmentsFromMultipart()}}
calls {{CollectionHelper.appendValue(map, fileName, part.getDataHandler())}} to add an attachment
to the Message attachments map.  If appendValue is passed a duplicate key, it converts the
map value to an ArrayList and adds the existing value and the new value to the list.  The
result is a Map that contains a mix of <String,DataSource> and <String,ArrayList>.
> Fix is to NOT use CollectionHelper and to check for duplicate keys prior to adding an
attachment.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message