rmannibucau commented on code in PR #110:
URL: https://github.com/apache/johnzon/pull/110#discussion_r1350385691
##########
johnzon-core/src/main/java/org/apache/johnzon/core/JsonGeneratorImpl.java:
##########
@@ -449,8 +449,8 @@ public void close() {
try {
if (ex == null) {
flushBuffer();
+ writer.close();
Review Comment:
typo?
##########
johnzon-core/src/main/java/org/apache/johnzon/core/RejectDuplicateKeysMode.java:
##########
@@ -44,14 +48,16 @@ public static RejectDuplicateKeysMode from(final
Map<String, ?> config) {
if (config == null) {
return DEFAULT;
}
+
return CONFIG_KEYS.stream()
.map(config::get)
.filter(Objects::nonNull)
.findFirst()
.map(String::valueOf)
- .map(it -> "false".equalsIgnoreCase(it) ? "DEFAULT" : it) //
alias to avoid to add an enum value for nothing
+ .map(it -> "false".equalsIgnoreCase(it) ||
"LAST".equalsIgnoreCase(it) ? "DEFAULT" : it) // aliases to avoid to add an
enum value for nothing
+ .map(it -> "NONE".equalsIgnoreCase(it) ? "true" : it)
.map(it -> valueOf(it.toUpperCase(Locale.ROOT).trim()))
- .orElse(DEFAULT);
+ .orElse(TRUE);
Review Comment:
why not default (backward compat)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]