[ 
https://jira.codehaus.org/browse/MRELEASE-750?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Scholte closed MRELEASE-750.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.4
         Assignee: Robert Scholte

Fixed in [r1353035|http://svn.apache.org/viewvc?rev=1353035&view=rev]
I've been able reproduce the {{StringIndexOutOfBOundsException}} and it exposed 
another bug, which could solve a lot of other issues.
So I've been quite happy I did some investigation instead of going for the 
defensive strategy.
Main reason was a wrong calculation of the {{startIndex}} and {{endIndex}}.

                
> String index out of range: -1 in ReleaseUtils.loadResolvedDependencies() when 
> using Parent-Module-Layout
> --------------------------------------------------------------------------------------------------------
>
>                 Key: MRELEASE-750
>                 URL: https://jira.codehaus.org/browse/MRELEASE-750
>             Project: Maven 2.x Release Plugin
>          Issue Type: Bug
>          Components: prepare
>    Affects Versions: 2.3
>            Reporter: Thomas Baldauf
>            Assignee: Robert Scholte
>             Fix For: 2.4
>
>         Attachments: MNG-750-release.patch, ReleaseUtils.java
>
>
> [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-release-plugin:2.XXX:prepare (default-cli) on 
> project XXX: Execution default-cli of goal 
> org.apache.maven.plugins:maven-release-plugin:2.XXX:prepare failed: String 
> index out of range: -1 -> [Help 1]
> This is happening in 
> org.apache.maven.shared.release.config.ReleaseUtils.loadResolvedDependencies(..),
> line number 250:
>     artifactVersionlessKey = propertyName.substring( startIndex, endIndex );
> Apparently endIndex can be -1 under special circumstances. Defensive 
> programming fixes the problem.
> Proposed patch (see attachment):
>     if (endIndex > startIndex) {
>          artifactVersionlessKey = propertyName.substring( startIndex, 
> endIndex );
>     } else {
>          artifactVersionlessKey = propertyName.substring( startIndex );
>     }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to