summaryrefslogtreecommitdiffstats
path: root/auth/auth-batch/src/main
diff options
context:
space:
mode:
authorburdziak <olaf.burdziakowski@nokia.com>2018-05-21 13:24:59 +0200
committerburdziak <olaf.burdziakowski@nokia.com>2018-05-21 13:24:59 +0200
commit95f9931f178ea1d3332a8ab1640c07a21a9107e3 (patch)
treedcb179e35e0db4f8de37127e42bf1f9899aa9756 /auth/auth-batch/src/main
parentc8f8273a200559f87b883767758e4bda446dadfe (diff)
Fix sonar issues in Email
Change-Id: I5f0607852ee433d5f5dcaac747c6a34bd077ae57 Issue-ID: AAF-296 Signed-off-by: burdziak <olaf.burdziakowski@nokia.com>
Diffstat (limited to 'auth/auth-batch/src/main')
-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;
}