You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by je...@locus.apache.org on 2000/06/06 23:52:16 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/validators/datatype DatatypeValidatorFactoryImpl.java
jeffreyr 00/06/06 14:52:15
Modified: java/src/org/apache/xerces/validators/datatype
DatatypeValidatorFactoryImpl.java
Log:
Cloning object is not really needed in this architecture
Revision Changes Path
1.3 +16 -14 xml-xerces/java/src/org/apache/xerces/validators/datatype/DatatypeValidatorFactoryImpl.java
Index: DatatypeValidatorFactoryImpl.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/validators/datatype/DatatypeValidatorFactoryImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DatatypeValidatorFactoryImpl.java 2000/06/06 19:54:24 1.2
+++ DatatypeValidatorFactoryImpl.java 2000/06/06 21:52:14 1.3
@@ -66,7 +66,7 @@
/**
- * @version $Id: DatatypeValidatorFactoryImpl.java,v 1.2 2000/06/06 19:54:24 jeffreyr Exp $
+ * @version $Id: DatatypeValidatorFactoryImpl.java,v 1.3 2000/06/06 21:52:14 jeffreyr Exp $
* @author Jeffrey Rodriguez
*/
@@ -349,19 +349,21 @@
simpleType = (AbstractDatatypeValidator) fRegistry.get(type);
- if ( simpleType != null ) { // if not registered type to create one
- try {
- simpleType = (AbstractDatatypeValidator) simpleType.clone();
- } catch (CloneNotSupportedException cloneExc) {
- try {
- simpleType = (AbstractDatatypeValidator) simpleType.getClass().newInstance();
- } catch( InstantiationException e ) {
- e.printStackTrace();
- } catch( IllegalAccessException e ) {
- e.printStackTrace();
- }
- }
- }
+ // This code is not needed after all.
+ // and it is a potential performance hit.
+ //if ( simpleType != null ) { // if not registered type to create one
+ // try {
+ // simpleType = (AbstractDatatypeValidator) simpleType.clone();
+ //} catch (CloneNotSupportedException cloneExc) {
+ // try {
+ // simpleType = (AbstractDatatypeValidator) simpleType.getClass().newInstance();
+ // } catch( InstantiationException e ) {
+ // e.printStackTrace();
+ // } catch( IllegalAccessException e ) {
+ // e.printStackTrace();
+ //}
+ //}
+ //}
}
return (DatatypeValidator) simpleType;
}