neeraj 2003/01/06 06:00:58
Modified: java/src/org/apache/xerces/impl Tag: jaxp_1_2_2_branch
XMLEntityManager.java
Log:
EntityExpansionLimit can be set via system property "entityExpansionLimit". It would
allow all the applications to put constraint on entity expansion limit without
recompiling their code. Also Resetting the fEntityExpansionCount to zero b/w
subsequent parse.
Revision Changes Path
No revision
No revision
1.53.2.2 +15 -3 xml-xerces/java/src/org/apache/xerces/impl/XMLEntityManager.java
Index: XMLEntityManager.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xerces/impl/XMLEntityManager.java,v
retrieving revision 1.53.2.1
retrieving revision 1.53.2.2
diff -u -r1.53.2.1 -r1.53.2.2
--- XMLEntityManager.java 12 Dec 2002 10:42:36 -0000 1.53.2.1
+++ XMLEntityManager.java 6 Jan 2003 14:00:58 -0000 1.53.2.2
@@ -184,6 +184,8 @@
protected static final String ENTITY_EXPANSION_LIMIT =
Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_EXPANSION_LIMIT;
+ //SYSTEM PROPERTY
+ protected static final String SYSTEM_PROPERTY_ENTITY_EXPANSION_LIMIT =
"entityExpansionLimit" ;
// recognized features and properties
@@ -1067,12 +1069,22 @@
catch (XMLConfigurationException e) {
fEntityExpansionLimit = null;
}
+
+ //its good to check for system property value again (though this is little
overhead) for every parse,
+ //an application might set the different limit for another XML document
- // initialize state
+ //determines the integer value of the system property
+ Integer entityExpansionLimit =
Integer.getInteger(SYSTEM_PROPERTY_ENTITY_EXPANSION_LIMIT);
+ if(entityExpansionLimit != null){
+ fEntityExpansionLimit = entityExpansionLimit ;
+ }
+
+ // initialize state
fStandalone = false;
fEntities.clear();
fEntityStack.removeAllElements();
-
+ //reset entity expansion count.
+ fEntityExpansionCount = 0 ;
fCurrentEntity = null;
// DEBUG
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]