Error when binding map in configuration properties if getter initialisation used.
I have detailed my problem and solution on stackoverflow, and will summarise here with more technical details about the root cause. http://stackoverflow.com/questions/36928559/null-pointer-when-creating-spring-boot-configurationproperties-mapstring-objec
Essentially if you have a Map<String, Object> in an @ConfigurationProperties file, initialising the map in the getter (eg using a ternary operator to initialise if null) causes binding to fail. Initialising the map in the constructor or as part of the field declaration fixes the issue.
The problem is that in AbstractNestablePropertyAccessor.setDefaultValue the default value is created correctly (line 1), but after the call to AbstractNestablePropertyAccessor.setPropertyValue (line 2) it has not been correctly persisted in the underlying object, so the call to AbstractNestablePropertyAccessor.getPropertyValue (line 3) returns null.
Thanks for the detailed analysis. This is a duplicate of #4650