You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2005/01/11 04:47:32 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/xinclude XIncludeHandler.java
mrglavas 2005/01/10 19:47:32
Modified: java/src/org/apache/xerces/xinclude XIncludeHandler.java
Log:
Fixing potential memory leaks. If there's a failure the language stacks never get reset. Making sure this always happens on reset.
Changing Vectors for notations and unparsed entities to ArrayLists and reusing them.
Revision Changes Path
1.39 +10 -8 xml-xerces/java/src/org/apache/xerces/xinclude/XIncludeHandler.java
Index: XIncludeHandler.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xinclude/XIncludeHandler.java,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- XIncludeHandler.java 1 Oct 2004 03:06:13 -0000 1.38
+++ XIncludeHandler.java 11 Jan 2005 03:47:32 -0000 1.39
@@ -17,10 +17,10 @@
import java.io.CharConversionException;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Stack;
import java.util.StringTokenizer;
-import java.util.Vector;
import org.apache.xerces.impl.Constants;
import org.apache.xerces.impl.XMLEntityManager;
@@ -300,8 +300,8 @@
private int[] fState = new int[INITIAL_SIZE];
// buffering the necessary DTD events
- private Vector fNotations;
- private Vector fUnparsedEntities;
+ private ArrayList fNotations;
+ private ArrayList fUnparsedEntities;
// for SAX compatibility.
// Has the value of the ALLOW_UE_AND_NOTATION_EVENTS feature
@@ -324,8 +324,8 @@
fSawFallback[fDepth] = false;
fSawInclude[fDepth] = false;
fState[fDepth] = STATE_NORMAL_PROCESSING;
- fNotations = new Vector();
- fUnparsedEntities = new Vector();
+ fNotations = new ArrayList();
+ fUnparsedEntities = new ArrayList();
fBaseURIScope = new IntStack();
fBaseURI = new Stack();
@@ -345,8 +345,8 @@
fNamespaceContext = null;
fDepth = 0;
fResultDepth = 0;
- fNotations = new Vector();
- fUnparsedEntities = new Vector();
+ fNotations.clear();
+ fUnparsedEntities.clear();
fParentRelativeURI = null;
fIsXML11 = false;
fInDTD = false;
@@ -356,6 +356,8 @@
fBaseURI.clear();
fLiteralSystemID.clear();
fExpandedSystemID.clear();
+ fLanguageScope.clear();
+ fLanguageStack.clear();
// REVISIT: Find a better method for maintaining
// the state of the XInclude processor. These arrays
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org