From: Jonathan Gathman Date: Thu, 21 Feb 2019 13:28:47 +0000 (+0000) Subject: Merge "Sonar Fix: NotifyApprovals.java" X-Git-Tag: 2.1.9~9 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=aaf%2Fauthz.git;a=commitdiff_plain;h=d9c0bb04b77f6a637f1fc07b69c90898d672bd34;hp=815bb520743dc523f69bebc367391872888fd5ef Merge "Sonar Fix: NotifyApprovals.java" --- diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/update/NotifyApprovals.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/update/NotifyApprovals.java index 4acf269d..7138a7c9 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/update/NotifyApprovals.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/update/NotifyApprovals.java @@ -3,6 +3,8 @@ * org.onap.aaf * =========================================================================== * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * + * Modifications Copyright (C) 2018 IBM. * =========================================================================== * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -107,14 +109,16 @@ public class NotifyApprovals extends Batch { Message msg = new Message(); int emailCount = 0; List pending = new ArrayList<>(); - boolean isOwner,isSupervisor; + boolean isOwner; + boolean isSupervisor; for (Entry> es : Approval.byApprover.entrySet()) { isOwner = isSupervisor = false; String approver = es.getKey(); if (approver.indexOf('@')<0) { approver += org.getRealm(); } - Date latestNotify=null, soonestExpire=null; + Date latestNotify=null; + Date soonestExpire=null; GregorianCalendar latest=new GregorianCalendar(); GregorianCalendar soonest=new GregorianCalendar(); pending.clear(); @@ -165,8 +169,7 @@ public class NotifyApprovals extends Batch { } } } - if (go) { - if (maxEmails>emailCount++) { + if (go && (maxEmails>emailCount++)) { try { Organization org = OrganizationFactory.obtain(env, approver); Identity user = org.getIdentity(noAvg, approver); @@ -222,7 +225,6 @@ public class NotifyApprovals extends Batch { } catch (OrganizationException e) { trans.info().log(e); } - } } } }