Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
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)