1.2.0: Promotion of 1.2.0-RC1 to Full Release
1.2.0-RC1 has been released for one month now, and before it, 1.2.0-M2 had been released with very few differences. Time has passed and projects have upgraded successfully to 1.2.0-RC1. With this release, the new APIs tested in the past months become considered fully stabilized.
The below lists catalog all cumulative changes since 1.1.x. This is the same changelog as for RC1, with the exception of dbaa4de, a minor bugfix, being the only difference between 1.2.0 and 1.2.0-RC1.
Additions:
- Hocon format support:
- Use
HoconConfigurationFactory.create
- Use the artifact
dazzleconf-ext-hocon
- Depends on lightbend/config
- Use
- Better comment support for SnakeYaml. There are now 3 comment modes you can use:
- CommentMode.headerOnly - existing default behavior. Only writes the comment header.
- CommentMode.alternativeWriter - existing optional behavior formerly provided by
useCommentingWriter(true)
. This used to be the only way to write comments with snakeyaml. - CommentMode.fullComments - the most interesting. It uses SnakeYaml 1.28's new capability of writing comments. If you want to use this mode, you need to use SnakeYaml 1.28 or later.
- Allow complex default objects via
@DefaultObject
. For example, if you had a Map<String, YourCustomType> in your config, it was not possible in 1.1.x to provide a default value without this feature. @SubSection
has been greatly improved and is complimented by features of@DefaultObject
:@SubSection
can now be used on Map values and Collection elements.- When implementing a
@DefaultObject
method for a config entry returning aMap<String, @SubSection MySection>
orCollection<@SubSection MySection>
, you can optionally declare a single parameter which is the default value of the section. - Here is an example show-casing these features:
@DefaultObject("sectionsSetDefaults")
Set<@SubSection MySection> sectionsSet();
static Set<@SubSection MySection> sectionsSetDefaults(MySection defaultMySection /* optional param */) {
return Set.of(defaultMySection);
}
Changes:
- Some error messages have been improved.
- Access checking is better pre-empted when using JPMS.
- For GsonConfigurationFactory, html escaping is now disabled in the Gson instance by default (this change is fully compatible with existing configurations).
Fixes:
- Static methods in config interfaces are allowed.
- Document that no non-deprecated API methods exist which return null
- Clarify that builder.build() methods are free of side-effects
Migration from 1.1.x - Deprecations:
- The SnakeYamlConfigurationFactory and GsonConfigurationFactory constructors have been deprecated. Use the static
create
methods for new code. SnakeYamlOptions#useCommentingWriter
has been deprecated. Use#commentMode
withCommentMode.alternateWriter
instead.- AbstractConfigurationFactory and BaseConfigurationFactory are deprecated. Relevant for anyone who wrote their own format support.
ConfigurationOptions#getSorter
andValueSerialiserMap#getSerialiser
, which returned null, have been deprecated in favor of #getConfigurationSorter and #getSerialiserFor, which return Optional
Migration from 1.2.0-M1:
SnakeYamlOptions#commentFormat
has been removed. Use the #commentMode method instead.
Migration from 1.2.0-SNAPSHOT:
- See release notes for 1.2.0-M1