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

Bean properties with Optional fields cannot be saved #51

Closed
ljacqu opened this issue Jan 14, 2018 · 0 comments
Closed

Bean properties with Optional fields cannot be saved #51

ljacqu opened this issue Jan 14, 2018 · 0 comments
Labels
Milestone

Comments

@ljacqu
Copy link
Member

ljacqu commented Jan 14, 2018

As detected while working on AuthMe/AuthMeReloaded#1035, yml files can be loaded just fine for a bean class with Optional properties, but writing it back is not possible:

ch.jalu.configme.beanmapper.ConfigMeMapperException: Class 'class java.util.Optional' has no writable properties

	at ch.jalu.configme.beanmapper.leafproperties.LeafPropertiesGenerator$EntryBuilder.collectPropertiesFromBean(LeafPropertiesGenerator.java:55)
	at ch.jalu.configme.beanmapper.leafproperties.LeafPropertiesGenerator$EntryBuilder.collectPropertyEntries(LeafPropertiesGenerator.java:88)
	at ch.jalu.configme.beanmapper.leafproperties.LeafPropertiesGenerator$EntryBuilder.collectPropertiesFromBean(LeafPropertiesGenerator.java:59)
	at ch.jalu.configme.beanmapper.leafproperties.LeafPropertiesGenerator$EntryBuilder.collectPropertyEntries(LeafPropertiesGenerator.java:88)
	at ch.jalu.configme.beanmapper.leafproperties.LeafPropertiesGenerator$EntryBuilder.collectPropertyEntries(LeafPropertiesGenerator.java:81)
	at ch.jalu.configme.beanmapper.leafproperties.LeafPropertiesGenerator$EntryBuilder.collectPropertiesFromBean(LeafPropertiesGenerator.java:59)
	at ch.jalu.configme.beanmapper.leafproperties.LeafPropertiesGenerator.generate(LeafPropertiesGenerator.java:32)
	at ch.jalu.configme.resource.YamlFileResource.convertPropertiesToExportableTypes(YamlFileResource.java:169)
	at ch.jalu.configme.resource.YamlFileResource.exportProperties(YamlFileResource.java:116)
	at ch.jalu.configme.SettingsManager.save(SettingsManager.java:143)
	at ch.jalu.configme.SettingsManager.validateAndLoadOptions(SettingsManager.java:153)
	at ch.jalu.configme.SettingsManager.<init>(SettingsManager.java:68)
	at ch.jalu.configme.SettingsManager.<init>(SettingsManager.java:53)
@ljacqu ljacqu added this to the 0.5 Release milestone Jan 14, 2018
ljacqu added a commit that referenced this issue Jan 14, 2018
- Also includes changes to visibility scope to facilitate extension
@ljacqu ljacqu added the bug label Jan 14, 2018
@ljacqu ljacqu modified the milestones: 0.5 Release, 0.4.1 Release Jan 14, 2018
@ljacqu ljacqu closed this as completed Jan 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant