cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christoph Trompler" <tromp...@informatik.tu-darmstadt.de>
Subject CocoonMarkupLanguage: no cocoon bug, but...
Date Wed, 13 Mar 2002 19:15:56 GMT
Hi!

In my environment (jdk1.4, tomcat 4.0.3-LE) xml-cocoon2 HEAD hangs in 
src/java/org/apache/cocoon/components/language/markup/CocoonMarkupLangua
ge.java at line 274

273:AttributesImpl newAtts = new AttributesImpl(atts);
274:newAtts.addAttribute("", "file-name", "file-name", "CDATA", name);

If newAtts is initialized with an empty atts attributes list, 
then org.xml.sax.helpers.AttributesImpl has a known bug with
the next addAttribute call. The method hangs in an infinite loop.
See http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2975 or
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5159

This has been fixed in newer SAX releases, but crimson bundled 
in JDK1.4 and xerces-j HEAD still contain the bug.

-- christoph

Might consider following patch:

--- CocoonMarkupLanguage.java.orig	Wed Mar 13 19:52:46 2002
+++ CocoonMarkupLanguage.java	Wed Mar 13 02:20:59 2002
@@ -270,7 +270,12 @@
                  String name = this.filename.substring(pos + 1);
                  String path = this.filename.substring(0,
pos).replace(File.separatorChar, '/');
                  // update the attributes
-                 AttributesImpl newAtts = new AttributesImpl(atts);
+                 AttributesImpl newAtts;
+                 if (atts == null || atts.getLength() == 0) {
+                    newAtts = new AttributesImpl();
+                 } else {
+                    newAtts = new AttributesImpl(atts);
+                 }    
                  newAtts.addAttribute("", "file-name", "file-name",
"CDATA", name);
                  newAtts.addAttribute("", "file-path", "file-path",
"CDATA", path);
                  newAtts.addAttribute("", "creation-date",
"creation-date", "CDATA",

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message