Support array of scalar values in Jackson2Tokenizer

Issue: SPR-16407
This commit is contained in:
Arjen Poutsma
2018-01-22 17:07:38 +01:00
parent 9d0e62ef68
commit b47491695e
2 changed files with 10 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -173,8 +173,9 @@ class Jackson2Tokenizer {
this.tokenBuffer.copyCurrentEvent(this.parser);
}
if ((token == JsonToken.END_OBJECT && this.objectDepth == 0 && (this.arrayDepth == 1 || this.arrayDepth == 0)) ||
(token.isScalarValue()) && this.objectDepth == 0 && this.arrayDepth == 0) {
if (this.objectDepth == 0 &&
(this.arrayDepth == 0 || this.arrayDepth == 1) &&
(token == JsonToken.END_OBJECT || token.isScalarValue())) {
result.add(this.tokenBuffer);
this.tokenBuffer = new TokenBuffer(this.parser);
}