[
https://issues.apache.org/jira/browse/CURATOR-509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16781863#comment-16781863
]
Brian Vella edited comment on CURATOR-509 at 3/1/19 4:53 PM:
-------------------------------------------------------------
Yes, it seems so. I diassembled the interface
org/apache/curator/framework/CuratorFramework from the 4.1.0 artifact in maven
central and from a local build of the same tag.
This is the line of interest from the maven central one (built with 1.8.0_101):
InvokeDynamic invokeStatic Method java/lang/invoke/LambdaMetafactory
metafactory
(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
MethodType ()V MethodHandle invokeStatic *Method*
org/apache/curator/framework/CuratorFramework lambda$postSafeNotify$0
(Ljava/lang/Object;)V MethodType ()V : run
(Ljava/lang/Object;)Ljava/lang/Runnable;
And the same line from the locally built one (built with 1.0.8_172):
InvokeDynamic invokeStatic Method java/lang/invoke/LambdaMetafactory
metafactory
(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
MethodType ()V MethodHandle invokeStatic *InterfaceMethod*
org/apache/curator/framework/CuratorFramework lambda$postSafeNotify$0
(Ljava/lang/Object;)V MethodType ()V : run
(Ljava/lang/Object;)Ljava/lang/Runnable;
Thus, the issue should be resolved if a new version is built with 1.0.8_172 or
later. Let me know if you require further information.
was (Author: brianvell):
Yes, it seems so. I diassembled the interface
org/apache/curator/framework/CuratorFramework from the 4.1.0 artifact in maven
central and from a local build of the same tag.
This is the line of interest from the maven central one (built with 1.8.0_101):
InvokeDynamic invokeStatic Method java/lang/invoke/LambdaMetafactory
metafactory
(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
MethodType ()V MethodHandle invokeStatic *Method*
org/apache/curator/framework/CuratorFramework lambda$postSafeNotify$0
(Ljava/lang/Object;)V MethodType ()V : run
(Ljava/lang/Object;)Ljava/lang/Runnable;
And the same line from the locally built one (built with 1.0.8_172):
InvokeDynamic invokeStatic Method java/lang/invoke/LambdaMetafactory
metafactory
(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
MethodType ()V MethodHandle invokeStatic *InterfaceMethod*
org/apache/curator/framework/CuratorFramework lambda$postSafeNotify$0
(Ljava/lang/Object;)V MethodType ()V : run
(Ljava/lang/Object;)Ljava/lang/Runnable;
Thus, the issue should be resolved if a new version is built with 1.0.8_172 and
pushed to maven central. Let me know if you require further information.
> 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
> Assignee: Jordan Zimmerman
> Priority: Major
> Fix For: 4.2.0
>
>
> 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)