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

Unexpected class duplication in linux

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 4.0.0-rc-1
    • None
    • GroovyScriptEngine
    • None

    Description

      Hello, 

      I am not entirely sure on the technical issues behind this problem, they seem to stem deep into the platform dependent components of the classloader. 

      On windows, when loading a class both from within groovy and from the java side through the GroovyClassLoader, the returned class is the same class, and can be checked with a simple equality check. But when the same code is run on linux, the two classes returned are different classes. Even running an `isAssignableForm` will fail between the two. 

      I have only seen the behavior on classes referenced by annotations so far.

      It is difficult to describe the complex load behavior that replicates the issue, as such I have built a simple example instead. Please see the attached example project. It has prebuilt run configurations for IDEA that utilize WSL for testing the linux side of the issue. 

      This issue is new to groovy 4, and did not exist in groovy 3. I am testing using JDK 17 from adoptium. 

       

      Please let me know if any other additional information would be useful.

       

      Thank you,

      Trevor Flynn

      Attachments

        1. GroovyTest.zip
          103 kB
          Trevor Flynn

        Activity

          People

            Unassigned Unassigned
            tlf30 Trevor Flynn
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: