Skip to content

Commit

Permalink
#26990 prevent duplicate fields when mixing parent and root nested in…
Browse files Browse the repository at this point in the history
…cludes (follow up)
  • Loading branch information
original-brownbear committed Oct 27, 2017
1 parent 335a237 commit a043337
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ private static void fixRedundantIncludes(ObjectMapper.Builder omb, boolean paren
ObjectMapper.Builder child = (ObjectMapper.Builder) mapper;
Nested nested = child.nested;
boolean isNested = nested.isNested();
boolean includedInParent = parentIncluded && isNested && nested.isIncludeInParent();
boolean includeInRootViaParent = parentIncluded && isNested && nested.isIncludeInParent();
boolean includedInRoot = isNested && nested.isIncludeInRoot();
if (includedInParent && includedInRoot) {
if (includeInRootViaParent && includedInRoot) {
child.nested = Nested.newNested(true, false);
}
fixRedundantIncludes(child, includedInParent || includedInRoot);
fixRedundantIncludes(child, includeInRootViaParent || includedInRoot);
}
}
}
Expand Down

0 comments on commit a043337

Please sign in to comment.