Skip to content
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

Build time initialize DiscriminatorValueKind inner enum #986

Closed
wants to merge 1 commit into from

Conversation

andriy-dmytruk
Copy link
Contributor

Since DiscriminatorValueKind enum is used as annotation value, the class needs to be build-time initialized.

Since DiscriminatorValueKind enum is used as annotation value, the class needs to be build-time initialized.
@dstepanov
Copy link
Contributor

We not storing enums in the metadata anymore. Were do you see it?

@andriy-dmytruk
Copy link
Contributor Author

andriy-dmytruk commented Dec 3, 2024

We not storing enums in the metadata anymore. Were do you see it?

I see this:

The following detailed trace displays from which field in the code the object was reached.
Object was reached by
  indexing into array java.lang.Object[]@73ee4e61: [Ljava.lang.Object;@73ee4e61 at index 5
  reading field java.util.ImmutableCollections$MapN.table of constant 
    java.util.ImmutableCollections$MapN@4866fd5f: {dp=@class, dv=CLASS_NAME, dt=PROPERTY, discriminatorVisible=false}
  indexing into array java.lang.Object[]@64f19602: [Ljava.lang.Object;@64f19602 at index 7
  reading field java.util.ImmutableCollections$MapN.table of constant 
    java.util.ImmutableCollections$MapN@50379878: {com.fasterxml.jackson.annotation.JsonRootName={value=dataCenterInfo}, io.micron...
  reading field io.micronaut.inject.annotation.DefaultAnnotationMetadata.allAnnotations of constant 
    io.micronaut.inject.annotation.DefaultAnnotationMetadata@635b6c9c: io.micronaut.inject.annotation.DefaultAnnotationMetadata@635b6c9c
  scanning root io.micronaut.inject.annotation.DefaultAnnotationMetadata@635b6c9c: io.micronaut.inject.annotation.DefaultAnnotationMetadata@635b6c9c embedded in
    io.micronaut.discovery.eureka.client.v2.$DataCenterInfo$Introspection.<init>(Unknown Source)
  parsing method io.micronaut.discovery.eureka.client.v2.$DataCenterInfo$Introspection.<init>(Unknown Source) reachable via the parsing context <no parsing context available> 

It has "io.micronaut.serde.config.annotation.SerdeConfig$SerSubtyped", Map.of("discriminatorVisible", false, "dp", "@class", "dt", "PROPERTY", "dv", DiscriminatorValueKind.CLASS_NAME)) in the micronaut-discovery-client:4.4.0

@dstepanov
Copy link
Contributor

I don't think that version has the fix.
micronaut-projects/micronaut-core#11160

@andriy-dmytruk
Copy link
Contributor Author

Yes, you are right. The fix is only in 4.6.5 while that version uses 4.6.1. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants