SvnScmProviderRepository getParent() with endless loop
------------------------------------------------------
                 Key: SCM-478
                 URL: http://jira.codehaus.org/browse/SCM-478
             Project: Maven SCM
          Issue Type: Bug
          Components: maven-scm-provider-svn
    Affects Versions: 1.2
            Reporter: Florian Albrecht
            Priority: Minor


In SvnScmProviderRepository.getParent(), you find these lines:

...
while ( newUrl.endsWith( "/" ) )
{
  newUrl = newUrl.substring( 0, newUrl.length() );
}
...

I wanted to use that method in a project which actually HAS an scm URL set 
ending with "/trunk/". A call to this method on an SvnScmProviderRepository 
object created from that URL will never return. Note that s.substring(0, 
s.length()) will always return s, so in the code above, newUrl will not change.

The body of the loop must be

  newUrl = newUrl.substring(0, newUrl.length() - 1);

Workaround, of course, was to remove the ending slash from the SCM URL in the 
pom.xml. But this should not be a prerequisite for calling this method...


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to