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 16:10:00 UTC

[jira] [Updated] (GROOVY-195) Unable to new arbitary script name for in BSFManager#exec()

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

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

> Unable to new arbitary script name for in BSFManager#exec()
> -----------------------------------------------------------
>
>                 Key: GROOVY-195
>                 URL: https://issues.apache.org/jira/browse/GROOVY-195
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Peter Reilly
>            Priority: Minor
>              Labels: ClassFormatError
>             Fix For: 1.0-beta-4
>
>         Attachments: GroovyEngine.diff, GroovyEngine.diff, g2.diff
>
>
> When intergrating groovy with ant's script task I found that I needed
> to change the name of the script to make it a valid java class name.
> Attaching a cvs patch to the BsfTest to show the problem - output is
> Testcase: testBracketName took 0.023 sec
> 	Caused an ERROR
> Illegal class name "Test1<groovy>"
> java.lang.ClassFormatError: Illegal class name "Test1<groovy>"
> 	at java.lang.ClassLoader.defineClass1(Native Method)
> 	at java.lang.ClassLoader.defineClass(ClassLoader.java:604)
> 	at java.lang.ClassLoader.defineClass(ClassLoader.java:448)
> 	at groovy.lang.GroovyClassLoader.access$200(GroovyClassLoader.java:60)
> 	at groovy.lang.GroovyClassLoader$ClassCollector.onClassNode(GroovyClassLoader.java:175)
> 	at groovy.lang.GroovyClassLoader$ClassCollector.onClass(GroovyClassLoader.java:185)
> 	at org.codehaus.groovy.classgen.CompilerFacade.generateClass(CompilerFacade.java:124)
> 	at org.codehaus.groovy.classgen.CompilerFacade.parseClass(CompilerFacade.java:151)
> 	at org.codehaus.groovy.classgen.CompilerFacade.parseClass(CompilerFacade.java:84)
> 	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:140)
> 	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:255)
> 	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:217)
> 	at org.codehaus.groovy.bsf.GroovyEngine.exec(GroovyEngine.java:132)
> 	at org.apache.bsf.BSFManager$6.run(Unknown Source)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at org.apache.bsf.BSFManager.exec(Unknown Source)
> 	at org.codehaus.groovy.bsf.BSFTest.testBracketName(BSFTest.java:81)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)



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