From bc5f9dec37da59182034c1166a6a9d4150f40847 Mon Sep 17 00:00:00 2001 From: Instrumental Date: Tue, 15 Oct 2019 11:38:13 -0500 Subject: Sonar Warning Issue-ID: AAF-1019 Change-Id: I21392732189837f6ce031d618bd8f5e63e06e28c Signed-off-by: Instrumental --- .../java/org/onap/aaf/auth/dao/cached/CachedCredDAO.java | 2 +- .../main/java/org/onap/aaf/auth/dao/cached/FileGetter.java | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/CachedCredDAO.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/CachedCredDAO.java index 9c55d464..b1165c26 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/CachedCredDAO.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/CachedCredDAO.java @@ -38,7 +38,7 @@ public class CachedCredDAO extends CachedDAO public CachedCredDAO(CredDAO dao, CIDAO info, long expiresIn) { super(dao, info, CredDAO.CACHE_SEG, expiresIn); - if(FileGetter.isLoaded) { + if(FileGetter.isLoaded()) { readID = new ReadID() { @Override public Result> read(AuthzTrans trans, final String id) { diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/FileGetter.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/FileGetter.java index 702f989a..75efdfae 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/FileGetter.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/FileGetter.java @@ -43,9 +43,9 @@ import org.onap.aaf.cadi.util.CSV; public class FileGetter { private static final String AAF_FILEGETTER = "aaf_filegetter"; - public static boolean isLoaded = false; + private static boolean isLoaded = false; private static FileGetter singleton; - + private static List EMPTY = new ArrayList<>(); private Map> data; private SimpleDateFormat sdf; private FileGetter(Access access) { @@ -110,12 +110,12 @@ public class FileGetter { singleton = new FileGetter(access); } return singleton; - } + public Getter getter(String id) { return new FGetter(id); } - private static List EMPTY = new ArrayList<>(); + public class FGetter implements Getter { private final List lcdd; public FGetter(final String id) { @@ -142,5 +142,9 @@ public class FileGetter { } } } + + public static boolean isLoaded() { + return isLoaded; + } } -- cgit 1.2.3-korg