[daisy] [JIRA] Commented: (DSY-587) IndexOutOfBoundsException in
diff code
Guy Van den Broeck (JIRA)
issues at cocoondev.org
Mon Dec 3 09:21:50 CST 2007
[ http://issues.cocoondev.org//browse/DSY-587?page=comments#action_13476 ]
Guy Van den Broeck commented on DSY-587:
----------------------------------------
It should be fixed in r4565.
The problem was that the code that's supposed to calculate the last common parent of 2 nodes assumed that the argument nodes were any decendent of the BODY node but not the BODY node itself.
The second argument however is part of a minimal set of deleted nodes. In the test document, eveything is deleted. Hence the minimal set of deleted nodes consists of only the BODY node.
et voila
The fix enforces that the minimal set can never contain a BODY node.
> IndexOutOfBoundsException in diff code
> --------------------------------------
>
> Key: DSY-587
> URL: http://issues.cocoondev.org//browse/DSY-587
> Project: Daisy
> Type: Bug
> Components: Frontend (wiki)
> Versions: 2.1
> Reporter: Karel Vervaeke
> Priority: Minor
> Attachments: compare-bug.txt
>
> In some cases, when creating a diff report, the repository throws an exception (stacktrace at the bottom)
> Compare two documents with a html part. In the first version the html part contains formatted html (with newlines), in the second version
> it does not contain newlines (this can not be done via the wiki because the html cleaner adds newlines).
> For quickly repoducing it, create two versions of a SimpleDocumentPart. Go to the blobstore and edit the blob of the second version so it contains
> "<html><body>hello</body></html>" (no whitespace between tags). Then go to http://.../daisy/site/[your document]/version/1/diff?otherVersion=2
> (A patch for exposing the bug will be attached; after applying it, go to services/diff and run "maven test")
> Message: Index: 1, Size: 1
> Class: java.lang.IndexOutOfBoundsException
> Stacktrace:
> ATTENTION: this is the stacktrace of an exception that happened on the repository server.
> java.util.ArrayList.RangeCheck (ArrayList.java:546)
> java.util.ArrayList.get (ArrayList.java:321)
> org.outerj.daisy.diff.html.dom.Node.getLastCommonParent (Node.java:86)
> org.outerj.daisy.diff.html.TextNodeComparator.markAsDeleted (TextNodeComparator.java:244)
> org.outerj.daisy.diff.html.HTMLDiffer.diff (HTMLDiffer.java:61)
> org.outerj.daisy.diff.Diff.diffHTML (Diff.java:63)
> org.outerj.daisy.publisher.serverimpl.XmlDocDiffOutput.partUpdated (XmlDocDiffOutput.java:183)
> org.outerj.daisy.docdiff.DiffGenerator.generatePartDifferences (DiffGenerator.java:132)
> org.outerj.daisy.docdiff.DiffGenerator.generateDiff (DiffGenerator.java:52)
> org.outerj.daisy.docdiff.DiffGenerator.generateDiff (DiffGenerator.java:36)
> org.outerj.daisy.publisher.serverimpl.requestmodel.DiffRequest.processInt (DiffRequest.java:79)
> org.outerj.daisy.publisher.serverimpl.requestmodel.AbstractRequest.process (AbstractRequest.java:34)
> org.outerj.daisy.publisher.serverimpl.requestmodel.AbstractParentPublisherRequest.processInt (AbstractParentPublisherRequest.java:36)
> org.outerj.daisy.publisher.serverimpl.requestmodel.DocumentRequest.emitDocument (DocumentRequest.java:100)
> org.outerj.daisy.publisher.serverimpl.requestmodel.DocumentRequest.processInt (DocumentRequest.java:81)
> org.outerj.daisy.publisher.serverimpl.requestmodel.AbstractRequest.process (AbstractRequest.java:34)
> org.outerj.daisy.publisher.serverimpl.requestmodel.AbstractParentPublisherRequest.processInt (AbstractParentPublisherRequest.java:36)
> org.outerj.daisy.publisher.serverimpl.requestmodel.PublisherRequest.processInt (PublisherRequest.java:62)
> org.outerj.daisy.publisher.serverimpl.requestmodel.AbstractRequest.process (AbstractRequest.java:34)
> org.outerj.daisy.publisher.serverimpl.PublisherImpl.executePublisherRequest (PublisherImpl.java:110)
> org.outerj.daisy.publisher.serverimpl.PublisherImpl.processRequest (PublisherImpl.java:80)
> org.outerj.daisy.publisher.serverimpl.httphandlers.PubRequestHandler.handleRequest (PubRequestHandler.java:41)
> org.outerj.daisy.httpconnector.HttpConnector$PathHandler.handle (HttpConnector.java:338)
> org.outerj.daisy.httpconnector.HttpConnector$DaisyServlet.service (HttpConnector.java:282)
> javax.servlet.http.HttpServlet.service (HttpServlet.java:802)
> org.mortbay.jetty.servlet.ServletHolder.handle (ServletHolder.java:487)
> org.mortbay.jetty.servlet.ServletHandler.handle (ServletHandler.java:367)
> org.mortbay.jetty.security.SecurityHandler.handle (SecurityHandler.java:216)
> org.mortbay.jetty.handler.ContextHandler.handle (ContextHandler.java:712)
> org.mortbay.jetty.handler.HandlerWrapper.handle (HandlerWrapper.java:139)
> org.mortbay.jetty.Server.handle (Server.java:285)
> org.mortbay.jetty.HttpConnection.handleRequest (HttpConnection.java:502)
> org.mortbay.jetty.HttpConnection$RequestHandler.content (HttpConnection.java:835)
> org.mortbay.jetty.HttpParser.parseNext (HttpParser.java:641)
> org.mortbay.jetty.HttpParser.parseAvailable (HttpParser.java:208)
> org.mortbay.jetty.HttpConnection.handle (HttpConnection.java:378)
> org.mortbay.io.nio.SelectChannelEndPoint.run (SelectChannelEndPoint.java:368)
> org.mortbay.thread.BoundedThreadPool$PoolThread.run (BoundedThreadPool.java:442)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.cocoondev.org//secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
More information about the daisy
mailing list