Bug 49636 - java.lang.ArrayIndexOutOfBoundsException in LineBreakUtils
Summary: java.lang.ArrayIndexOutOfBoundsException in LineBreakUtils
Status: CLOSED WORKSFORME
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: page-master/layout (show other bugs)
Version: all
Hardware: PC Windows NT
: P3 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on: 50471
Blocks:
  Show dependency tree
 
Reported: 2010-07-22 02:45 UTC by Radu Coravu
Modified: 2012-04-30 00:19 UTC (History)
2 users (show)



Attachments
Look in the FO file for the character entity ࢚ (9.58 KB, text/xml)
2012-04-09 06:06 UTC, Radu Coravu
Details
Added minimal FO file to reproduce the problem. (589 bytes, text/xml)
2012-04-09 12:45 UTC, Radu Coravu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Radu Coravu 2010-07-22 02:45:59 UTC
The FO file contains a \u089A character in the text following the XML tag:
<fo:basic-link external-destination="url(http://www.xml.com)">

FOP produces:
java.lang.ArrayIndexOutOfBoundsException: -1
	at org.apache.fop.text.linebreak.LineBreakUtils.getLineBreakPairProperty(LineBreakUtils.java:744)
	at org.apache.fop.text.linebreak.LineBreakStatus.nextChar(LineBreakStatus.java:178)
	at org.apache.fop.layoutmgr.inline.TextLayoutManager.getNextKnuthElements(TextLayoutManager.java:641)
	at org.apache.fop.layoutmgr.inline.InlineLayoutManager.getNextKnuthElements(InlineLayoutManager.java:310)
	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.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.list.ListItemLayoutManager.getNextKnuthElements(ListItemLayoutManager.java:235)
	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.list.ListBlockLayoutManager.getNextKnuthElements(ListBlockLayoutManager.java:120)
	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:692)
	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:337)
	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)
	at net.sf.saxon.event.ContentHandlerProxy.endElement(ContentHandlerProxy.java:401)
	at net.sf.saxon.event.NamespaceReducer.endElement(NamespaceReducer.java:213)
	at net.sf.saxon.event.ReceivingContentHandler.endElement(ReceivingContentHandler.java:447)
	at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
	at org.apache.xerces.xinclude.XIncludeHandler.endElement(XIncludeHandler.java:1045)
	at org.apache.xerces.impl.XMLNSDocumentScannerImplXerces.scanEndElement(XMLNSDocumentScannerImplXerces.java:673)
	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:355)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1645)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
	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.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
	at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:397)
	at net.sf.saxon.event.Sender.send(Sender.java:156)
	at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:32)
	at org.apache.fop.cli.InputHandlerFOP.transformTo(InputHandlerFOP.java:299)
	at org.apache.fop.cli.InputHandlerFOP.renderTo(InputHandlerFOP.java:130)
	at org.apache.fop.cli.Main.startFOP(Main.java:174)
	at org.apache.fop.cli.Main.main(Main.java:205)
Comment 1 rrotta 2011-11-18 14:42:14 UTC
There probably is a patch for this in #49636. I have the same problem and can't just improve the input. Would be nice to get just a warning similar to unresolved glyphs instead of an exception.
Comment 2 rrotta 2011-11-18 14:44:09 UTC
Sorry, I meant the patch for bug 41999
Comment 3 Glenn Adams 2012-04-07 01:43:53 UTC
resetting P2 open bugs to P3 pending further review
Comment 4 Glenn Adams 2012-04-07 19:20:48 UTC
please provide an input FO file for testing
Comment 5 Radu Coravu 2012-04-09 06:06:15 UTC
Created attachment 28559 [details]
Look in the FO file for the character entity &#x089A;

I added an example to reproduce the problem.
Comment 6 Glenn Adams 2012-04-09 07:16:31 UTC
(In reply to comment #5)
> Created attachment 28559 [details]
> Look in the FO file for the character entity &#x089A;
> 
> I added an example to reproduce the problem.

when you provide a test FO file, you need to make it the most minimal file that demonstrates the problem; much of your FO file is unrelated to the issue you are reporting; please trim it down to the minimum needed... also, please do not use any shortcut property, unless the shortcut property is the subject of the bug report
Comment 7 Radu Coravu 2012-04-09 12:45:26 UTC
Created attachment 28563 [details]
Added minimal FO file to reproduce the problem.
Comment 8 Glenn Adams 2012-04-09 14:59:09 UTC
(In reply to comment #7)
> Created attachment 28563 [details]
> Added minimal FO file to reproduce the problem.

thanks! have you tried this against the current trunk (1.1dev)? i am unable to reproduce the exception you report below; in fact, it works just fine, producing the following message:

     [java] Apr 9, 2012 8:56:23 AM org.apache.fop.events.LoggingEventListener processEvent
     [java] WARNING: Glyph "?" (0x89a) not available in font "Helvetica".
Comment 9 Radu Coravu 2012-04-10 06:03:59 UTC
Hi Glenn,

I tested with the latest nightly binary build of Apache Fop and indeed the issue does not appear anymore.
So you can probably consider it fixed.
Comment 10 Glenn Adams 2012-04-10 14:27:27 UTC
indicated problem is not reproducible in trunk, so moving to resolved

thanks radu
Comment 11 Dominik Stadler 2012-04-19 08:24:12 UTC
I think this was fixed via Bug 50471
Comment 12 Glenn Adams 2012-04-30 00:19:37 UTC
batch transition resolved+worksforme to closed+worksforme; if you believe this
remains a bug and can demonstrate it with appropriate input FO file and output
PDF file (as applicable), then you may reopen