review comments

This commit is contained in:
Colin Goodheart-Smithe 2016-05-09 10:51:50 +01:00
parent ab3121c871
commit 66d0bdab0c
1 changed files with 0 additions and 4 deletions

View File

@ -853,9 +853,7 @@ final class DocumentParser {
private static Tuple<Integer, ObjectMapper> getDynamicParentMapper(ParseContext context, final String[] paths, private static Tuple<Integer, ObjectMapper> getDynamicParentMapper(ParseContext context, final String[] paths,
ObjectMapper currentParent) { ObjectMapper currentParent) {
ObjectMapper mapper = currentParent == null ? context.root() : currentParent; ObjectMapper mapper = currentParent == null ? context.root() : currentParent;
ObjectMapper[] mappers = new ObjectMapper[paths.length-1];
int pathsAdded = 0; int pathsAdded = 0;
if (paths.length > 1) {
ObjectMapper parent = mapper; ObjectMapper parent = mapper;
for (int i = 0; i < paths.length-1; i++) { for (int i = 0; i < paths.length-1; i++) {
mapper = context.docMapper().objectMappers().get(context.path().pathAsText(paths[i])); mapper = context.docMapper().objectMappers().get(context.path().pathAsText(paths[i]));
@ -886,10 +884,8 @@ final class DocumentParser {
} }
context.path().add(paths[i]); context.path().add(paths[i]);
pathsAdded++; pathsAdded++;
mappers[i] = mapper;
parent = mapper; parent = mapper;
} }
}
return new Tuple<Integer, ObjectMapper>(pathsAdded, mapper); return new Tuple<Integer, ObjectMapper>(pathsAdded, mapper);
} }