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

Multiple Class fail to work with loadClass method in GCL

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0-JSR-6
    • groovy-jdk
    • None

    Description

      If you have multiple classes in a file like below:

      file: FileController.groovy
      -----------------------------
      class UploadCommand {
      @Property byte[] myFile
      }
      class FileController {
      @Property upload = {}
      }

      calling

      gcl.loadClass("FileController",true,false) loads the "UploadCommand" class. If you look at the loaded classes within the class loader the closures within the FileController class (like FileController$_closure1) are loaded but no the FileController. Is this a bug? Does loadClass not support multiple classes in a file?

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            graemerocher Graeme Rocher
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: