You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BindMethod.findBindConstructor(TestProperties.class) will return null as it does not test the fact @ConstructorBinding is specified at class level. However, BindMethod.forClass(type) will work as it has the extra assertion.
The current code arrangement feels a bit weird considering we have a dedicated method to retrieve the relevant constructor and that returns null whereas it shouldn't.
The text was updated successfully, but these errors were encountered:
An additional note that the binder takes any constructor when built in such a mode (i.e. I don't see an immediate check that only one relevant constructor is present).
Something else that I find a bit odd is that that check detects the Constructor to use but doesn't seem to store that anywhere. I think it would be worthwhile to store the result of the search so that the binder can call exactly what was detected.
At this point, I don't understand why we store a Predicate<Constructor<?>> rather than the Constructor<?> to use effectively as this information is statically defined and we have access to that.
I think this can be refactored as part of #18670. There are a few bugs covered by these tests which might involve touching a lot of that code. We can leave the issue open so that we don't forget about it. Assigning myself to avoid any duplication of effort.
Uh oh!
There was an error while loading. Please reload this page.
Consider the following:
And the current code:
spring-boot/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBean.java
Lines 247 to 248 in d254c62
BindMethod.findBindConstructor(TestProperties.class)
will returnnull
as it does not test the fact@ConstructorBinding
is specified at class level. However,BindMethod.forClass(type)
will work as it has the extra assertion.The current code arrangement feels a bit weird considering we have a dedicated method to retrieve the relevant constructor and that returns
null
whereas it shouldn't.The text was updated successfully, but these errors were encountered: