Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-6597

GroovyClassLoader.addClasspath should respect URI paths and not use URL.equals

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.9, 2.2.1
    • Fix Version/s: 2.3.0-beta-1
    • Component/s: None
    • Labels:
      None

      Description

      GroovyClassLoader.addClasspath has two kinds of problems with URLs.

      For one thing it uses URL.equals to avoid adding duplicate paths to the classpath. That is very bad since it is a blocking operation that performs domain name resolution.

      The second thing is that even though it is a URLClassLoader it doesn't add paths that are URIs/URLs as URLs but instead always makes a file: path.

      The solution for both is to use URI for making and comparing paths before adding them with addURL(URL).

        Attachments

          Activity

            People

            • Assignee:
              jimwhite James P. White
              Reporter:
              jimwhite James P. White
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: