Bug 47412 - Concurrency issues in EscherProperties.initProps()
Summary: Concurrency issues in EscherProperties.initProps()
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: POI Overall (show other bugs)
Version: 3.5-dev
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL: http://mail-archives.apache.org/mod_m...
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-23 10:57 UTC by Josh Micich
Modified: 2009-06-23 11:12 UTC (History)
0 users



Attachments

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.