Permalink
Browse files

Ensure that correct setters are used for cc and bcc map entries.

  • Loading branch information...
Corneil du Plessis corneil.duplessis@gmail.com Corneil du Plessis corneil.duplessis@gmail.com
Corneil du Plessis corneil.duplessis@gmail.com authored and Corneil du Plessis corneil.duplessis@gmail.com committed Oct 3, 2014
1 parent 4b73013 commit 437865b4eadd9a39f051ea0e73b505e8738349d0
Showing with 12 additions and 6 deletions.
  1. +12 −6 core/src/main/groovyx/gaelyk/extensions/MailExtensions.java
@@ -55,16 +55,22 @@
else throw new IllegalArgumentException("Headers must be collection of Header objects");
break;
case "to":
if (v instanceof Collection<?>) msg.setTo((Collection<String>) v);
else msg.setTo(Arrays.asList(new String[] { String.valueOf(v) }));
if (v instanceof Collection<?>)
msg.setTo((Collection<String>) v);
else
msg.setTo(String.valueOf(v));
break;
case "bcc":
if (v instanceof Collection<?>) msg.setTo((Collection<String>) v);
else msg.setTo(Arrays.asList(new String[] { String.valueOf(v) }));
if (v instanceof Collection<?>)
msg.setBcc((Collection<String>) v);
else
msg.setBcc(String.valueOf(v));
break;
case "cc":
if (v instanceof Collection<?>) msg.setTo((Collection<String>) v);
else msg.setTo(Arrays.asList(new String[] { String.valueOf(v) }));
if (v instanceof Collection<?>)
msg.setCc((Collection<String>) v);
else
msg.setCc(String.valueOf(v));
break;
case "from":
case "sender":

0 comments on commit 437865b

Please sign in to comment.