X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-cass%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fdao%2Fcass%2FHistoryDAO.java;h=0cfc1dc5192f85cc492aaab39534ba2a95c5f0bf;hb=b126c6c5f625432722405538692184f5c74edaad;hp=8e4ada1028a1f78eacca6fcd6caf4d1e2f8d3534;hpb=36b62be84b398044e1feae657c662dba6247782f;p=aaf%2Fauthz.git diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/HistoryDAO.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/HistoryDAO.java index 8e4ada10..0cfc1dc5 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/HistoryDAO.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/HistoryDAO.java @@ -56,9 +56,6 @@ import com.datastax.driver.core.Row; public class HistoryDAO extends CassDAOImpl { private static final String TABLE = "history"; - public static final SimpleDateFormat monthFormat = new SimpleDateFormat("yyyyMM"); -// private static final SimpleDateFormat dayTimeFormat = new SimpleDateFormat("ddHHmmss"); - private String[] helpers; private HistLoader defLoader; @@ -177,7 +174,8 @@ public class HistoryDAO extends CassDAOImpl { public static Data newInitedData() { Data data = new Data(); Date now = new Date(); - data.yr_mon = Integer.parseInt(monthFormat.format(now)); + // Sonar claims that SimpleDateFormat is not thread safe, so we can't be static + data.yr_mon = Integer.parseInt(new SimpleDateFormat("yyyyMM").format(now)); // data.day_time = Integer.parseInt(dayTimeFormat.format(now)); return data; }