Hello.

I've discovered a bug in org.apache.xml.serialize.BaseMarkupSerializer. It
resides within:

ElementState enterElementState( String, boolean )

The problem involves the resizing of the array "_elementStates." I found
that with XML documents that have a depth of greater than about 5 or 6 I was
getting a NullPointerException at the line "state.tagName = tagName" (right
after the "if" statement). I also noticed that the array "_elementStates" is
initialized to be of size 5.

To work around the problem, I increased the initial size of "_elementStates"
to be 50, and recompiled. After I did this, I had no problems whatsoever.
Thus, I firmly believe that the logic involved in the array resizing is
faulty, since if no resizing is necessary I get no errors, but if it becomes
necessary I do get errors.

Thanks,
Brett Keating

Reply via email to