public Address[] getAllRecipients() throws MessagingException {
if (headers == null) {
loadHeaders();
}
Address toAddresses[] = getRecipients(RecipientType.TO);
Address ccAddresses[] = getRecipients(RecipientType.CC);
Address bccAddresses[] = getRecipients(RecipientType.BCC);
Address newsAddresses[] = getRecipients(RecipientType.NEWSGROUPS);
if(ccAddresses == null && bccAddresses == null && newsAddresses == null) {
return toAddresses;
}
int i = (toAddresses == null ? 0 : toAddresses.length)
+ (ccAddresses == null ? 0 : ccAddresses.length)
+ (bccAddresses == null ? 0 : bccAddresses.length)
+ (newsAddresses == null ? 0 : newsAddresses.length);
Address allAddresses[] = new Address[i];
int j = 0;
if (toAddresses != null) {
System.arraycopy(toAddresses, 0, allAddresses, j, toAddresses.length);
j += toAddresses.length;
}