You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mime4j-dev@james.apache.org by "Stefano Bagnara (JIRA)" <mi...@james.apache.org> on 2011/08/12 12:40:27 UTC
[jira] [Updated] (MIME4J-202) mimeMessage.getTo() throws
IllegarArgumentException unexpectedly
[ https://issues.apache.org/jira/browse/MIME4J-202?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stefano Bagnara updated MIME4J-202:
-----------------------------------
Fix Version/s: 0.7.1
> mimeMessage.getTo() throws IllegarArgumentException unexpectedly
> ----------------------------------------------------------------
>
> Key: MIME4J-202
> URL: https://issues.apache.org/jira/browse/MIME4J-202
> Project: JAMES Mime4j
> Issue Type: Bug
> Components: dom
> Affects Versions: 0.7
> Environment: Java 6
> Reporter: Rustam Aliyev
> Priority: Minor
> Fix For: 0.7.1
>
>
> After upgrading to 0.7 I'm getting following problem:
> The message I'm trying to parse contain following to field:
> {code}
> To: "BiZ" <>
> {code}
> Using DOM parser I call mimeMessage.getTo() where mimeMessage is parsed mimeMessage object and getting following:
> {code}
> java.lang.IllegalArgumentException: null
> at org.apache.james.mime4j.dom.address.Mailbox.<init>(Mailbox.java:59) ~[na:na]
> at org.apache.james.mime4j.field.address.LenientAddressBuilder.parseMailboxAddress(LenientAddressBuilder.java:139) ~[na:na]
> at org.apache.james.mime4j.field.address.LenientAddressBuilder.parseAddress(LenientAddressBuilder.java:264) ~[na:na]
> at org.apache.james.mime4j.field.address.LenientAddressBuilder.parseAddressList(LenientAddressBuilder.java:303) ~[na:na]
> at org.apache.james.mime4j.field.AddressListFieldLenientImpl.parse(AddressListFieldLenientImpl.java:71) ~[na:na]
> at org.apache.james.mime4j.field.AddressListFieldLenientImpl.getAddressList(AddressListFieldLenientImpl.java:51) ~[na:na]
> at org.apache.james.mime4j.message.AbstractMessage.getAddressList(AbstractMessage.java:470) ~[na:na]
> at org.apache.james.mime4j.message.AbstractMessage.getTo(AbstractMessage.java:239) ~[na:na]
> ...
> {code}
> According to getTo() description it should return AddressList or null in case if To not present. The case above is a bit tricky. But I would prefer to get back whatever possible, i.e. AddressList with only name field. In any case, it should not throw IAE.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira