Fixed sonar issues/code-smella across this file
Issue-ID: AAF-756
Change-Id: If89b87ae3c4acaad8d0d28b1eda97c4a1d1fe32f
Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
* org.onap.aaf
* ===========================================================================
* Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
* 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.
* ===========================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Message msg = new Message();
int emailCount = 0;
List<Approval> pending = new ArrayList<>();
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();
}
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();
GregorianCalendar latest=new GregorianCalendar();
GregorianCalendar soonest=new GregorianCalendar();
pending.clear();
- if (go) {
- if (maxEmails>emailCount++) {
+ if (go && (maxEmails>emailCount++)) {
try {
Organization org = OrganizationFactory.obtain(env, approver);
Identity user = org.getIdentity(noAvg, approver);
try {
Organization org = OrganizationFactory.obtain(env, approver);
Identity user = org.getIdentity(noAvg, approver);
} catch (OrganizationException e) {
trans.info().log(e);
}
} catch (OrganizationException e) {
trans.info().log(e);
}