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

Some mistake #320

Closed
hjkyoyo opened this issue Nov 28, 2018 · 1 comment · Fixed by #661
Closed

Some mistake #320

hjkyoyo opened this issue Nov 28, 2018 · 1 comment · Fixed by #661

Comments

@hjkyoyo
Copy link

hjkyoyo commented Nov 28, 2018

https://github.com/mojohaus/versions-maven-plugin/blob/1afa5c3c0b5783a7fec30d204832712915317645/src/main/java/org/codehaus/mojo/versions/rewriting/ModifiedPomXMLEventReader.java#L457
It might be something wrong in this code:"int delta = replacement.length() - lastEnd - lastStart;", which result in an exception being thrown when call hasNext():
java.lang.StringIndexOutOfBoundsException: String index out of range: -1971
at java.lang.AbstractStringBuilder.charAt(AbstractStringBuilder.java:237)
at java.lang.StringBuilder.charAt(StringBuilder.java:76)
at org.codehaus.mojo.versions.rewriting.ModifiedPomXMLEventReader.c(ModifiedPomXMLEventReader.java:449)
at org.codehaus.mojo.versions.rewriting.ModifiedPomXMLEventReader.nextEndIncludesNextEvent(ModifiedPomXMLEventReader.java:438)
at org.codehaus.mojo.versions.rewriting.ModifiedPomXMLEventReader.hasNext(ModifiedPomXMLEventReader.java:380)
at org.codehaus.mojo.versions.api.PomHelper.excludeExpressionDependency(PomHelper.java:409)

It might be right as "int delta = replacement.length() - lastEnd + lastStart;". The same mistake is happened in line 558.

@github-actions github-actions bot added the Stale label Sep 29, 2021
@github-actions github-actions bot closed this as completed Oct 6, 2021
@slachiewicz slachiewicz removed the Stale label Oct 6, 2021
@slachiewicz slachiewicz reopened this Oct 6, 2021
@andrzejj0
Copy link
Contributor

Looking

andrzejj0 added a commit to andrzejj0/versions-maven-plugin that referenced this issue Aug 29, 2022
andrzejj0 added a commit to andrzejj0/versions-maven-plugin that referenced this issue Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants