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

JDK 17: class String1_groovyProxy cannot implement sealed interface java.lang.constant.ConstantDesc

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.9
    • 3.0.11
    • None
    • None

    Description

      Doing early testing of some Groovy applications on Java 17 (ea31), and I'm encountering some exceptions like the following in unit tests. I'm testing on the 3.0.9 branch since 3.0.8 can't compile many of our Groovy classes against Java 17.

      java.lang.IncompatibleClassChangeError: class String1_groovyProxy cannot implement sealed interface java.lang.constant.ConstantDesc
             java.base/java.lang.ClassLoader.defineClass1(Native Method)
             java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012)
             java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:874)
             org.codehaus.groovy.runtime.ProxyGeneratorAdapter$InnerLoader.defineClass(ProxyGeneratorAdapter.java:847)
             org.codehaus.groovy.runtime.ProxyGeneratorAdapter.<init>(ProxyGeneratorAdapter.java:192)
             groovy.util.ProxyGenerator.lambda$createAdapter$0(ProxyGenerator.java:234)
             org.apache.groovy.util.concurrent.concurrentlinkedhashmap.ConcurrentLinkedHashMap.lambda$compute$0(ConcurrentLinkedHashMap.java:788)
             java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
             org.apache.groovy.util.concurrent.concurrentlinkedhashmap.ConcurrentLinkedHashMap.compute(ConcurrentLinkedHashMap.java:800)
             org.apache.groovy.util.concurrent.concurrentlinkedhashmap.ConcurrentLinkedHashMap.computeIfAbsent(ConcurrentLinkedHashMap.java:777)
             org.codehaus.groovy.runtime.memoize.LRUCache.getAndPut(LRUCache.java:63)
             groovy.util.ProxyGenerator.createAdapter(ProxyGenerator.java:230)
             groovy.util.ProxyGenerator.instantiateDelegateWithBaseClass(ProxyGenerator.java:205)
             groovy.util.ProxyGenerator.instantiateDelegateWithBaseClass(ProxyGenerator.java:189)
             groovy.util.ProxyGenerator.instantiateDelegate(ProxyGenerator.java:181)
             groovy.util.ProxyGenerator.instantiateDelegate(ProxyGenerator.java:177)
             org.codehaus.groovy.runtime.DefaultGroovyMethods.asType(DefaultGroovyMethods.java:17910)
             org.codehaus.groovy.runtime.StringGroovyMethods.asType(StringGroovyMethods.java:208)
             org.codehaus.groovy.runtime.dgm$1158.doMethodInvoke(Unknown Source)
             groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1268)
      

      I haven't tried to create a simple reproducer, but am happy to try to do so if the problem isn't already known or obvious.

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              pburka Peter Burka
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: