[Libreoffice] [REVIEW] 3-4 cherry-pick fix to build with gcj 1.5.0

Stephan Bergmann sbergman at redhat.com
Fri Nov 4 08:23:19 PDT 2011


On 11/04/2011 02:53 PM, Caolán McNamara wrote:
> On Fri, 2011-11-04 at 14:01 +0100, Stephan Bergmann wrote:
>> That is, the call to DocumentBuilderFactory.newInstance() within
>> OfficeDocumentReportTarget would need to be wrapped
>
> Erm...
>
> http://opengrok.libreoffice.org/search?q=DocumentBuilderFactory.newInstance&project=core&defs=&refs=&path=&hist=
>
> Looks we're fairly riddled with this pattern. So presumably if this
> problem affects DocumentBuilderFactory.newInstance we already suffer
> from it in our xsltfilter and other places ?

The pattern probably here is that the problem is not noticed as long as 
the Java code is called from the main thread.  (The empty context class 
loader problem arises only for native threads other than the initial JVM 
thread that are attached to the JVM via JNI.  Threads spawned by the JVM 
inherit the calling thread's context class loader, and the thread on 
which the JVM is originally initialized explicitly obtains a non-null 
context class loader during initialization, IIRC).

Anyway, you have been warned.  ;)

Stephan


More information about the LibreOffice mailing list