You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by sa...@apache.org on 2002/03/07 20:20:00 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/parsers DOMASBuilderImpl.java
sandygao 02/03/07 11:19:59
Modified: java/src/org/apache/xerces/parsers DOMASBuilderImpl.java
Log:
Fixing bug [6894]: in DOMASBuilderImpl, we can't assume a grammar pool
implementation is already available. In fact, we need to revisit the place:
we always need to create our own grammar pool.
Revision Changes Path
1.12 +10 -4 xml-xerces/java/src/org/apache/xerces/parsers/DOMASBuilderImpl.java
Index: DOMASBuilderImpl.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/DOMASBuilderImpl.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- DOMASBuilderImpl.java 3 Mar 2002 15:22:56 -0000 1.11
+++ DOMASBuilderImpl.java 7 Mar 2002 19:19:59 -0000 1.12
@@ -73,7 +73,6 @@
import org.apache.xerces.dom.ASModelImpl;
import org.apache.xerces.dom.DOMInputSourceImpl;
import org.apache.xerces.util.DOMEntityResolverWrapper;
-import org.apache.xerces.util.DOMErrorHandlerWrapper;
import org.apache.xerces.xni.XNIException;
import org.apache.xerces.xni.parser.XMLConfigurationException;
import org.apache.xerces.xni.parser.XMLInputSource;
@@ -106,7 +105,7 @@
*
* @author Pavani Mukthipudi, Sun Microsystems Inc.
* @author Neil Graham, IBM
- * @version $Id: DOMASBuilderImpl.java,v 1.11 2002/03/03 15:22:56 rahuls Exp $
+ * @version $Id: DOMASBuilderImpl.java,v 1.12 2002/03/07 19:19:59 sandygao Exp $
*
*/
@@ -217,6 +216,13 @@
if (fGrammarPool == null) {
fGrammarPool = (XMLGrammarPool)fConfiguration.getProperty(StandardParserConfiguration.XMLGRAMMAR_POOL);
}
+ // if there is no grammar pool, create one
+ // REVISIT: ASBuilder should always create one.
+ if (fGrammarPool == null) {
+ fGrammarPool = new XMLGrammarPoolImpl();
+ fConfiguration.setProperty(StandardParserConfiguration.XMLGRAMMAR_POOL,
+ fGrammarPool);
+ }
if (fAbstractSchema != null) {
initGrammarPool(fAbstractSchema);
}
@@ -394,11 +400,11 @@
if (fGrammarPool != null) {
Grammar[] grammars = new Grammar[1];
if ((grammars[0] = (Grammar)currModel.getGrammar()) != null) {
- fGrammarPool.cacheGrammars(grammars[0].getGrammarDescription().getGrammarType(), grammars);
+ fGrammarPool.cacheGrammars(grammars[0].getGrammarDescription().getGrammarType(), grammars);
}
Vector modelStore = currModel.getInternalASModels();
for (int i = 0; i < modelStore.size(); i++) {
- initGrammarPool((ASModelImpl)modelStore.elementAt(i));
+ initGrammarPool((ASModelImpl)modelStore.elementAt(i));
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org