Andreas Delmelle
Fri, 09 May 2008 08:08:39 -0700
On May 9, 2008, at 16:40, Andreas Delmelle wrote:
<snip />That is, unless there is a specific reason to wait until getFontManager() is called before initializing (?) (Haven't checked whether the fontManager needs a fully initialized FopFactory to work properly...)
I did a quick check, and missed Jeremias' update in the meantime. The reference to FopFactory has been removed, so the assignment can be safely moved out of the method.
Declare it 'volatile' or 'final' to obtain assurance that multiple threads always see the same variable. In this case, 'final' should be OK, since the FopFactory has no setFontManager() method through which this reference could be altered.
Note: for final members, this may still be insufficient on older VMs, but modern VMs provide initialization safety in that case.
Cheers Andreas