I don't think it's your fault, Max. The docs should talk about that internal Calendar instance. Knowing things like that .oO( Hrm ... if it just has a single internal Calendar instance, it's probably doing modification to it on-the-fly ...) is quite important! If the only thing involved were the format, I think your apporach of moving things to a static initializer would have been the way to do it. Sounds like that's not the way to do it though :-(

Max Kutny wrote:

EB> from javadoc on SimpleDateFormat: Synchronization

EB> Date formats are not synchronized. It is recommended to create
EB> separate format instances for each thread. If multiple threads access
EB> a format concurrently, it must be synchronized externally.

EB> ... so your concern is quite valid ... kind of. The time I could see
EB> a problem arising would be when you are *changing* the format.

That's exactly as I understood javadoc. *formats* are not
synchronized. Since format is applyed in static code I suggested to move
SimpleDateFormat creation there. Seems I was wrong. That's javadoc
ambiguously.

Sorry all guys for confusing you.

--
Eddie Bush



--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>

Reply via email to