< prev index next >
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/XML11Configuration.java
Print this page
*** 413,425 ****
/** Current Datatype validator factory. */
protected DTDDVFactory fCurrentDVFactory;
/** Current DTD scanner. */
protected XMLDTDScanner fCurrentDTDScanner;
! /** Flag indiciating whether XML11 components have been initialized. */
private boolean f11Initialized = false;
//
// Constructors
//
/** Default constructor. */
--- 413,428 ----
/** Current Datatype validator factory. */
protected DTDDVFactory fCurrentDVFactory;
/** Current DTD scanner. */
protected XMLDTDScanner fCurrentDTDScanner;
! /** 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
//
/** Default constructor. */
*** 564,577 ****
JdkXmlUtils.CATALOG_RESOLVE,
JdkXmlUtils.CDATA_CHUNK_SIZE
};
addRecognizedProperties(recognizedProperties);
! if (symbolTable == null) {
! symbolTable = new SymbolTable();
! }
fSymbolTable = symbolTable;
fProperties.put(SYMBOL_TABLE, fSymbolTable);
fGrammarPool = grammarPool;
if (fGrammarPool != null) {
fProperties.put(XMLGRAMMAR_POOL, fGrammarPool);
--- 567,583 ----
JdkXmlUtils.CATALOG_RESOLVE,
JdkXmlUtils.CDATA_CHUNK_SIZE
};
addRecognizedProperties(recognizedProperties);
! // Remember if symbolTable was provided from outside
! fSymbolTableProvided = symbolTable != null;
! if (!fSymbolTableProvided) {
! fSymbolTable = new SymbolTable();
! } else {
fSymbolTable = symbolTable;
+ }
fProperties.put(SYMBOL_TABLE, fSymbolTable);
fGrammarPool = grammarPool;
if (fGrammarPool != null) {
fProperties.put(XMLGRAMMAR_POOL, fGrammarPool);
*** 838,847 ****
--- 844,860 ----
if (fInputSource != null) {
try {
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);
if (version == Constants.XML_VERSION_1_1) {
initXML11Components();
< prev index next >