Bug 47710 - NullPointerException related to white-space handling in retrieved markers
Summary: NullPointerException related to white-space handling in retrieved markers
Status: NEW
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: fo tree (show other bugs)
Version: trunk
Hardware: All All
: P3 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-19 11:31 UTC by Andreas L. Delmelle
Modified: 2012-04-07 01:52 UTC (History)
0 users



Attachments
FO file reproducing the issue (2.28 KB, application/octet-stream)
2009-08-19 11:31 UTC, Andreas L. Delmelle
Details
Proposed quick-fix (5.35 KB, patch)
2009-08-19 11:42 UTC, Andreas L. Delmelle
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas L. Delmelle 2009-08-19 11:31:53 UTC
Created attachment 24149 [details]
FO file reproducing the issue

If a fo:marker only contains inline-content, this may produce 'dangling'
references to the inlines that are never released, and can lead to a
NullPointerException in some cases.

See attached, minimized FO, for an example.
Comment 1 Andreas L. Delmelle 2009-08-19 11:42:50 UTC
Created attachment 24150 [details]
Proposed quick-fix

The patch in attach fixes the problem by resetting the XMLWhiteSpaceHandler every time a new page-sequence starts. (Note: doing this at the end of the page-sequence does not help, because marker white-space handling is performed in between the start- and endPageSequence events)
Comment 2 Andreas L. Delmelle 2009-08-19 11:46:58 UTC
(In reply to comment #1)
> (Note: doing this at the end of the
> page-sequence does not help, because marker white-space handling is performed
> in between the start- and endPageSequence events)

Correction: of course, I actually mean 'between end- and startPageSequence' of two consecutive page-sequences. The endPageSequence event is triggered before the marker's white-space is handled, and currently, that leads to references being carried over.

Technically, the cause is that white-space handling does not really 'continue' from the surrounding block, so the normal cleanup of the 'pending' inline is never triggered.
Comment 3 Andreas L. Delmelle 2009-08-20 14:19:21 UTC
Quick fix committed in r806361.

I'm inclined to leave this bug open for the moment, as this is not really the cleanest way to solve it. The real issue may ultimately still cause incorrect preservation of trailing white-space in such markers. Likely to be hardly noticeable, but still...
Comment 4 Glenn Adams 2012-04-07 01:43:53 UTC
resetting P2 open bugs to P3 pending further review