Log when a date property is set and date parsing fails

This commit is contained in:
hns 2001-02-08 21:03:24 +00:00
parent 33f89d80a0
commit a129191e19

View file

@ -145,13 +145,14 @@ public final class Property implements IProperty, Serializable, Cloneable {
dirty = true; dirty = true;
// if this is not a string property, try to parse a value out of it // if this is not a string property, try to parse a value out of it
if (type == DATE) { if (type == DATE) {
try {
SimpleDateFormat dateformat = new SimpleDateFormat (); SimpleDateFormat dateformat = new SimpleDateFormat ();
try {
dateformat.setLenient (true); dateformat.setLenient (true);
Date date = dateformat.parse (value); Date date = dateformat.parse (value);
this.lvalue = date.getTime (); this.lvalue = date.getTime ();
return; return;
} catch (ParseException nodate) { } catch (ParseException nodate) {
IServer.getLogger().log ("Couldn't parse date: was expecting something like "+dateformat.format (new Date()));
// store as plain string // store as plain string
} }
} }