[GitHub] [johnzon] rmannibucau commented on a change in pull request #62: Added possibility to use minus as array index for the remove operation.
rmannibucau commented on a change in pull request #62: Added possibility to use
minus as array index for the remove operation.
URL: https://github.com/apache/johnzon/pull/62#discussion_r398512320
##
File path:
johnzon-core/src/test/java/org/apache/johnzon/core/JsonPointerTest.java
##
@@ -456,6 +456,19 @@ public void testRemoveArrayElement() {
assertEquals("[[\"bar\",\"baz\"]]", result.toString()); //
[["bar","baz"]]
}
+@Test
+public void testRemoveLastArrayElement() {
Review comment:
I was more thinking about the + case (know it is not what you changed but
your change moves from (a || b) to (a || (b && c)), I just want to prevent the
fact it becomes ((a || b) && c)
[or something else] during another enhancement by a test executed in the
build.
Hope it makes sense.
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
[GitHub] [johnzon] rmannibucau commented on a change in pull request #62: Added possibility to use minus as array index for the remove operation.
rmannibucau commented on a change in pull request #62: Added possibility to use
minus as array index for the remove operation.
URL: https://github.com/apache/johnzon/pull/62#discussion_r398512320
##
File path:
johnzon-core/src/test/java/org/apache/johnzon/core/JsonPointerTest.java
##
@@ -456,6 +456,19 @@ public void testRemoveArrayElement() {
assertEquals("[[\"bar\",\"baz\"]]", result.toString()); //
[["bar","baz"]]
}
+@Test
+public void testRemoveLastArrayElement() {
Review comment:
I was more thinking about the + case (know it is not what you changed but
your change moves from (a || b) to (a || (b && c)), I just want to prevent the
fact it becomes ((a || b) && c)
- or something else - during another enhancement by a test executed in the
build.
Hope it makes sense.
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
[GitHub] [johnzon] rmannibucau commented on a change in pull request #62: Added possibility to use minus as array index for the remove operation.
rmannibucau commented on a change in pull request #62: Added possibility to use
minus as array index for the remove operation.
URL: https://github.com/apache/johnzon/pull/62#discussion_r398339315
##
File path:
johnzon-core/src/test/java/org/apache/johnzon/core/JsonPointerTest.java
##
@@ -456,6 +456,19 @@ public void testRemoveArrayElement() {
assertEquals("[[\"bar\",\"baz\"]]", result.toString()); //
[["bar","baz"]]
}
+@Test
+public void testRemoveLastArrayElement() {
Review comment:
maybe add a test for "" too since this case is handled differently
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
[GitHub] [johnzon] rmannibucau commented on a change in pull request #62: Added possibility to use minus as array index for the remove operation.
rmannibucau commented on a change in pull request #62: Added possibility to use
minus as array index for the remove operation.
URL: https://github.com/apache/johnzon/pull/62#discussion_r398339170
##
File path:
johnzon-core/src/main/java/org/apache/johnzon/core/JsonPointerImpl.java
##
@@ -339,8 +339,7 @@ private JsonValue getValue(JsonValue jsonValue, String
referenceToken, int curre
try {
JsonArray jsonArray = (JsonArray) jsonValue;
-int arrayIndex = Integer.parseInt(referenceToken);
-validateArraySize(jsonArray, arrayIndex, jsonArray.size());
Review comment:
seems we loose that validation for number cases, no?
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
