You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2022/05/22 15:56:00 UTC

[jira] [Updated] (GROOVY-7670) CLONE - dash in script filename

     [ https://issues.apache.org/jira/browse/GROOVY-7670?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Milles updated GROOVY-7670:
--------------------------------
    Labels: ClassFormatError  (was: )

> CLONE - dash in script filename
> -------------------------------
>
>                 Key: GROOVY-7670
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7670
>             Project: Groovy
>          Issue Type: Bug
>          Components: class generator
>    Affects Versions: 2.4.5
>         Environment: Oracle Java 8, Windows (although OS is not relevant IMHO)
>            Reporter: Christoph Grothaus
>            Priority: Minor
>              Labels: ClassFormatError
>         Attachments: fibonacci-numbers.groovy, fibonacci_numbers.groovy
>
>
> 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: {noformat}$ 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){noformat}
> 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.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)