Skip to content

FOP-3349: A line that overflows on the float re-layout pass is reported, not a NullPointerException - #121

Open
plutext wants to merge 1 commit into
apache:mainfrom
plutext:FOP-3349
Open

plutext wants to merge 1 commit into
apache:mainfrom
plutext:FOP-3349

Conversation

@plutext

@plutext plutext commented Oct 4, 2026

Copy link
Copy Markdown

Fixes FOP-3349.

LineLayoutManager.LineBreakingAlgorithm.updateData2 reports a line that does not fit through curChildLM:

if (curChildLM.getFObj() == null) {
    eventProducer.lineOverflows(this, getFObj().getName(), ...);
} else {
    eventProducer.lineOverflows(this, curChildLM.getFObj().getName(), ...);
}

On the float re-layout pass (PageBreaker.handleFloatLayout), curChildLM is null. A line that overflows there,
beside a float wider than the measure, threw a NullPointerException, and the document failed instead of the
overflow being reported.

The change. Test curChildLM == null as well as getFObj() == null, so the overflow is reported against the
line manager's own FO, as it already is when the child has no FO. The code only reports; layout does not change.

Test. float_overflow_relayout.xml: a 480pt float in a 425pt region, then a block with an overflowing word.
It throws the NullPointerException without the change. With it, the fop-core suite passes, 3662 tests and 0
failures, and checkstyle reports 0 violations.

🤖 Generated with Claude Code

…ed, not a NullPointerException

LineLayoutManager.LineBreakingAlgorithm.updateData2 reported an overflowing line through
curChildLM.getFObj(). On the float re-layout pass (PageBreaker.handleFloatLayout) curChildLM is
null, so a line overflowing beside a float wider than the measure threw a NullPointerException and
the document failed. It is now reported against the line manager's own FO, as it already was when
the child had no FO. The code only reports; layout does not change.

Test: float_overflow_relayout.xml, which threw the NullPointerException before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant