Brian Vella created CURATOR-509:
-----------------------------------

             Summary: Incompatible with Java 11
                 Key: CURATOR-509
                 URL: https://issues.apache.org/jira/browse/CURATOR-509
             Project: Apache Curator
          Issue Type: Bug
          Components: Apache
    Affects Versions: 4.1.0
         Environment: java 11.0.2 on windows and linux
            Reporter: Brian Vella


In java 11, this exception is thrown:
{quote}java.lang.IncompatibleClassChangeError: Inconsistent constant pool data 
in classfile for class org/apache/curator/framework/CuratorFramework. Method 
lambda$postSafeNotify$0(Ljava/lang/Object;)V at index 99 is CONSTANT_MethodRef 
and should be CONSTANT_InterfaceMethodRef

at 
org.apache.curator.framework.CuratorFramework.postSafeNotify(CuratorFramework.java:344)

at 
org.apache.curator.framework.recipes.locks.InterProcessSemaphoreV2$1.process(InterProcessSemaphoreV2.java:90)

at 
org.apache.curator.framework.imps.NamespaceWatcher.process(NamespaceWatcher.java:77)

at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:533)

at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:508)
{quote}
As I understood it, this is because there is a lambda in a default interface 
method and earlier versions of java 8 incorrectly compiled the method reference 
as a Method instead of an Interface method. Compiling with the latest java 8 
compiler (8.0.172) seems to correctly compile the classin a way that works in 
java 8 and 11 (did not verify 9 and 10 but I suspect they behave like 11)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to