You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Dale Emery (Jira)" <ji...@apache.org> on 2022/03/30 16:36:00 UTC

[jira] [Resolved] (GEODE-10136) FunctionServiceBase tests fail because lambda classes have no canonical name on JDK 17

     [ https://issues.apache.org/jira/browse/GEODE-10136?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dale Emery resolved GEODE-10136.
--------------------------------
    Fix Version/s: 1.15.0
       Resolution: Fixed

> FunctionServiceBase tests fail because lambda classes have no canonical name on JDK 17
> --------------------------------------------------------------------------------------
>
>                 Key: GEODE-10136
>                 URL: https://issues.apache.org/jira/browse/GEODE-10136
>             Project: Geode
>          Issue Type: Improvement
>          Components: functions, tests
>    Affects Versions: 1.15.0
>            Reporter: Dale Emery
>            Assignee: Dale Emery
>            Priority: Major
>              Labels: Java17, pull-request-available
>             Fix For: 1.15.0
>
>
> {{FunctionServiceBase}} tests fail on JDK 17.
> Here are the relevant factors:
> - {{FunctionServiceBase}} uses lambda expressions to create the function objects used to test the function service.
> - The objects that represent these lambda expressions use the default implementation of all {{Function}} methods other than {{execute(FunctionContext)}}.
> - The default implementation of {{getId()}} returns the canonical name of the function object's class.
> - In JDK 17, the class of a lambda expression has no canonical name.
> - The product classes {{AbstractExecution}} and {{DistributedRegionFunctionExecutor}} both throw exceptions if the given function reports its ID as {{null}}.
> The tests can be fixed by replacing the lambda expressions with uses of a class that returns a non-{{null}} ID.
> This may be a product issue. Given that {{Function}} is explicitly annotated as a {{@FunctionalInterface}}:
> - It is clearly intended to be used with lambda expressions, yet on JDK 17 it cannot be used with lamda expressions.
> - It would be reasonable to expect that an anonymous class that extends `Function` could safely use the default implementation of {{getId()}}, yet anonymous classes have no canonical names on any JDK.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)