Skip to content

Commit

Permalink
Fixed RD-10971
Browse files Browse the repository at this point in the history
  • Loading branch information
bgaidioz committed Sep 5, 2024
1 parent 311102f commit a1c740a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -609,11 +609,10 @@ protected static TruffleArrayList doParseList(
@Cached @Cached.Shared("currentToken")
JsonParserNodes.CurrentTokenJsonParserNode currentToken,
@Cached @Cached.Shared("nextToken") JsonParserNodes.NextTokenJsonParserNode nextToken) {
if (currentToken.execute(thisNode, parser) != JsonToken.START_ARRAY) {
JsonToken token = currentToken.execute(thisNode, parser);
if (token != JsonToken.START_ARRAY) {
throw new JsonUnexpectedTokenException(
JsonToken.START_ARRAY.asString(),
currentToken.execute(thisNode, parser).toString(),
thisNode);
JsonToken.START_ARRAY.asString(), String.valueOf(token), thisNode);
}
nextToken.execute(thisNode, parser);

Expand All @@ -640,11 +639,10 @@ protected static Object doParse(
JsonParserNodes.CurrentTokenJsonParserNode currentToken,
@Cached JsonParserNodes.CurrentFieldJsonParserNode currentField,
@Cached RecordNodes.AddPropNode addPropNode) {
if (currentToken.execute(thisNode, parser) != JsonToken.START_OBJECT) {
JsonToken token = currentToken.execute(thisNode, parser);
if (token != JsonToken.START_OBJECT) {
throw new JsonUnexpectedTokenException(
JsonToken.START_OBJECT.asString(),
currentToken.execute(thisNode, parser).toString(),
thisNode);
JsonToken.START_OBJECT.asString(), String.valueOf(token), thisNode);
}

nextToken.execute(thisNode, parser);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ public ListParseJsonNode(
public Object executeGeneric(VirtualFrame frame) {
Object[] args = frame.getArguments();
JsonParser parser = (JsonParser) args[0];

if (currentToken.execute(this, parser) != JsonToken.START_ARRAY) {
JsonToken token = currentToken.execute(this, parser);
if (token != JsonToken.START_ARRAY) {
throw new JsonUnexpectedTokenException(
JsonToken.START_ARRAY.asString(), currentToken.execute(this, parser).toString(), this);
JsonToken.START_ARRAY.asString(), String.valueOf(token), this);
}
nextToken.execute(this, parser);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,10 @@ public Object executeGeneric(VirtualFrame frame) {
JsonParser parser = (JsonParser) args[0];
BitSet currentBitSet = new BitSet(this.fieldsSize);

if (currentTokenNode.execute(this, parser) != JsonToken.START_OBJECT) {
JsonToken token = currentTokenNode.execute(this, parser);
if (token != JsonToken.START_OBJECT) {
throw new JsonUnexpectedTokenException(
JsonToken.START_OBJECT.asString(),
currentTokenNode.execute(this, parser).toString(),
this);
JsonToken.START_OBJECT.asString(), String.valueOf(token), this);
}
nextTokenNode.execute(this, parser);

Expand Down

0 comments on commit a1c740a

Please sign in to comment.