Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Duplicate
-
2.4.5
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
Attachments
Issue Links
- duplicates
-
GROOVY-4020 ClassFormatError when using the name including "-" sign
- Closed
- is a clone of
-
GROOVY-5760 CLONE - dash in script filename
- Closed