minor changes to comply with checkstyle

Former-commit-id: 29d398a6b5f3a1bb543971edf98557179b601486
This commit is contained in:
Jeremy Long
2014-01-25 07:02:08 -05:00
parent 8a8241dd1f
commit a4c37b3b9f

View File

@@ -132,6 +132,12 @@ public class DatabaseProperties {
return properties;
}
/**
* Returns a map of the meta data from the database properties. This primarily contains timestamps of when the NVD
* CVE information was last updated.
*
* @return a map of the database meta data
*/
public Map getMetaData() {
TreeMap map = new TreeMap();
for (Entry<Object, Object> entry : properties.entrySet()) {
@@ -139,10 +145,10 @@ public class DatabaseProperties {
if (!"version".equals(key)) {
if (key.startsWith("NVD CVE ")) {
try {
long epoch = Long.parseLong((String) entry.getValue());
Date date = new Date(epoch);
DateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
String formatted = format.format(date);
final long epoch = Long.parseLong((String) entry.getValue());
final Date date = new Date(epoch);
final DateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
final String formatted = format.format(date);
map.put(key, formatted);
} catch (Throwable ex) { //deliberatly being broad in this catch clause
Logger.getLogger(DatabaseProperties.class.getName()).log(Level.FINE, "Unable to parse timestamp from DB", ex);