andyc       99/11/24 16:48:18

  Modified:    java/src/org/apache/xerces/dom CharacterDataImpl.java
  Log:
  Went ahead and created singleton empty node list instead of lazy
  evaluating it. No big deal, really.
  
  Revision  Changes    Path
  1.2       +4 -9      
xml-xerces/java/src/org/apache/xerces/dom/CharacterDataImpl.java
  
  Index: CharacterDataImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xerces/java/src/org/apache/xerces/dom/CharacterDataImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CharacterDataImpl.java    1999/11/09 01:13:14     1.1
  +++ CharacterDataImpl.java    1999/11/25 00:48:18     1.2
  @@ -87,7 +87,10 @@
       //
   
       /** Empty child nodes. */
  -    private static transient NodeList singletonNodeList;
  +    private static transient NodeList singletonNodeList = new NodeList() {
  +        public Node item(int index) { return null; }
  +        public int getLength() { return 0; }
  +    };
   
       //
       // Constructors
  @@ -107,14 +110,6 @@
   
       /** Returns an empty node list. */
       public NodeList getChildNodes() {
  -
  -        if (singletonNodeList == null) {
  -            singletonNodeList = new NodeList() {
  -                public Node item(int index) { return null; }
  -                public int getLength() { return 0; }
  -            };
  -        }
  -
           return singletonNodeList;
       }
   
  
  
  

Reply via email to