String sAllowPattern, sDenyPattern;
ArrayList<String> oRecipientsWithoutDuplicates;
boolean bAllowed;
Pattern oAllowPattern=null, oDenyPattern=null;
Perl5Matcher oMatcher = new Perl5Matcher();
Perl5Compiler oCompiler = new Perl5Compiler();
if (aEMails!=null) {
if (aEMails.length>0) {
if (aRecipients==null) {
aRecipients = aEMails;
} else {
aRecipients = concatArrays(aRecipients, aEMails);
} // fi (aRecipients!=null)
final int nRecipients = aRecipients.length;
Arrays.sort(aRecipients, String.CASE_INSENSITIVE_ORDER);
oRecipientsWithoutDuplicates = new ArrayList<String>(nRecipients);
sAllowPattern = getAllowPattern();
sDenyPattern = getDenyPattern();
if (sAllowPattern.length()>0) {
oAllowPattern = oCompiler.compile(sAllowPattern, Perl5Compiler.CASE_INSENSITIVE_MASK);
}
if (sDenyPattern.length()>0) {
oDenyPattern = oCompiler.compile(sDenyPattern, Perl5Compiler.CASE_INSENSITIVE_MASK);
}
for (int r=0; r<nRecipients-1; r++) {
bAllowed = true;
try {
if (sAllowPattern.length()>0) bAllowed &= oMatcher.matches(aRecipients[r], oAllowPattern);
} catch (ArrayIndexOutOfBoundsException aiob) {
throw new ArrayIndexOutOfBoundsException("Gadgets.matches("+aRecipients[r]+","+sAllowPattern+")");
}
try {
if (sDenyPattern.length()>0) bAllowed &= !oMatcher.matches(aRecipients[r], oDenyPattern);
} catch (ArrayIndexOutOfBoundsException aiob) {
throw new ArrayIndexOutOfBoundsException("Gadgets.matches("+aRecipients[r]+","+sDenyPattern+")");
}
if (bAllowed) {
if (!aRecipients[r].equalsIgnoreCase(aRecipients[r+1])) {