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

CLONE - dash in script filename

    XMLWordPrintableJSON

Details

    Description

      Cannot create script with dash ("-") in filename.

      Please try to run the two attached groovy scripts. The one with an underscore in the filename runs happily (don't wonder, it gives no output). The one with a dash in the filename gives this error:

      $ groovy fibonacci-numbers.groovy
      Caught: java.lang.ClassFormatError: Illegal class name "fibonacci-numbers$fib" in class file fibonacci-numbers$fib
      java.lang.ClassFormatError: Illegal class name "fibonacci-numbers$fib" in class file fibonacci-numbers$fib
              at fibonacci-numbers.run(fibonacci-numbers.groovy:5)

      It really took me some time to figure out that the dash was causing this. I would like to see Groovy allowing dashes in script filenames. If that should be impossible, at least the error message should cleary indicate that I have used an illegal character in the script filename.

      Attachments

        1. fibonacci_numbers.groovy
          0.2 kB
          Christoph Grothaus
        2. fibonacci-numbers.groovy
          0.2 kB
          Christoph Grothaus

        Issue Links

          Activity

            People

              Unassigned Unassigned
              cgrothaus Christoph Grothaus
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: