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

Fix replaceText IOOBE #690

Merged
merged 2 commits into from
Feb 23, 2018
Merged

Fix replaceText IOOBE #690

merged 2 commits into from
Feb 23, 2018

Conversation

Jugen
Copy link
Collaborator

@Jugen Jugen commented Feb 21, 2018

This is a fix for #689 ArrayIndexOutOfBoundsException in ParagraphText.getRangeShapeSafely after calling replaceText under certain conditions.

@JordanMartinez
Copy link
Contributor

Thanks for the PR!

@JordanMartinez
Copy link
Contributor

I looked through the Travis CI logs and came across these lines. Is it possible to get rid of them somehow? Or is that necessary in order to run the test due to the diaereses/umlauts and just an unfortunate issue on the Mac JDK?

Also, could the test work without such a long and verbose text that otherwise obscures the issue with a lot of noise? For example, you shared that you were able to reproduce the issue (though perhaps for different reasons) using the texts:

Text A: "1234567890\n\nabcdefghij\n\n1234567890\n\nabcdefghij"
Text B: "1234567890\n\nabcdefghijklmno\n\n1234567890\n\nabcde"

@Jugen
Copy link
Collaborator Author

Jugen commented Feb 23, 2018

Yeh, I noticed that in the Travis logs as well and unfortunately I don't know if it's possible to get rid of them. As you surmised, I believe it is necessary for the reasons you mention.

I created two tests, one using the long & verbose text and the other my shorter version - since there is a subtle difference to the way the IOOBE gets triggered in each. I had another look, doing a text comparison between the two long texts and have managed to reduce it down to a much shorter version with the same properties and results as before. :-)

@JordanMartinez
Copy link
Contributor

Ok. It is what it is. I'm going to merge #687 first and then I'd like to merge this one since it'll take me a lot more work to include this one in mine than to include mine in yours.

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

Successfully merging this pull request may close these issues.

2 participants