summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Gathman <jonathan.gathman@att.com>2018-05-21 13:31:24 +0000
committerGerrit Code Review <gerrit@onap.org>2018-05-21 13:31:24 +0000
commit252723ccdf540bd1dab3b53e0784e4125b30c5ad (patch)
treed40f092d2866389a9420c4ac27a1b6eeeb9849fb
parent145fa693f054e86447b0e51901efbe6169be521c (diff)
parent95f9931f178ea1d3332a8ab1640c07a21a9107e3 (diff)
Merge "Fix sonar issues in Email"
-rw-r--r--auth/auth-batch/src/main/java/org/onap/aaf/auth/actions/Email.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/actions/Email.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/actions/Email.java
index 25e2ffca..15dfed38 100644
--- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/actions/Email.java
+++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/actions/Email.java
@@ -46,9 +46,9 @@ public class Email implements Action<Organization,Void, String>{
public Email(String ... defaultCC) {
- toList = new ArrayList<String>();
+ toList = new ArrayList<>();
this.defaultCC = defaultCC;
- ccList = new ArrayList<String>();
+ ccList = new ArrayList<>();
clear();
}
@@ -71,10 +71,8 @@ public class Email implements Action<Organization,Void, String>{
}
public Email addTo(Identity id) {
- if(id!=null) {
- if(!toList.contains(id.email())) {
+ if(id!=null && !toList.contains(id.email())) {
toList.add(id.email());
- }
}
return this;
}
@@ -94,10 +92,8 @@ public class Email implements Action<Organization,Void, String>{
}
public Email addCC(Identity id) {
- if(id!=null) {
- if(!ccList.contains(id.email())) {
+ if(id!=null && !ccList.contains(id.email())) {
ccList.add(id.email());
- }
}
return this;
}