summaryrefslogtreecommitdiffstats
path: root/auth/auth-batch/src
diff options
context:
space:
mode:
authorArundathi Patil <arundpil@in.ibm.com>2019-02-11 09:42:55 +0530
committerIBM602-PC0F1E3C\Arundathi <arundpil@in.ibm.com>2019-02-11 09:43:02 +0530
commit00cd7c51f8b6e406e348572d229e4ea1f761cc10 (patch)
treed3368634c73cb0034cfc7219bfdd00f9713e1cd8 /auth/auth-batch/src
parent39596f5b6d2c67d8c2b357243ecfb2dd6d746796 (diff)
Sonar Fix: NotifyApprovals.java
Fixed sonar issues/code-smella across this file Issue-ID: AAF-756 Change-Id: If89b87ae3c4acaad8d0d28b1eda97c4a1d1fe32f Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
Diffstat (limited to 'auth/auth-batch/src')
-rw-r--r--auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/update/NotifyApprovals.java12
1 files changed, 7 insertions, 5 deletions
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<Approval> pending = new ArrayList<>();
- boolean isOwner,isSupervisor;
+ boolean isOwner;
+ boolean isSupervisor;
for (Entry<String, List<Approval>> 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);
}
- }
}
}
}