-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Allow binding to collections when a boolean 'is' method also exists #23007
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
Comments
I can also reproduce with Spring Boot 2.2.5.RELEASE |
It's hard to say exactly what's going on, but having a If that doesn't fix it, please could you provide a small sample application that we can run so that we can debug the problem. |
Changing to Basically I have 3 different external.resource definitions (jdbc, http, file). Each of this resources is a List[POJO]. When I run the program I only get external.resource.file[xx] parsed. If I remove external.resource.file[xx] from application.properties, then once in a while jdbc[xx] and/or http[xx] gets parsed. Does Spring Boot support multiple List[POJO] in the same @ConfigurationProperties->prefix? |
I've been able to reproduce the issue with your code. For example, you have a method named |
Thanks @jnizet, that is indeed the problem. The combination of We had a similar issue in the past with setters (see #16206). I'm going to make this one an enhancement to see if we can provide a better error. |
By changing to boolean hasXxx() fixed the problem. |
@DMarkD, we'd like to enhance the error message as Phil indicated above, please don't close the issue. |
I've tweaked the logic so that a get/is combo favors the get. This aligns well with the existing logic we added for #16206. |
Uh oh!
There was an error while loading. Please reload this page.
Java 11.02
Spring Boot 2.3.3.RELEASE
I am having problem with application.properties file.
application.properties sometimes doesn't gets parsed when using Configuration List POJO. It seams to be some type of race condition. Not all the elements of list are parsed. The more fields I have in POJO the most likely it fail to parse application.properties. Most of the fields are String datatype in POJO
POJO:
Configuration:
Controller
application.properties
The text was updated successfully, but these errors were encountered: