-
Notifications
You must be signed in to change notification settings - Fork 41.6k
Description
I hope there are many places we can improve this. Let's start with a simple one.
ConfigDataProperties is a value object, and is constructed reflectively via Binder.bind() which is wasteful. As far as I can tell it is only ever used to look up the value of spring.config.import (the env var upper case version is never used because it would be bound already to the "initial" imports). And "import" doesn't have any kebab case variants, so you don't need a Binder. I think we can simply look in the Environment and if the property is there construct a ConfigDataProperties instance directly by calling the constructor or a factor method.
It also uses an annotation @Name to rename the property bound to its constructor, which also seems unnecessarily indirect (we control both the property name and the constructor source code). We probably can't get rid of the annotation processing if we need to use Binder.bind(), but if we can skip that then even better.