< prev index next >

jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/XML11Configuration.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.

@@ -504,11 +504,12 @@
             XMLSCHEMA_VALIDATION, XMLSCHEMA_FULL_CHECKING,
             EXTERNAL_GENERAL_ENTITIES,
             EXTERNAL_PARAMETER_ENTITIES,
             PARSER_SETTINGS,
             XMLConstants.FEATURE_SECURE_PROCESSING,
-            XMLConstants.USE_CATALOG
+            XMLConstants.USE_CATALOG,
+            JdkXmlUtils.RESET_SYMBOL_TABLE
         };
         addRecognizedFeatures(recognizedFeatures);
         // set state for default features
         fFeatures.put(VALIDATION, Boolean.FALSE);
         fFeatures.put(NAMESPACES, Boolean.TRUE);

@@ -530,10 +531,11 @@
         fFeatures.put(TOLERATE_DUPLICATES, Boolean.FALSE);
         fFeatures.put(USE_GRAMMAR_POOL_ONLY, Boolean.FALSE);
         fFeatures.put(PARSER_SETTINGS, Boolean.TRUE);
         fFeatures.put(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE);
         fFeatures.put(XMLConstants.USE_CATALOG, JdkXmlUtils.USE_CATALOG_DEFAULT);
+        fFeatures.put(JdkXmlUtils.RESET_SYMBOL_TABLE, JdkXmlUtils.RESET_SYMBOL_TABLE_DEFAULT);
 
         // add default recognized properties
         final String[] recognizedProperties =
         {
             SYMBOL_TABLE,

@@ -1583,15 +1585,16 @@
         }
     }
 
 
     /**
-     * Reset the symbol table if it wasn't provided during construction
-     * and its not the first time when parse is called after initialization
+     * Reset the symbol table if it wasn't provided during construction,
+     * its not the first time when parse is called after initialization
+     * and RESET_SYMBOL_TABLE feature is set to true
      */
     private void resetSymbolTable() {
-        if (!fSymbolTableProvided) {
+        if (fFeatures.get(JdkXmlUtils.RESET_SYMBOL_TABLE) && !fSymbolTableProvided) {
             if (fSymbolTableJustInitialized) {
                 // Skip symbol table reallocation for the first parsing process
                 fSymbolTableJustInitialized = false;
             } else {
                 fSymbolTable = new SymbolTable();
< prev index next >