Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexOutOfBoundsException in Tag mode #22

Closed
GoogleCodeExporter opened this issue Sep 21, 2015 · 5 comments
Closed

IndexOutOfBoundsException in Tag mode #22

GoogleCodeExporter opened this issue Sep 21, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
Run java -jar daisydiff.jar a.html b.html --type=tag

What is the expected output? What do you see instead?
The expected output is any result.

Instead there is an exception

..java.lang.IndexOutOfBoundsException: There is no Atom with index 3
        at org.outerj.daisy.diff.tag.TagComparator.getAtom(Unknown Source)
        at org.outerj.daisy.diff.tag.TagDiffer.preProcess(Unknown Source)
        at org.outerj.daisy.diff.tag.TagDiffer.diff(Unknown Source)
        at org.outerj.daisy.diff.DaisyDiff.diffTag(Unknown Source)
        at org.outerj.daisy.diff.Main.main(Unknown Source)


Applies in DaisyDiff 1.0 and 1.1. Also notice that if the order of the 
input files is reversed, there is NO exception. The files themselves are 
really simple.

Original issue reported on code.google.com by kkape...@gmail.com on 26 Mar 2010 at 2:56

Attachments:

@GoogleCodeExporter
Copy link
Author

What steps will reproduce the problem?
java -jar daisydiff.jar old.html new.html --type=tag

What is the expected output? What do you see instead?
..java.lang.IndexOutOfBoundsException: There is no Atom with index 12
    at org.outerj.daisy.diff.tag.TagComparator.getAtom(Unknown Source)
    at org.outerj.daisy.diff.tag.TagDiffer.preProcess(Unknown Source)
    at org.outerj.daisy.diff.tag.TagDiffer.diff(Unknown Source)
    at org.outerj.daisy.diff.DaisyDiff.diffTag(Unknown Source)
    at org.outerj.daisy.diff.Main.main(Unknown Source)

Original comment by be...@parkflyer.ru on 31 Aug 2011 at 7:20

Attachments:

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

Bug fix
TagDiffer.java
line 185

Old:
while ((leftComparator.getAtom(temp) instanceof DelimiterAtom || 
(bridgelength-- > 0))
                        && temp < differences[i + 1].leftStart()) {

                    temp++;
                }
New:

while (temp < differences[i + 1].leftStart() && (leftComparator.getAtom(temp) 
instanceof DelimiterAtom || (bridgelength-- > 0)) ) {

                    temp++;
                }

Original comment by be...@parkflyer.ru on 1 Sep 2011 at 9:03

@GoogleCodeExporter
Copy link
Author

Aha! Thanks for submitting this patch. If it is so simple and testcases finish 
successfully it will be committed to trunk.

Original comment by kkape...@gmail.com on 1 Sep 2011 at 5:24

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

Committed patch in subversion r171

Original comment by kkape...@gmail.com on 13 Sep 2011 at 9:57

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant