You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by sa...@apache.org on 2002/01/03 21:14:14 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/impl/dv/xs_new AnyURIDV.java

sandygao    02/01/03 12:14:14

  Modified:    java/src/org/apache/xerces/impl/dv/xs_new AnyURIDV.java
  Log:
  Performance improvement: statically create one instance of the template
  base uri, instead of creating one whenever "getActualValue" is called.
  
  Revision  Changes    Path
  1.2       +11 -4     xml-xerces/java/src/org/apache/xerces/impl/dv/xs_new/AnyURIDV.java
  
  Index: AnyURIDV.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/dv/xs_new/AnyURIDV.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AnyURIDV.java	19 Nov 2001 20:13:01 -0000	1.1
  +++ AnyURIDV.java	3 Jan 2002 20:14:13 -0000	1.2
  @@ -67,10 +67,18 @@
    * @author Neeraj Bajaj, Sun Microsystems, inc.
    * @author Sandy Gao, IBM
    *
  - * @version $Id: AnyURIDV.java,v 1.1 2001/11/19 20:13:01 sandygao Exp $
  + * @version $Id: AnyURIDV.java,v 1.2 2002/01/03 20:14:13 sandygao Exp $
    */
   public class AnyURIDV extends TypeValidator {
   
  +    private static URI BASE_URI = null;
  +    static {
  +        try {
  +            BASE_URI = new URI("http://www.template.com");
  +        } catch (URI.MalformedURIException ex) {
  +        }
  +    }
  +
       public short getAllowedFacets(){
           return (XSSimpleTypeDecl.FACET_LENGTH | XSSimpleTypeDecl.FACET_MINLENGTH | XSSimpleTypeDecl.FACET_MAXLENGTH | XSSimpleTypeDecl.FACET_PATTERN | XSSimpleTypeDecl.FACET_ENUMERATION | XSSimpleTypeDecl.FACET_WHITESPACE );
       }
  @@ -81,13 +89,12 @@
           // check 3.2.17.c0 must: URI (rfc 2396/2723)
           try {
               if( content.length() != 0 ) {
  -                URI tempURI = new URI("http://www.template.com");
                   // Support for relative URLs
                   // According to Java 1.1: URLs may also be specified with a
                   // String and the URL object that it is related to.
  -                new URI(tempURI, content );
  +                new URI(BASE_URI, content );
               }
  -        } catch (  URI.MalformedURIException ex ) {
  +        } catch (URI.MalformedURIException ex) {
               throw new InvalidDatatypeValueException("Value '"+content+"' is a Malformed URI");
           }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org