From 95f9931f178ea1d3332a8ab1640c07a21a9107e3 Mon Sep 17 00:00:00 2001 From: burdziak Date: Mon, 21 May 2018 13:24:59 +0200 Subject: Fix sonar issues in Email Change-Id: I5f0607852ee433d5f5dcaac747c6a34bd077ae57 Issue-ID: AAF-296 Signed-off-by: burdziak --- .../src/main/java/org/onap/aaf/auth/actions/Email.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'auth/auth-batch/src/main') 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{ public Email(String ... defaultCC) { - toList = new ArrayList(); + toList = new ArrayList<>(); this.defaultCC = defaultCC; - ccList = new ArrayList(); + ccList = new ArrayList<>(); clear(); } @@ -71,10 +71,8 @@ public class Email implements Action{ } 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{ } 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; } -- cgit 1.2.3-korg