cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r158913 - cocoon/trunk/src/java/org/apache/cocoon/xml/dom/DOMStreamer.java cocoon/trunk/status.xml
Date Thu, 24 Mar 2005 13:23:02 GMT
Author: cziegeler
Date: Thu Mar 24 05:23:01 2005
New Revision: 158913

URL: http://svn.apache.org/viewcvs?view=rev&rev=158913
Log:
Fix NPE in DOMStreamer.stream().

Modified:
    cocoon/trunk/src/java/org/apache/cocoon/xml/dom/DOMStreamer.java
    cocoon/trunk/status.xml

Modified: cocoon/trunk/src/java/org/apache/cocoon/xml/dom/DOMStreamer.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/xml/dom/DOMStreamer.java?view=diff&r1=158912&r2=158913
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/xml/dom/DOMStreamer.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/xml/dom/DOMStreamer.java Thu Mar 24 05:23:01 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -66,7 +66,7 @@
 public class DOMStreamer implements XMLProducer {
 
     /** Default value for normalizeNamespaces. */
-    private final boolean DEFAULT_NORMALIZE_NAMESPACES = true;
+    private final static boolean DEFAULT_NORMALIZE_NAMESPACES = true;
 
     /** Indicates whether namespace normalization should happen. */
     protected boolean normalizeNamespaces = DEFAULT_NORMALIZE_NAMESPACES;
@@ -78,7 +78,7 @@
     protected DefaultDOMStreamer defaultDOMStreamer = new DefaultDOMStreamer();
 
     /** The transformer factory shared by all instances (only used by DefaultDOMStreamer)
*/
-    protected static TransformerFactory factory = TransformerFactory.newInstance();
+    protected final static TransformerFactory factory = TransformerFactory.newInstance();
 
     /**
      * Create a new <code>DOMStreamer</code> instance.
@@ -184,7 +184,7 @@
      * @author Bruno Dumon (bruno at outerthought dot org)
      * @author Xalan team
      */
-    public class NamespaceNormalizingDOMStreamer extends AbstractXMLProducer {
+    public static class NamespaceNormalizingDOMStreamer extends AbstractXMLProducer {
         /**
          * Information about the current element. Used to remember the localName, qName
          * and namespaceURI for generating the endElement event, and holds the namespaces
@@ -260,8 +260,10 @@
         }
 
         private final void dispatchChars(Node node) throws SAXException {
-            String data = ((Text) node).getData();
-            contentHandler.characters(data.toCharArray(), 0, data.length());
+            final String data = ((Text) node).getData();
+            if ( data != null ) {
+                contentHandler.characters(data.toCharArray(), 0, data.length());
+            }
         }
 
         /**
@@ -275,8 +277,10 @@
                 case Node.COMMENT_NODE:
                     {
                         if (lexicalHandler != null) {
-                            String data = ((Comment) node).getData();
-                            lexicalHandler.comment(data.toCharArray(), 0, data.length());
+                            final String data = ((Comment) node).getData();
+                            if ( data != null ) {
+                                lexicalHandler.comment(data.toCharArray(), 0, data.length());
+                            }
                         }
                     }
                     break;
@@ -598,7 +602,7 @@
             }
         }
 
-        public class ElementInfo {
+        public static class ElementInfo {
             public String localName;
             public String namespaceURI;
             public String qName;
@@ -658,9 +662,8 @@
                 }
                 if (parent != null) {
                     return parent.findPrefix(namespaceURI);
-                } else {
-                    return null;
                 }
+                return null;
             }
 
             /**
@@ -673,10 +676,10 @@
                         return uri;
                     }
                 }
-                if (parent != null)
+                if (parent != null) {
                     return parent.findNamespaceURI(prefix);
-                else
-                    return null;
+                }
+                return null;
             }
         }
     }
@@ -689,7 +692,7 @@
      * @author <a href="mailto:pier@apache.org">Pierpaolo Fumagalli</a>
      *         (Apache Software Foundation)
      */
-    public class DefaultDOMStreamer extends AbstractXMLProducer {
+    public static class DefaultDOMStreamer extends AbstractXMLProducer {
 
         /** The private transformer for this instance */
         protected Transformer transformer;

Modified: cocoon/trunk/status.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/status.xml?view=diff&r1=158912&r2=158913
==============================================================================
--- cocoon/trunk/status.xml (original)
+++ cocoon/trunk/status.xml Thu Mar 24 05:23:01 2005
@@ -428,6 +428,14 @@
      Remove deprecated methods from XMLUtils, DOMUtil, DOMBuilder and SourceUtil.
    </action>
  </release>
+ <release version="2.1.8" date="TBD">
+   <action dev="CZ" type="fix" fixes-bug="33963" due-to="John Yonosh" due-to-email="jyonosh@fcg.com">
+     Fix NPE in DOMStreamer.stream().
+   </action>
+   <action dev="CZ" type="fix">
+     Portal block: Make portal manager available through portal component manager.
+   </action>
+ </release>
  <release version="2.1.7" date="March 23 2005">
    <action dev="AG" type="update">
      Updated hsqldb to 1.7.3.3.



Mime
View raw message