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

During annotation processing, check that property types declared in additional-spring-configuration-metadata.json can be loaded #24852

Open
wilkinsona opened this issue Jan 15, 2021 · 3 comments
Labels
type: enhancement A general enhancement
Milestone

Comments

@wilkinsona
Copy link
Member

It would be nice if the annotation processor had caught the problem fixed by #24851. Perhaps it could check that the types can be loaded when merging in the additional metadata.

@dreis2211
Copy link
Contributor

dreis2211 commented Jan 15, 2021

I guess it will always choke up on the following:

    {
      "name": "spring.flyway.error-handlers",
      "type": "org.flywaydb.core.api.errorhandler.ErrorHandler[]",
      "deprecation": {
        "level": "error",
        "reason": "Flyway pro edition only."
      }
    },

This particular property was deprecated in 2.1.0 I think, so one could argue that this could be removed (or don't we do that at all?). Alternatively, the potential check could only cover non-deprecated stuff. I wanted to get it out of my head, because I saw that one as well after fixing my issue ;-)

EDIT: Another idea I had was to only limit the type check to java.* as those types should be available.

@wilkinsona
Copy link
Member Author

wilkinsona commented Jan 15, 2021

I had a feeling we might hit a few problems like that. I'm not sure how best to handle them. Both your ideas are worth exploring. Thanks for those. Another might be to provide support for an allowlist that can be configured with any types that are known to be good but aren't on the classpath. Annotation processors aren't particularly easy to configure, though.

@snicoll
Copy link
Member

snicoll commented Jan 15, 2021

Checking for java.* would be better than nothing although doing it for only a sub-set of the available types feels a bit odd.

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

No branches or pull requests

4 participants