Bump client springboot version#4189
Conversation
bd3a5de to
54291cc
Compare
4658097 to
7678c09
Compare
| StrictMapAppenderConstructor constructor = new StrictMapAppenderConstructor(); | ||
| Representer representer = new Representer(); | ||
| DumperOptions dumperOptions = new DumperOptions(); | ||
| dumperOptions.setDefaultFlowStyle(representer.getDefaultFlowStyle()); | ||
| dumperOptions.setDefaultScalarStyle(representer.getDefaultScalarStyle()); | ||
| dumperOptions.setAllowReadOnlyProperties(representer.getPropertyUtils().isAllowReadOnlyProperties()); | ||
| dumperOptions.setTimeZone(representer.getTimeZone()); | ||
| LoaderOptions loadingConfig = new LoaderOptions(); | ||
| loadingConfig.setAllowDuplicateKeys(false); | ||
| return new Yaml(constructor, representer, dumperOptions, loadingConfig); |
There was a problem hiding this comment.
Now that LoaderOptions provide the setAllowDuplicateKeys option, we don't need the StrictMapAppenderConstructor anymore?
| StrictMapAppenderConstructor constructor = new StrictMapAppenderConstructor(); | |
| Representer representer = new Representer(); | |
| DumperOptions dumperOptions = new DumperOptions(); | |
| dumperOptions.setDefaultFlowStyle(representer.getDefaultFlowStyle()); | |
| dumperOptions.setDefaultScalarStyle(representer.getDefaultScalarStyle()); | |
| dumperOptions.setAllowReadOnlyProperties(representer.getPropertyUtils().isAllowReadOnlyProperties()); | |
| dumperOptions.setTimeZone(representer.getTimeZone()); | |
| LoaderOptions loadingConfig = new LoaderOptions(); | |
| loadingConfig.setAllowDuplicateKeys(false); | |
| return new Yaml(constructor, representer, dumperOptions, loadingConfig); | |
| LoaderOptions loadingConfig = new LoaderOptions(); | |
| loadingConfig.setAllowDuplicateKeys(false); | |
| return new Yaml(new SafeConstructor(), new Representer(), new DumperOptions(), loadingConfig); |
There was a problem hiding this comment.
BTW, why would we need to set the configs of DumperOptions?
apollo-client/src/test/java/com/ctrip/framework/apollo/spring/BootstrapConfigTest.java
Show resolved
Hide resolved
|
@nobodyiam I test the public Yaml(BaseConstructor constructor, Representer representer) {
this(constructor, representer, initDumperOptions(representer));
}
private static DumperOptions initDumperOptions(Representer representer) {
DumperOptions dumperOptions = new DumperOptions();
dumperOptions.setDefaultFlowStyle(representer.getDefaultFlowStyle());
dumperOptions.setDefaultScalarStyle(representer.getDefaultScalarStyle());
dumperOptions.setAllowReadOnlyProperties(representer.getPropertyUtils().isAllowReadOnlyProperties());
dumperOptions.setTimeZone(representer.getTimeZone());
return dumperOptions;
}
/**
* Create Yaml instance. It is safe to create a few instances and use them
* in different Threads.
*
* @param representer Representer to emit outgoing objects
* @param dumperOptions DumperOptions to configure outgoing objects
*/
public Yaml(Representer representer, DumperOptions dumperOptions) {
this(new Constructor(), representer, dumperOptions, new LoaderOptions(), new Resolver());
}For Summarize, we can't config |
|
@nobodyiam And If we remove the |
|
To make private Yaml createYaml() {
LoaderOptions loadingConfig = new LoaderOptions();
loadingConfig.setAllowDuplicateKeys(false);
return new Yaml(new SafeConstructor(), new Representer(), new DumperOptions(), loadingConfig);
} |
|
@nobodyiam I have misunderstood your meaning. I thought you want to remove the constructor, only keep the |
apollo-client/src/main/java/com/ctrip/framework/apollo/util/yaml/YamlParser.java
Show resolved
Hide resolved
ab0e19f to
c74c3b4
Compare
Codecov Report
@@ Coverage Diff @@
## master #4189 +/- ##
============================================
- Coverage 52.60% 52.54% -0.06%
+ Complexity 2620 2618 -2
============================================
Files 484 484
Lines 15201 15192 -9
Branches 1572 1571 -1
============================================
- Hits 7996 7983 -13
- Misses 6648 6650 +2
- Partials 557 559 +2
Continue to review full report at Codecov.
|
What's the purpose of this PR
Bump springboot version to support java17, drop the support of java7
Brief changelog
Mockito.any()not match null anymore, need to useMockito.nullable()insteadInvocationOnMock.getArgumentAtrename toInvocationOnMock.getArgumentFollow this checklist to help us incorporate your contribution quickly and easily:
mvn clean testto make sure this pull request doesn't break anything.CHANGESlog.