Bug 47412 - Concurrency issues in EscherProperties.initProps()
Concurrency issues in EscherProperties.initProps()
Product: POI
Classification: Unclassified
Component: POI Overall
PC Windows XP
: P2 normal (vote)
: ---
Assigned To: POI Developers List
Depends on:
  Show dependency tree
Reported: 2009-06-23 10:57 UTC by Josh Micich
Modified: 2009-06-23 11:12 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Josh Micich 2009-06-23 10:57:58 UTC
The field 'properties' on class EscherProperties is initialised lazily but there is nothing stopping a second thread reading the map while it is still being populated.  To be absolutely correct, some sort of synchronization is necessary.  Since this map initialisation is relatively simple and light-weight, there should be no problem with performing it in the class static initialiser.
Comment 1 Josh Micich 2009-06-23 11:12:57 UTC
Fixed in svn r787771

No junit added :( It's hard to write a deterministic tests that expose concurrency bugs. Hopefully the problem in the old version of the code is clear enough that the fix makes sense by itself.