Skip to content

Add support for records in BindingReflectionHintsRegistrar #28721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mhalbritter opened this issue Jun 28, 2022 · 0 comments
Closed

Add support for records in BindingReflectionHintsRegistrar #28721

mhalbritter opened this issue Jun 28, 2022 · 0 comments
Assignees
Labels
theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Milestone

Comments

@mhalbritter
Copy link
Contributor

mhalbritter commented Jun 28, 2022

Using BindingReflectionHintsRegistrar with records lead to this Jackson exception on native image runtime:

Exception in thread "main" com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Failed to access RecordComponents of type `nativeplayground.R`
        at com.fasterxml.jackson.databind.SerializerProvider.reportBadDefinition(SerializerProvider.java:1300)
        at com.fasterxml.jackson.databind.SerializerProvider._createAndCacheUntypedSerializer(SerializerProvider.java:1447)
        at com.fasterxml.jackson.databind.SerializerProvider.findValueSerializer(SerializerProvider.java:544)
        at com.fasterxml.jackson.databind.SerializerProvider.findTypedValueSerializer(SerializerProvider.java:822)
        at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:308)
        at com.fasterxml.jackson.databind.ObjectMapper._writeValueAndClose(ObjectMapper.java:4568)
        at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:3821)
        at nativeplayground.SerializeMain.main(SerializeMain.java:14)

For records, there has to be this in the reflect-config.json:

  {
    "name": "nativeplayground.R",
    "allDeclaredMethods": true
  }

It would be nice if BindingReflectionHintsRegistrar would support records.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jun 28, 2022
@sdeleuze sdeleuze self-assigned this Jun 28, 2022
@sdeleuze sdeleuze added type: enhancement A general enhancement theme: aot An issue related to Ahead-of-time processing and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jun 28, 2022
@sdeleuze sdeleuze added this to the 6.0.0-M5 milestone Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants