Details
-
Bug
-
Status: Resolved
-
Blocker
-
Resolution: Fixed
-
None
-
None
Description
private static void validateOptionalDateProperty(Properties config, String key, String message) { if (config.containsKey(key)) { try { initTimestampDateFormat.parse(config.getProperty(key)); — double value = Double.parseDouble(config.getProperty(key)); — if (value < 0) { throw new NumberFormatException(); } } catch (ParseException | NumberFormatException e){ throw new IllegalArgumentException(message); } } } }
This validation function will always fail regardless of either string format or double type.