Skip to content

Commit

Permalink
#94: always return new collections when building an email from an Ema…
Browse files Browse the repository at this point in the history
…ilBuilder, making it reusable (as designed). Note that the objects within these lists are already immutable.
  • Loading branch information
bbottema committed Aug 15, 2017
1 parent 66bdb4b commit dc9eddd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/org/simplejavamail/email/EmailBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -545,19 +545,19 @@ public String getSubject() {
}

public List<Recipient> getRecipients() {
return recipients;
return new ArrayList<>(recipients);
}

public List<AttachmentResource> getEmbeddedImages() {
return embeddedImages;
return new ArrayList<>(embeddedImages);
}

public List<AttachmentResource> getAttachments() {
return attachments;
return new ArrayList<>(attachments);
}

public Map<String, String> getHeaders() {
return headers;
return new HashMap<>(headers);
}

public File getDkimPrivateKeyFile() {
Expand Down

0 comments on commit dc9eddd

Please sign in to comment.