fixed data path quoting in array issue

This commit is contained in:
Ziver Koc 2023-08-22 20:27:30 +02:00
parent a2694af70f
commit 5fd11daf15

View file

@ -69,10 +69,11 @@ public class DataNodePath {
} else if (operator == '.') {
pathList.add(new NamedChildPathEntity(buffer.toString()));
} else if (operator == '[') {
if (buffer.charAt(0) == '\'' && buffer.charAt(buffer.length()-1) == '\'')
pathList.add(new NamedChildPathEntity(StringUtil.trim(buffer.toString(), '\'')));
String str = buffer.toString();
if (StringUtil.isNumber(str))
pathList.add(new IndexChildPathEntity(Integer.parseInt(str)));
else
pathList.add(new IndexChildPathEntity(Integer.parseInt(buffer.toString())));
pathList.add(new NamedChildPathEntity(str));
}
buffer.delete(0, buffer.length());