Skip to content

Commit

Permalink
Fixed bug in path.lastIndexOf()
Browse files Browse the repository at this point in the history
Signed-off-by: naomichi-y <n.yamakita@gmail.com>
  • Loading branch information
naomichi-y committed Apr 23, 2024
1 parent a179c8c commit 4b58495
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private void parseToken(StringBuilder path, String currentFieldName) throws IOEx
// skip
} else if (this.parser.currentToken() == Token.START_OBJECT) {
parseToken(path, currentFieldName);
int dotIndex = path.lastIndexOf(DOT_SYMBOL);
int dotIndex = path.lastIndexOf(DOT_SYMBOL, path.length());

if (dotIndex != -1 && path.length() > currentFieldName.length()) {
path.setLength(path.length() - currentFieldName.length() - 1);
Expand All @@ -118,7 +118,7 @@ private void parseToken(StringBuilder path, String currentFieldName) throws IOEx
parseValue(parsedFields);
this.valueList.add(parsedFields.toString());
this.valueAndPathList.add(path + EQUAL_SYMBOL + parsedFields);
int dotIndex = path.lastIndexOf(DOT_SYMBOL);
int dotIndex = path.lastIndexOf(DOT_SYMBOL, path.length());
if (dotIndex != -1 && path.length() > currentFieldName.length()) {
path.setLength(path.length() - currentFieldName.length() - 1);
}
Expand Down

0 comments on commit 4b58495

Please sign in to comment.