--- old/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/XML11Configuration.java 2017-02-15 18:49:28.870956646 +0300 +++ new/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/XML11Configuration.java 2017-02-15 18:49:28.762956649 +0300 @@ -415,9 +415,12 @@ /** Current DTD scanner. */ protected XMLDTDScanner fCurrentDTDScanner; - /** Flag indiciating whether XML11 components have been initialized. */ + /** Flag indicating whether XML11 components have been initialized. */ private boolean f11Initialized = false; + /** Flag indicating whether the symbol table instance was specified during construction **/ + private boolean fSymbolTableProvided = false; + // // Constructors // @@ -566,15 +569,18 @@ }; addRecognizedProperties(recognizedProperties); - if (symbolTable == null) { - symbolTable = new SymbolTable(); + // Remember if symbolTable was provided from outside + fSymbolTableProvided = symbolTable != null; + if (!fSymbolTableProvided) { + fSymbolTable = new SymbolTable(); + } else { + fSymbolTable = symbolTable; } - fSymbolTable = symbolTable; fProperties.put(SYMBOL_TABLE, fSymbolTable); fGrammarPool = grammarPool; if (fGrammarPool != null) { - fProperties.put(XMLGRAMMAR_POOL, fGrammarPool); + fProperties.put(XMLGRAMMAR_POOL, fGrammarPool); } fEntityManager = new XMLEntityManager(); @@ -840,6 +846,13 @@ fValidationManager.reset(); fVersionDetector.reset(this); fConfigUpdated = true; + + // Reset the symbol table if it wasn't provided during construction + if (!fSymbolTableProvided) { + fSymbolTable = new SymbolTable(); + } + fProperties.put(SYMBOL_TABLE, fSymbolTable); + resetCommon(); short version = fVersionDetector.determineDocVersion(fInputSource);