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

Unable to new arbitary script name for in BSFManager#exec()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.0-beta-4
    • 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)

      Attachments

        1. g2.diff
          0.9 kB
          Peter Reilly
        2. GroovyEngine.diff
          2 kB
          Peter Reilly
        3. GroovyEngine.diff
          1 kB
          Peter Reilly

        Activity

          People

            Unassigned Unassigned
            peter.reilly@corvil.com Peter Reilly
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: