mrglavas 2005/05/22 13:23:18
Modified: java/src/org/apache/xerces/jaxp/validation
XMLSchemaFactory.java
Log:
Use WeakReferenceXMLSchema for SchemaFactory.newSchema().
Revision Changes Path
1.5 +6 -24
xml-xerces/java/src/org/apache/xerces/jaxp/validation/XMLSchemaFactory.java
Index: XMLSchemaFactory.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xerces/jaxp/validation/XMLSchemaFactory.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XMLSchemaFactory.java 16 May 2005 01:34:47 -0000 1.4
+++ XMLSchemaFactory.java 22 May 2005 20:23:18 -0000 1.5
@@ -32,16 +32,14 @@
import org.apache.xerces.impl.Constants;
import org.apache.xerces.impl.xs.XMLSchemaLoader;
import org.apache.xerces.impl.xs.XSMessageFormatter;
-import org.apache.xerces.jaxp.validation.ReadOnlyGrammarPool;
-import org.apache.xerces.jaxp.validation.Util;
import org.apache.xerces.util.DOMEntityResolverWrapper;
import org.apache.xerces.util.DOMInputSource;
import org.apache.xerces.util.ErrorHandlerWrapper;
import org.apache.xerces.util.SAXInputSource;
import org.apache.xerces.util.SAXMessageFormatter;
+import org.apache.xerces.util.SecurityManager;
import org.apache.xerces.util.XMLGrammarPoolImpl;
import org.apache.xerces.xni.XNIException;
-import org.apache.xerces.xni.grammars.XMLGrammarDescription;
import org.apache.xerces.xni.grammars.XMLGrammarPool;
import org.apache.xerces.xni.parser.XMLConfigurationException;
import org.apache.xerces.xni.parser.XMLInputSource;
@@ -50,10 +48,9 @@
import org.xml.sax.ErrorHandler;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.apache.xerces.util.SecurityManager;
import org.xml.sax.SAXNotRecognizedException;
import org.xml.sax.SAXNotSupportedException;
+import org.xml.sax.SAXParseException;
/**
* [EMAIL PROTECTED] SchemaFactory} for XML Schema.
@@ -61,7 +58,7 @@
* @author Kohsuke Kawaguchi ([EMAIL PROTECTED])
* @version $Id$
*/
-public class XMLSchemaFactory extends SchemaFactory {
+public final class XMLSchemaFactory extends SchemaFactory {
// property identifiers
@@ -254,23 +251,8 @@
}
public Schema newSchema() throws SAXException {
- // use a pool that uses the system id as the equality source.
- return new XMLSchema(new XMLGrammarPoolImpl() {
- public boolean equals(XMLGrammarDescription desc1,
XMLGrammarDescription desc2) {
- String sid1 = desc1.getExpandedSystemId();
- String sid2 = desc2.getExpandedSystemId();
- if( sid1!=null && sid2!=null )
- return sid1.equals(sid2);
- if( sid1==null && sid2==null )
- return true;
- return false;
- }
- public int hashCode(XMLGrammarDescription desc) {
- String s = desc.getExpandedSystemId();
- if(s!=null) return s.hashCode();
- return 0;
- }
- });
+ // Use a Schema that uses the system id as the equality source.
+ return new WeakReferenceXMLSchema();
}
public boolean getFeature(String name)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]