/** {@inheritDoc} */ public DocumentBuilder getBuilder() throws XMLParserException { DocumentBuilder builder = null; long version = 0; if (dirtyBuilderConfiguration) { initializePool(); } synchronized(this) { version = getPoolVersion(); if (!builderPool.isEmpty()) { builder = builderPool.pop().get(); } // Will be null if either the stack was empty, or the SoftReference // has been garbage-collected if (builder == null) { builder = createBuilder(); } } if (builder != null) { return new DocumentBuilderProxy(builder, this, version); } return null; }
/** {@inheritDoc} */ public DocumentBuilder getBuilder() throws XMLParserException { DocumentBuilder builder = null; long version = 0; if (dirtyBuilderConfiguration) { initializePool(); } synchronized(this) { version = getPoolVersion(); if (!builderPool.isEmpty()) { builder = builderPool.pop().get(); } // Will be null if either the stack was empty, or the SoftReference // has been garbage-collected if (builder == null) { builder = createBuilder(); } } if (builder != null) { return new DocumentBuilderProxy(builder, this, version); } return null; }