Return-Path: Delivered-To: apmail-xml-cocoon-cvs-archive@xml.apache.org Received: (qmail 76776 invoked by uid 500); 15 Mar 2002 16:32:55 -0000 Mailing-List: contact cocoon-cvs-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: cocoon-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cocoon-cvs@xml.apache.org Received: (qmail 76767 invoked by uid 500); 15 Mar 2002 16:32:55 -0000 Delivered-To: apmail-xml-cocoon2-cvs@apache.org Date: 15 Mar 2002 16:32:54 -0000 Message-ID: <20020315163254.61903.qmail@icarus.apache.org> From: haul@apache.org To: xml-cocoon2-cvs@apache.org Subject: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/language/markup CocoonMarkupLanguage.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N haul 02/03/15 08:32:54 Modified: src/java/org/apache/cocoon/components/language/markup CocoonMarkupLanguage.java Log: Patch from "Christoph Trompler" 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=3D2975 or http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3D5159 This has been fixed in newer SAX releases, but crimson bundled in JDK1.4 and xerces-j HEAD still contain the bug. Revision Changes Path 1.4 +7 -2 xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/CocoonMarkupLanguage.java Index: CocoonMarkupLanguage.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/CocoonMarkupLanguage.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- CocoonMarkupLanguage.java 22 Feb 2002 07:00:08 -0000 1.3 +++ CocoonMarkupLanguage.java 15 Mar 2002 16:32:54 -0000 1.4 @@ -87,7 +87,7 @@ * @author Davanum Srinivas * @author Ovidiu Predescu * @author Vadim Gritsenko - * @version CVS $Id: CocoonMarkupLanguage.java,v 1.3 2002/02/22 07:00:08 cziegeler Exp $ + * @version CVS $Id: CocoonMarkupLanguage.java,v 1.4 2002/03/15 16:32:54 haul Exp $ */ public abstract class CocoonMarkupLanguage extends AbstractMarkupLanguage { @@ -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", ---------------------------------------------------------------------- In case of troubles, e-mail: webmaster@xml.apache.org To unsubscribe, e-mail: cocoon-cvs-unsubscribe@xml.apache.org For additional commands, e-mail: cocoon-cvs-help@xml.apache.org