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

CliBuilder#expandArgumentFiles throws StringIndexOutOfBoundsException on empty arguments

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.4
    • 1.8-rc-4, 1.7.11
    • None
    • None
    • Patch

    Description

      Pass a CliBuilder instance, in its default state with expandArugmentFiles = true, an argument array containing an empty argument ''.

      expected: the clibuilder to parse the arguments
      actual:

      java.lang.StringIndexOutOfBoundsException: String index out of range: 1
      	at java.lang.String.substring(String.java:1934)
              ....
      	at groovy.util.CliBuilder.expandArgumentFiles(CliBuilder.groovy:296)
              ....

      Attached is code showing how an argument array that parses when expandArgumentFiles is false, throws an exception when it is true.

      Attachments

        1. clibuilder.patch
          0.5 kB
          Jeffrey Adamson
        2. CliBuilderFail.groovy
          0.3 kB
          Jeffrey Adamson

        Activity

          People

            paulk Paul King
            jwadamson Jeffrey Adamson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: