RFR: 8282080: Lambda deserialization fails for Object method references on interfaces [v2]

Jan Lahoda jlahoda at openjdk.java.net
Thu Apr 28 18:36:51 UTC 2022


On Thu, 28 Apr 2022 10:33:52 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Avoiding a use of a new flag to determine Object methods copied to interfaces.
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java line 758:
> 
>> 756:         String functionalInterfaceMethodName = samSym.getSimpleName().toString();
>> 757:         String functionalInterfaceMethodSignature = typeSig(types.erasure(samSym.type));
>> 758:         if ((refSym.flags_field & OBJECT_METHOD_IN_INTERFACE) != 0) {
> 
> Instead of using a new flag, can we use the base symbol and check if its owner is Object?

Thanks for the comment. Yes, that is possible:
https://github.com/openjdk/jdk/pull/8054/commits/7bf7fedbf122717bdcc13d5ec4fc821590b8e82a

-------------

PR: https://git.openjdk.java.net/jdk/pull/8054


More information about the compiler-dev mailing list