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

Compilation issue in Groovy 4

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.0.18, 4.0.12
    • Compiler
    • None

    Description

      We migrate the application to Groovy 4 and got an issue:

      1) We use GroovyClassLoader to load *.groovy written classes to a classloader

      2) Before the migration we used Groovy 3.0.15.

      3) After the migration to 4.0.10 I've got the following error:

      Only classes and closures can be used for attribute 'value' in @org.openl.rules.ruleservice.core.annotations.ServiceExtraMethod
       @ line 18, column 30.
             @ServiceExtraMethod(value = org.openl.generated.services.ServiceExtraMethodHandler2Impl.class)
                                      ^ 

      4) If the annotation definition changed from @ServiceExtraMethod(value = org.openl.generated.services.ServiceExtraMethodHandler2Impl.class) to @ServiceExtraMethod(value = org.openl.generated.services.ServiceExtraMethodHandler2Impl) then the code is compiled successfully.

      Why does the compilation start to fail with .class? I can't reproduce the same issue on IntelliJ IDEA.

      Can you suggest what to try? Is it expected for Groovy to stop supporting .class in Groovy 4?

      Attachments

        1. groovy_bug.zip
          22 kB
          Marat Kamalov

        Issue Links

          Activity

            People

              emilles Eric Milles
              mkamalov Marat Kamalov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: