Bug 39571 - NullPointerException in InlineStackingLayoutManager.java:295
Summary: NullPointerException in InlineStackingLayoutManager.java:295
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: page-master/layout (show other bugs)
Version: trunk
Hardware: Macintosh Mac OS X 10.4
: P2 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-12 14:45 UTC by Max Berger
Modified: 2012-04-01 06:45 UTC (History)
0 users



Attachments
sample fo file (61.11 KB, text/plain)
2006-05-12 14:47 UTC, Max Berger
Details
Patch file for the bug presented (2.97 KB, patch)
2006-05-12 14:49 UTC, Max Berger
Details | Diff
A minimal fo file for the problem (1.73 KB, text/xml)
2006-05-17 20:05 UTC, Simon Pepping
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Max Berger 2006-05-12 14:45:59 UTC
When trying to format the attached .fo file, I get the following exception:

java.lang.NullPointerException
        at org.apache.fop.layoutmgr.inline.InlineStackingLayoutManager.addALetterSpaceTo
(InlineStackingLayoutManager.java:295)
        at org.apache.fop.layoutmgr.InlineKnuthSequence.addALetterSpace(InlineKnuthSequence.java:140)
        at org.apache.fop.layoutmgr.inline.LineLayoutManager.collectInlineKnuthElements
(LineLayoutManager.java:679)
        at org.apache.fop.layoutmgr.inline.LineLayoutManager.getNextKnuthElements
(LineLayoutManager.java:582)
        at org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements
(BlockStackingLayoutManager.java:275)
        at org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements
(BlockLayoutManager.java:105)
        at org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements
(BlockStackingLayoutManager.java:275)
        at org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements
(BlockLayoutManager.java:105)
        at org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements
(BlockStackingLayoutManager.java:275)
        at org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements
(BlockLayoutManager.java:105)
        at org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:
98)
        at org.apache.fop.layoutmgr.PageSequenceLayoutManager$PageBreaker.getNextKnuthElements
(PageSequenceLayoutManager.java:240)
        at org.apache.fop.layoutmgr.AbstractBreaker.getNextBlockList(AbstractBreaker.java:510)
        at org.apache.fop.layoutmgr.PageSequenceLayoutManager$PageBreaker.getNextBlockList
(PageSequenceLayoutManager.java:232)
        at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:259)
        at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:227)
        at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout
(PageSequenceLayoutManager.java:153)
        at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:381)
        at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:147)
        at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:358)
        at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:193)
        at org.apache.xalan.transformer.TransformerIdentityImpl.endElement
(TransformerIdentityImpl.java:1101)
        at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
        at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl
$FragmentContentDispatcher.dispatch(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:
484)
        at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:164)
        at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:114)
        at org.apache.fop.cli.Main.startFOP(Main.java:159)
        at org.apache.fop.cli.Main.main(Main.java:190)
Comment 1 Max Berger 2006-05-12 14:47:38 UTC
Created attachment 18264 [details]
sample fo file

forgot to mention my fop version: svn checkout from today (5/12)
Comment 2 Max Berger 2006-05-12 14:49:06 UTC
Created attachment 18265 [details]
Patch file for the bug presented

I've written a small fix that fixes the symptoms. This is probably a very bad
idea, someone that actually knows why this error is occuring should fix this.

However, the attached patch "works for me"
Comment 3 Simon Pepping 2006-05-17 20:05:35 UTC
Created attachment 18308 [details]
A minimal fo file for the problem

The NPE is caused by FOP's efforts to add a letter space to a box for padding.
It is triggered by the combination of NBSPACE, padding and an immediately
following inline level fo element.

I am still studying the best way to prevent this bug. Checking whether the box
is an InlineBox, like you do in your patch, is a good option.
Comment 4 Simon Pepping 2006-05-19 15:15:14 UTC
Patch applied, with a few modifications, in revision 407819. Thanks.

This patch is certainly not a definitive solution, rather it is an emergeny
patch. The problem is part of the range of problems with inline handling,
signalled earlier this year by Manuel Mall.

Comment 5 Glenn Adams 2012-04-01 06:45:18 UTC
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed