-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Bump client springboot version #4189
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
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.getArgumentAt
rename toInvocationOnMock.getArgument
Follow this checklist to help us incorporate your contribution quickly and easily:
mvn clean test
to make sure this pull request doesn't break anything.CHANGES
log.