#19 AttributesImpl: loop when adding new attribute

closed-works-for-me
nobody
5
2001-08-21
2001-08-18
Anonymous
No

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];

Discussion

  • David Brownell
    David Brownell
    2001-08-21

    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.)

     
  • David Brownell
    David Brownell
    2001-08-21

    working testcase, from bug report

     
    Attachments
  • David Brownell
    David Brownell
    2001-08-21

    • summary: Dead lock when adding new attribute --> AttributesImpl: loop when adding new attribute
    • status: open --> closed-works-for-me