AttributesImpl: loop when adding new attribute
Brought to you by:
dmegginson
This bug is about adding new attribute to
AttributeImpl object which fas been initialised with
empty attributes set.
...
attsImpl = new AttributesImpl();
attsImpl.clear();
attsImpl.setAttributes( atts );
attsImpl.addAttribute( uri, lName,
qName, "CDATA", "true" );
...
in this example if atts is empty the addAttribute
method goee to infinite loop.
This fixex the problem (AttributesImpl.java):
345c345
< if (length > 0) data = new String[length*5];
---
> data = new String[length*5];
Logged In: YES
user_id=44117
Using the current CVS and the attached file
("foo.java") which was derived from the bug
report, I can't reproduce the problem at all.
That's with JDK 1.3.0 on Linux.
One user reported that the problem was really
somewhere in Xerces. Please make sure that
such problems repeat with SAX, and it's not
a Xerces bug. (A few people have reported
AttributesImpl problems, but so far none of
the reports checked out and the only lead seems
to be the comment that dropping Xerces made the
proble go away.)
working testcase, from bug report