Uploaded image for project: 'Maven SCM'
  1. Maven SCM
  2. SCM-478

SvnScmProviderRepository getParent() with endless loop

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.2
    • 1.7
    • maven-scm-provider-svn
    • None

    Description

      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...

      Attachments

        Activity

          People

            rfscholte Robert Scholte
            falbrecht Florian Albrecht
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: