jkesselm 01/08/06 07:56:33
Modified: java/src/org/apache/xml/utils NamespaceSupport2.java
Log:
Don't create caches unless used (which I don't think they are, in Xalan).
Revision Changes Path
1.5 +15 -16
xml-xalan/java/src/org/apache/xml/utils/NamespaceSupport2.java
Index: NamespaceSupport2.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xml/utils/NamespaceSupport2.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- NamespaceSupport2.java 2001/08/06 04:56:51 1.4
+++ NamespaceSupport2.java 2001/08/06 14:56:32 1.5
@@ -388,19 +388,12 @@
// a specific enumerator for these prefixes... or a filter
// around the all-prefixes enumerator, which comes out to
// roughly the same thing.
+ //
+ // **** Currently a filter. That may not be most efficient
+ // when I'm done restructuring storage!
-// Vector prefixes = new Vector();
-// Enumeration allPrefixes = getPrefixes();
-// while (allPrefixes.hasMoreElements()) {
-// String prefix = (String)allPrefixes.nextElement();
-// if (uri.equals(getURI(prefix))) {
-// prefixes.addElement(prefix);
-// }
-// }
-// return prefixes.elements();
-
PrefixEnumerator prefixEnumerator = new PrefixEnumerator();
- return prefixEnumerator.setup(uri,getPrefixes());
+ return prefixEnumerator.setup(uri,getPrefixes());
}
/**
@@ -516,8 +509,8 @@
{
prefixTable = new Hashtable();
uriTable = new Hashtable();
- elementNameTable=new Hashtable();
- attributeNameTable=new Hashtable();
+ elementNameTable=null;
+ attributeNameTable=null;
}
else
setParent(parent);
@@ -614,8 +607,12 @@
// Select the appropriate table.
if (isAttribute) {
+ if(elementNameTable==null)
+ elementNameTable=new Hashtable();
table = elementNameTable;
} else {
+ if(attributeNameTable==null)
+ attributeNameTable=new Hashtable();
table = attributeNameTable;
}
@@ -768,10 +765,12 @@
// Replace the caches with empty ones, rather than
// trying to determine which bindings should be flushed.
// As far as I can tell, these caches are never actually
- // used in Xalan... More efficient to dump the whole
+ // used in Xalan... More efficient to remove the whole
// cache system? ****
- elementNameTable=new Hashtable();
- attributeNameTable=new Hashtable();
+ if(elementNameTable!=null)
+ elementNameTable=new Hashtable();
+ if(attributeNameTable!=null)
+ attributeNameTable=new Hashtable();
tablesDirty = true;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]