Improve Upload Batch
[aaf/authz.git] / auth / auth-batch / src / main / java / org / onap / aaf / auth / batch / reports / Notify.java
index e6ce084..7cb8c1b 100644 (file)
@@ -310,7 +310,6 @@ import org.onap.aaf.misc.env.util.Chrono;
                                        npab.store(rs.asList());
                                        if(notify(noAvg, npab)>0) {
                                                // Update
-                                               cbl.preLoop();
 //                                             lastN.update(cbl.inc(),key,"pending","");
                                                npab.record(trans,cbl.inc(), id, idList, lastN);
                                                npab.inc();
@@ -360,6 +359,9 @@ import org.onap.aaf.misc.env.util.Chrono;
                                                 }
                                                 idList.add(ident.fullID());
                                         }
+                                        if(identity==null) { // Actually, identity can't be null here, because
+                                                break;           // if(identities.isEmpty() {..} else {... <here>
+                                        }                    // So this is here to avoid Sonar false positive only
                                         StringBuilder content = new StringBuilder();
                                         content.append(String.format(header,version,Identity.mixedCase(identity.firstName())));
 
@@ -367,7 +369,6 @@ import org.onap.aaf.misc.env.util.Chrono;
                                         content.append(footer);
 
                                         if(mailer.sendEmail(trans, test, toList, ccList, nb.subject(),content.toString(), urgent)) {
-                                               cbl.preLoop();
                                                nb.record(trans,cbl.inc(), id, idList, lastN);
                                                nb.inc();
                                         } else {