You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Matthias Reischenbacher <ma...@gmx.at> on 2010/03/11 20:53:47 UTC
Use of soft hyphen causes IllegalArgumentException in some cases
Hi,
I think the changes introduced in FOP trunk by the patch of bugzilla
entry #48071 are causing an IllegalArgumentException in some cases.
Specifically the exception occurs when a soft hyphen character is used
and it is surrounded by white spaces. I know that this doesn't make much
sense because the white space would trigger a linebreak anyway but I
think it would be better to log a warn message instead of throwing the
exception.
Attached you'll find a sample fo file which reproduces the error.
Should I add a new bugzilla entry? Can anyone fix this please?
Regards,
Matthias Reischenbacher
The complete stacktrace:
java.lang.IllegalArgumentException: factor < 0; was: -1
at org.apache.fop.traits.MinOptMax.mult(MinOptMax.java:251)
at
org.apache.fop.layoutmgr.inline.TextLayoutManager.processWord(TextLayoutManager.java:825)
at
org.apache.fop.layoutmgr.inline.TextLayoutManager.getNextKnuthElements(TextLayoutManager.java:710)
at
org.apache.fop.layoutmgr.inline.LineLayoutManager.collectInlineKnuthElements(LineLayoutManager.java:639)
at
org.apache.fop.layoutmgr.inline.LineLayoutManager.getNextKnuthElements(LineLayoutManager.java:579)
at
org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextChildElements(BlockStackingLayoutManager.java:571)
at
org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextChildElements(BlockStackingLayoutManager.java:552)
at
org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements(BlockStackingLayoutManager.java:280)
at
org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:123)
at
org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:115)
at
org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextChildElements(BlockStackingLayoutManager.java:571)
at
org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextChildElements(BlockStackingLayoutManager.java:552)
at
org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements(BlockStackingLayoutManager.java:280)
at
org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:123)
at
org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:115)
at
org.apache.fop.layoutmgr.BlockContainerLayoutManager.getNextKnuthElements(BlockContainerLayoutManager.java:287)
at
org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextChildElements(BlockStackingLayoutManager.java:571)
at
org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextChildElements(BlockStackingLayoutManager.java:552)
at
org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements(BlockStackingLayoutManager.java:280)
at
org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:123)
at
org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:115)
at
org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextChildElements(BlockStackingLayoutManager.java:571)
at
org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextChildElements(BlockStackingLayoutManager.java:552)
at
org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements(BlockStackingLayoutManager.java:280)
at
org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:123)
at
org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:115)
at
org.apache.fop.layoutmgr.FlowLayoutManager.getNextChildElements(FlowLayoutManager.java:199)
at
org.apache.fop.layoutmgr.FlowLayoutManager.addChildElements(FlowLayoutManager.java:140)
at
org.apache.fop.layoutmgr.FlowLayoutManager.addChildElements(FlowLayoutManager.java:129)
at
org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:70)
at
org.apache.fop.layoutmgr.PageBreaker.getNextKnuthElements(PageBreaker.java:216)
at
org.apache.fop.layoutmgr.AbstractBreaker.getNextBlockList(AbstractBreaker.java:697)
at
org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:149)
at
org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:132)
at
org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:341)
at org.apache.fop.layoutmgr.PageBreaker.doLayout(PageBreaker.java:85)
at
org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:107)
at
org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:238)
at
org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:120)
at
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:349)
at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:177)
Re: Use of soft hyphen causes IllegalArgumentException in some cases
Posted by Pascal Sancho <pa...@takoma.fr>.
Hi Matthias,
If the exception occurs only when the patch is applied, you should add
any comment and/or testcase (as attachment) directly to the bug entry.
Pascal
Matthias Reischenbacher a écrit :
> Hi,
>
> I think the changes introduced in FOP trunk by the patch of bugzilla
> entry #48071 are causing an IllegalArgumentException in some cases.
> Specifically the exception occurs when a soft hyphen character is used
> and it is surrounded by white spaces. I know that this doesn't make much
> sense because the white space would trigger a linebreak anyway but I
> think it would be better to log a warn message instead of throwing the
> exception.
>
> Attached you'll find a sample fo file which reproduces the error.
>
> Should I add a new bugzilla entry? Can anyone fix this please?
>
> Regards,
> Matthias Reischenbacher
>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org