You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Christoph Trompler <tr...@informatik.tu-darmstadt.de> on 2002/03/13 20:15:56 UTC

CocoonMarkupLanguage: no cocoon bug, but...

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


Re: CocoonMarkupLanguage: no cocoon bug, but...

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 13.Mar.2002 -- 08:15 PM, Christoph Trompler wrote:
> 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

Christoph,

patch is in CVS, please cross check.

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

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