Hi, Please find attached patch for class XSWildcardDecl. Modified the instantiation of Vector used, by specifying the intialCapacity and increment size for optimal use of memory. Cheers, Rahul Sun Microsystems, Inc.
XSWildcardDecl.java
Description: XSWildcardDecl.javaIndex: XSWildcardDecl.java =================================================================== RCS file: /home/cvspublic/xml-xerces/java/src/org/apache/xerces/impl/v2/XSWildcardDecl.java,v retrieving revision 1.6 diff -u -w -r1.6 XSWildcardDecl.java --- XSWildcardDecl.java 2001/10/05 13:34:07 1.6 +++ XSWildcardDecl.java 2001/10/08 14:24:23 @@ -189,12 +189,17 @@ // 3 If both O1 and O2 are sets of (namespace names or �absent�), then the union of those sets // must be the value. else if ( (fType == WILDCARD_LIST) && (wildcard.fType == WILDCARD_LIST) ) { + boolean found; Vector union = new Vector(fNamespaceList.length, wildcard.fNamespaceList.length); + //if (fNamespaceList.length > wildcard.fNamespaceList.length) + // union = new Vector(fNamespaceList.length, +wildcard.fNamespaceList.length); + //else + // union = new Vector(wildcard.fNamespaceList.length, +fNamespaceList.length); + for (int i=0; i<fNamespaceList.length; i++) union.addElement(fNamespaceList[i]); - boolean found; for (int i=0; i<wildcard.fNamespaceList.length; i++) { found = false; for (int j=0; j<fNamespaceList.length; j++) @@ -275,13 +280,15 @@ // the set, must be the value. else if ( ((fType == WILDCARD_OTHER) && (wildcard.fType == WILDCARD_LIST)) || ((fType == WILDCARD_LIST) && (wildcard.fType == WILDCARD_OTHER)) ) { - Vector intersect = new Vector(5,2); + Vector intersect = null; if (fType == WILDCARD_OTHER) { + intersect = new Vector(wildcard.fNamespaceList.length); for (int i=0; i<wildcard.fNamespaceList.length; i++) if (fNamespaceList[0] != wildcard.fNamespaceList[i]) intersect.addElement(wildcard.fNamespaceList[i]); } else { + intersect = new Vector(fNamespaceList.length); for (int i=0; i<fNamespaceList.length; i++) if (wildcard.fNamespaceList[0] != fNamespaceList[i]) intersect.addElement(fNamespaceList[i]); @@ -295,8 +302,13 @@ // 4 If both O1 and O2 are sets of (namespace names or �absent�), then the intersection of those // sets must be the value. else if ( (fType == WILDCARD_LIST) && (wildcard.fType == WILDCARD_LIST) ) { - Vector intersect = new Vector(fNamespaceList.length,2); boolean found; + Vector intersect = null; + + if (fNamespaceList.length < wildcard.fNamespaceList.length) + intersect = new Vector(fNamespaceList.length); + else + intersect = new Vector(wildcard.fNamespaceList.length); for (int i=0; i<fNamespaceList.length; i++) { found = false;--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
