Bug 38263 - NullPointerException at LineLayoutManager.findHyphenationPoints
Summary: NullPointerException at LineLayoutManager.findHyphenationPoints
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: general (show other bugs)
Version: 0.90
Hardware: Other Windows 2000
: P2 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-13 18:29 UTC by Franck Schmidlin
Modified: 2012-04-01 06:47 UTC (History)
0 users



Attachments
FO sample that reproduce the NullPointer exception (3.91 KB, text/xml)
2006-01-13 18:31 UTC, Franck Schmidlin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Franck Schmidlin 2006-01-13 18:29:49 UTC
in the source for 0.90 alpha 1:

org.apache.fop.layoutmgr.inline.LineLayoutManager line 1481 reads

 currLM.getWordChars(sbChars, firstElement.getPosition());

This causes a NullPointer exception because currLM never gets a chance to be 
initialised. 

line 1466 reads 

if (firstElement.getLayoutManager() != currLM)

If currLM is still null, and firstElement.getLayoutManager() is also null, then 
currLM will not be initialised by the content of the if statement.

A quick fix seems to be replacing

- if (firstElement.getLayoutManager() != currLM)

with 

+ if (currLM == null || firstElement.getLayoutManager() != currLM)

This has cured the problem with my test.

I attach the FO file that reproduce the problem.
It could be that the syntax I used is not correct, in which case I would 
appreciate comments on how to do it bettwe.
Comment 1 Franck Schmidlin 2006-01-13 18:31:54 UTC
Created attachment 17418 [details]
FO sample that reproduce the NullPointer exception
Comment 2 Simon Pepping 2006-01-13 21:16:41 UTC
The NPE is indeed thrown in version 0.90alpha1. The problem is no longer present
in the latest release, version 0.91beta.
Comment 3 Glenn Adams 2012-04-01 06:47:51 UTC
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed