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/04/12 17:54:40 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/impl/xs SchemaNamespaceSupport.java

sandygao    02/04/12 08:54:40

  Modified:    java/src/org/apache/xerces/impl/xs
                        SchemaNamespaceSupport.java
  Log:
  A more effecient way of cloning a SchemaNamespaceSupport object.
  
  Revision  Changes    Path
  1.3       +10 -2     xml-xerces/java/src/org/apache/xerces/impl/xs/SchemaNamespaceSupport.java
  
  Index: SchemaNamespaceSupport.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/SchemaNamespaceSupport.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SchemaNamespaceSupport.java	29 Jan 2002 01:15:14 -0000	1.2
  +++ SchemaNamespaceSupport.java	12 Apr 2002 15:54:40 -0000	1.3
  @@ -66,7 +66,7 @@
    *
    * @author Neil Graham, IBM
    *
  - * @version $Id: SchemaNamespaceSupport.java,v 1.2 2002/01/29 01:15:14 lehors Exp $
  + * @version $Id: SchemaNamespaceSupport.java,v 1.3 2002/04/12 15:54:40 sandygao Exp $
    */
   public class SchemaNamespaceSupport 
       extends NamespaceSupport {
  @@ -75,8 +75,16 @@
           super();
       } // constructor
   
  +    // more effecient than NamespaceSupport(NamespaceContext)
       public SchemaNamespaceSupport(SchemaNamespaceSupport nSupport) {
  -        super(nSupport);
  +        fNamespaceSize = nSupport.fNamespaceSize;
  +        if (fNamespace.length < fNamespaceSize)
  +            fNamespace = new String[fNamespaceSize];
  +        System.arraycopy(nSupport.fNamespace, 0, fNamespace, 0, fNamespaceSize);
  +        fCurrentContext = nSupport.fCurrentContext;
  +        if (fContext.length <= fCurrentContext)
  +            fContext = new int[fCurrentContext+1];
  +        System.arraycopy(nSupport.fContext, 0, fContext, 0, fCurrentContext+1);
       } // end constructor
       
       /**
  
  
  

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