[Opensource] Fix to DefaultAutoElement AND new CachedDateFormat class

david at lloydhome.com david at lloydhome.com
Thu May 15 10:13:08 PDT 2003


Mike,

I changed the date format code in my DefaultAutoElement class the way you
had asked.  There will now need to be three message bundle keys:
    localized.datetime.pattern.date = mm/dd/yyyy
    localized.datetime.pattern.time = hh:mm:ss
    localized.datetime.pattern.datetime = mm/dd/yyyy hh:mm:ss
This will allow for putting the (mm/dd/yyyy) formats after field labels.

The fix also includes looking up field descriptions in the dbobj's schema
first, then the expresso schema for localized field labels.  When these
two fail, the field label is shown as-is.

The diff is really large so I included the file.

And if you call now we'll thrown in a set of knives, oops classes.  I created
a CachedDateFormat class that we can use to clean up the three + places
that have maps of DateFormat classes.  The class description lists this,
but it is pretty fast.  It should be *nearly* as fast as the custom maps,
and I think it will be as fast if you use it by pattern directly (which
is our common case).  The other nice thing is that sychronization won't
be as large of a bottle-neck since everyone gets their own instance.

If you approve, I will clean up the code to use it.

David Lloyd


-------------- next part --------------
A non-text attachment was scrubbed...
Name: CachedDateFormat.java
Type: java/*
Size: 11891 bytes
Desc: not available
Url : http://mailman.jcorporate.com/pipermail/opensource/attachments/20030515/09d1f153/CachedDateFormat-0002.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DateTimePerformance.java
Type: java/*
Size: 9831 bytes
Desc: not available
Url : http://mailman.jcorporate.com/pipermail/opensource/attachments/20030515/09d1f153/DateTimePerformance-0002.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DefaultAutoElement.java
Type: java/*
Size: 45995 bytes
Desc: not available
Url : http://mailman.jcorporate.com/pipermail/opensource/attachments/20030515/09d1f153/DefaultAutoElement-0002.bin


More information about the Opensource mailing list