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

Implementation for running a script from a URL in GroovyMain is flawed.

    Details

      Description

      There are two significant problems with the way handling of URLs as scripts are implemented in GroovyMain. I put them both here since I think any relevant changes will be done together.

      The first (and simplest to fix) is a buggy URL checker (GroovyMain.isScriptUrl(String urlOrFilename)) that has a hardcoded (and case-sensitive?) list of URI schemes that it tests for (http, https, file, and jar). This checking should be done by URI's parser and support any scheme that the platform implements.

      The second and more substantial issue is that when a script source is specified by URL a correct URL-based SourceUnit does not get used for compilation. Instead the text is simply grabbed from the URL and parsed as a string. This is inconsistent with the way URL-sourced code is handled everywhere else.

      This is loosely connected to the long-standing GROOVY-1642 issue and also needs fixing so that GROOVY-6451 can work as intended.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: