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

ClassCastException caused by startGroovy script

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.1-rc-3
    • None
    • None

    Description

      If I create a file RootLoaderHelper.groovy containing this:

      class RootLoaderHelper {
      RootLoaderHelper()

      { getClass().classLoader.rootLoader }

      }

      run "groovyc RootLoaderHelper.groovy," then create RootLoaderTest.groovy:

      class RootLoaderTest extends GroovyTestCase {
      void testRootLoader()

      { new RootLoaderHelper() }

      }

      and run "groovy RootLoaderHelper.groovy," I get:

      java.lang.ClassCastException: gjdk.org.codehaus.groovy.tools.RootLoader_GroovyReflector cannot be cast to org.codehaus.groovy.runtime.Reflector

      This works fine if:

      • You don't groovyc the helper class
      • You use the ant JUnit task to execute the test case, after you've groovyc'd both files.

      Attachments

        Issue Links

          Activity

            People

              blackdrag Jochen Theodorou
              mcspanky Martin C. Martin
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: