Noel,
This is not related to the NPE problem, that was caused by a
originalMail.getSender().toInternetAddress();
done without checking for a null sender.
I wrote as an enhancement the code snippet shown by you is because later on the call
setTo(newMail, getTo(originalMail), originalMail);
would behave differently if getTo(originalMail) returned null: in this case the TO:
value would be the original one (unchanged); with an empty array it would, as you
said, be converted to null at the end.
Unless I'm missing something ... that may be, as we are here talking about null
senders becoming apparent recipients etc, it's a loop in the brain :-)
Vincenzo
> -----Original Message-----
> From: Noel J. Bergman [mailto:[EMAIL PROTECTED]
> Sent: venerd� 20 giugno 2003 2.23
> To: James-Dev Mailing List
> Subject: zero length array in AbstractRedirect
>
>
> Vincenzo,
>
> Did you mean to do this?
>
> if (mailAddress == null) {
> // set to <>
> apparentlyTo = new InternetAddress[0];
> }
>
> I suspect that you did, but please add a comment explaining why in more
> detail. Which code was throwing the NPE if you used null instead? From
> what I can see, JavaMail should accept null as a parameter to
> MimeMessage.setRecipients(), and internally converts a zero
> length array to
> null.
>
> --- Noel
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]