On Wed, Dec 28, 2005 at 05:17:03AM +0100, [EMAIL PROTECTED] wrote: > For the NPE fix see http://svn.apache.org/viewcvs?rev=359383&view=rev > > I didn't manage to construct a small test case for the NPE. Any attempts to > cut > down the large param-tidy.fo to a reasonable size but still exhibiting the > problem failed. I must be missing something. Any help / suggestions > appreciated.
The test file linearea_nonempty_1.xml reproduces the NPE (without Manuel's fix). lastPos being null means that in InlineLM.addAreas, the iterator parentIter passed to it did not contain any area-generating positions. In this case, the paragraph is: Object = LineLayoutManager$Paragraph (id=96) Object = KnuthGlue (id=104) Object = KnuthPenalty (id=108) Object = KnuthGlue (id=110) Object = KnuthInlineBox (id=111) Object = KnuthPenalty (id=114) Object = KnuthGlue (id=115) Object = KnuthPenalty (id=116) There are two lines: from 0 to 1, and from 2 to 6. Line 1 is the problem. In LineLM.addInlineArea (a new method, which I recently extracted from LineLM.addAreas) non-boxes are skipped, so that iStartElement becomes 3, resulting in an empty iterator. I do not understand how the line breaking algorithm can produce a line consisting of only a glue and a penalty. Regards, Simon -- Simon Pepping home page: http://www.leverkruid.nl