Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

Refine HateoasHints to generate a more focused reflection configuration #1340

Closed
sdeleuze opened this issue Dec 5, 2021 · 0 comments · Fixed by #1348
Closed

Refine HateoasHints to generate a more focused reflection configuration #1340

sdeleuze opened this issue Dec 5, 2021 · 0 comments · Fixed by #1348
Assignees
Labels
type: bug A general bug
Milestone

Comments

@sdeleuze
Copy link
Contributor

sdeleuze commented Dec 5, 2021

The analysis that has ended up in creating this issue started from a com.oracle.graal.pointsto.util.AnalysisError: guarantee failed error on https://github.com/odrotbohm/spring-restbucks, which has shown that the reflect-config.json entry responsible for this error was:

{
    "name": "java.lang.Class",
    "allDeclaredFields": true,
    "allDeclaredConstructors": true,
    "allPublicConstructors": true,
    "allDeclaredMethods": true,
    "allPublicMethods": true,
    "allDeclaredClasses": true
}

After a deeper look, it appears that HateoasHints is generating far too much reflection entries via (at least) HateoasHints#computeRepresentationModels and HateoasHints#computeAtConfigurationClasses.

HateoasHints#computeRepresentationModels should probably be refined in order to at least filter out java.* types or to only create a { "name": "java.lang.Class" } without all the other flags.

HateoasHints#computeAtConfigurationClasses is suspicious, do we really need such inference with the new AOT engine? It should IMO be removed or restricted to a much more limited set of types.

Last point (but likely first one to implement), it would be great to be able to reproduce this issue on the hateoas sample, if that can help one of the guilty classes seems to be javax.money.CurrencyUnit which trigger the analysis of javax.money.AbstractContextBuilder which ends up with the problematic java.lang.Class entry.

@sdeleuze sdeleuze added the type: bug A general bug label Dec 5, 2021
@sdeleuze sdeleuze added this to the 0.11.0 milestone Dec 5, 2021
@christophstrobl christophstrobl linked a pull request Dec 6, 2021 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug A general bug
Development

Successfully merging a pull request may close this issue.

2 participants