In the org.apache.fop.layoutmgr.inline.InlineStackingLayoutManager an NullPointerException is thrown in the "applyChanges"-method, when the variables prevLM AND currLM both are null. line 333-338: currLM = (InlineLevelLayoutManager) oldElement.getLayoutManager(); // initialize prevLM if (prevLM == null) { prevLM = currLM; } The getLayoutManager-method of the ListElement-class returns null when no position is set, so currLM is null. If prevLM is null, too, prevLM is set to currLM - so both are null. In the following code the applyChanges-method is called on prevLM without null-check. As workaround I inserted the following code after line 338: if(prevLM == null && currLM == null) { continue; }
Thanks for the report, and the proposed quick-fix. I doubt that it's the cleanest way to address the issue, so we probably won't solve it that way. AFAIK a ListElement should always have an associated LM. IIC, there should really be no ListElements with a null LM... Is there any chance you could attach a small FO that reproduces the issue, so we can investigate this closer?
I reduced our FO to one fo:block. The problem seems to be the combination of the fo:block with hyphenate="true" and the containing empty fo:inline with an id-attribute: <?xml version="1.0" encoding="UTF-8"?> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> <fo:simple-page-master margin-right="30pt" margin-left="71pt" margin-bottom="23pt" margin-top="23pt" page-width="21cm" page-height="29.7cm" master-name="page"> <fo:region-body overflow="hidden" margin-bottom="50pt" margin-top="82pt"/> <fo:region-before extent="30pt"/> <fo:region-after extent="27pt"/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence country="DE" language="de" master-reference="page"> <fo:flow flow-name="xsl-region-body"> <fo:block hyphenate="true"> <fo:inline>Test</fo:inline> <fo:inline id="1" /> </fo:block> </fo:flow> </fo:page-sequence> </fo:root>
Created attachment 23291 [details] fo file wher the problem happens too (gzipped) I get this for fo files generated from docbook xslt.
Created attachment 23415 [details] Another short XSL-FO to reproduce the NPE The same behaviour occured both with FOP 0.95 and FOP TRUNK (rev 757712). If I remove either hyphenate property (from fo:block) or border property (from fo:inline), the NPE doesn't occur. Short XSL-FO attached reveals this behaviour. Note that there is no break opportunity anywhere.
Bug #48765 mentions a similar issue and may be related.
resetting severity from major to normal pending further review
resetting P2 open bugs to P3 pending further review
change status from ASSIGNED to NEW for consistency