Skip to content

[Feature Request] Add support for Java record types to PropertyDataFetcher #2991

Closed

Description

@jvdsandt

Java record types have private fields and public getter methods for these fields. But these getter methods don't have a "get" prefix. Currently the implementation of PropertyFetchingImpl.getPropertyViaGetterMethod does not find these getter methods so Java record types cannot be used as a source.

Can support for Java record type getters be added to PropertyFetchingImpl.getPropertyViaGetterMethod ?

Activity

  1. added this to the 20.0 milestone on Oct 24, 2022
  2. bbakerman commented on Oct 24, 2022

    @bbakerman
    Member

    I concur - we should have this. The trick will be

    • how do we know its a record?
    • we run on Java 8 - how can code on Java 8 know its a record
    • is it just naming?

    But in general, problems aside, we should have this!

  3. jord1e commented on Oct 26, 2022

    @jord1e
    Contributor

    I already implemented this, it was closed

    #2793

    The PR to add testing support for this has been open for a while:

    #2789

  4. bbakerman commented on Oct 27, 2022

    @bbakerman
    Member

    Yeah we haven't invested time in your multi JVM approach. Our apologies - we appreciate your efforts but we just have prioritized thi work.

    As for your fix - I kinda like it better than mine but mine allows for non Record based naming as well

    public class Batman {
       public String name() {
         return "batman";
      }
    }
    

    as well as records

    public record Batman(String name) {}
    

    Since both work - I think we will stick with this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions