From: Pawel Date: Tue, 22 May 2018 11:08:41 +0000 (-0400) Subject: fixes in Future.java X-Git-Tag: Beijing-2.1.1~14^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=aaf%2Fauthz.git;a=commitdiff_plain;h=abf9c55ff200cf6dd5b9096e4b2f5ba250dfb721 fixes in Future.java Change-Id: I1f62aec04bd56240d187efa9360c14d983585f70 Issue-ID: AAF-312 Signed-off-by: Pawel --- diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Future.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Future.java index a2dc6b65..948e65be 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Future.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Future.java @@ -44,12 +44,12 @@ import com.datastax.driver.core.SimpleStatement; import com.datastax.driver.core.Statement; public class Future implements CacheChange.Data, Comparable { - public static final Map data = new TreeMap(); - public static final Map> byRole = new TreeMap>(); + public static final Map data = new TreeMap<>(); + public static final Map> byRole = new TreeMap<>(); public final FutureDAO.Data fdd; public final String role; // derived - private final static CacheChange cache = new CacheChange(); + private static final CacheChange cache = new CacheChange<>(); public final UUID id() { @@ -102,13 +102,16 @@ public class Future implements CacheChange.Data, Comparable { ++count; Future f = creator.create(row); data.put(f.fdd.id,f); - if(f.role!=null) { - List lf = byRole.get(f.role); - if(lf==null) { - byRole.put(f.role,lf = new ArrayList()); - } - lf.add(f); + if(f.role==null) { + continue; } + List lf = byRole.get(f.role); + if(lf==null) { + lf = new ArrayList<>(); + byRole.put(f.role,lf); + } + lf.add(f); + } } finally { tt.done();