[johnzon] branch rmannibucau/jsonpointer-compliance-proposal created (now 437dad6)

2020-12-02 Thread rmannibucau
This is an automated email from the ASF dual-hosted git repository.

rmannibucau pushed a change to branch 
rmannibucau/jsonpointer-compliance-proposal
in repository https://gitbox.apache.org/repos/asf/johnzon.git.


  at 437dad6  [JOHNZON-325] jsonp-strict module

This branch includes the following new commits:

 new 437dad6  [JOHNZON-325] jsonp-strict module

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[johnzon] 01/01: [JOHNZON-325] jsonp-strict module

2020-12-02 Thread rmannibucau
This is an automated email from the ASF dual-hosted git repository.

rmannibucau pushed a commit to branch 
rmannibucau/jsonpointer-compliance-proposal
in repository https://gitbox.apache.org/repos/asf/johnzon.git

commit 437dad68a726883a7ca4588690478f7fd3301d30
Author: Romain Manni-Bucau 
AuthorDate: Wed Dec 2 13:09:28 2020 +0100

[JOHNZON-325] jsonp-strict module
---
 .../johnzon/core/DefaultJsonPointerFactory.java|  31 +
 .../org/apache/johnzon/core/JsonPatchImpl.java |  39 ++
 .../org/apache/johnzon/core/JsonPointerImpl.java   |   2 +-
 .../org/apache/johnzon/core/JsonProviderImpl.java  |  15 +-
 .../johnzon/core/spi/JsonPointerFactory.java   |  30 
 .../org/apache/johnzon/core/JsonPointerTest.java   | 113 +--
 johnzon-jsonp-strict/pom.xml   |  81 +++
 .../jsonp/strict/StrictJsonPointerFactory.java |  42 ++
 .../org.apache.johnzon.core.spi.JsonPointerFactory |   1 +
 .../jsonp/strict/StrictJsonPointerFactoryTest.java | 153 +
 pom.xml|   4 +-
 src/site/markdown/index.md |  16 +++
 12 files changed, 386 insertions(+), 141 deletions(-)

diff --git 
a/johnzon-core/src/main/java/org/apache/johnzon/core/DefaultJsonPointerFactory.java
 
b/johnzon-core/src/main/java/org/apache/johnzon/core/DefaultJsonPointerFactory.java
new file mode 100644
index 000..152f029
--- /dev/null
+++ 
b/johnzon-core/src/main/java/org/apache/johnzon/core/DefaultJsonPointerFactory.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.johnzon.core;
+
+import org.apache.johnzon.core.spi.JsonPointerFactory;
+
+import javax.json.JsonPointer;
+import javax.json.spi.JsonProvider;
+
+public class DefaultJsonPointerFactory implements JsonPointerFactory {
+@Override
+public JsonPointer createPointer(final JsonProvider provider, final String 
path) {
+return new JsonPointerImpl(provider, path);
+}
+}
diff --git 
a/johnzon-core/src/main/java/org/apache/johnzon/core/JsonPatchImpl.java 
b/johnzon-core/src/main/java/org/apache/johnzon/core/JsonPatchImpl.java
index 390c438..41ceedf 100644
--- a/johnzon-core/src/main/java/org/apache/johnzon/core/JsonPatchImpl.java
+++ b/johnzon-core/src/main/java/org/apache/johnzon/core/JsonPatchImpl.java
@@ -29,6 +29,7 @@ import javax.json.JsonException;
 import javax.json.JsonObject;
 import javax.json.JsonObjectBuilder;
 import javax.json.JsonPatch;
+import javax.json.JsonPointer;
 import javax.json.JsonStructure;
 import javax.json.JsonValue;
 import javax.json.spi.JsonProvider;
@@ -147,9 +148,11 @@ class JsonPatchImpl implements JsonPatch {
 static class PatchValue {
 private final JsonProvider provider;
 private final JsonPatch.Operation operation;
-private final JsonPointerImpl path;
-private final JsonPointerImpl from;
+private final JsonPointer path;
+private final JsonPointer from;
 private final JsonValue value;
+private final String pathPtr;
+private final String fromPtr;
 
 private volatile String str;
 private volatile JsonObject json;
@@ -162,11 +165,13 @@ class JsonPatchImpl implements JsonPatch {
final JsonValue value) {
 this.provider = provider;
 this.operation = operation;
-this.path = new JsonPatchPointerImpl(provider, path);
+this.path = provider.createPointer(path);
+this.pathPtr = path;
+this.fromPtr = from;
 
 // ignore from if we do not need it
 if (operation == JsonPatch.Operation.MOVE || operation == 
JsonPatch.Operation.COPY) {
-this.from = new JsonPatchPointerImpl(provider, from);
+this.from = provider.createPointer(from);
 } else {
 this.from = null;
 }
@@ -233,10 +238,10 @@ class JsonPatchImpl implements JsonPatch {
 if (json == null) {
 JsonObjectBuilder builder = 
provider.createObjectBuilder()
 .add("op", operation.name().toLowerCase())
-

[johnzon] branch master updated (d0a2002 -> 12c1687)

2020-12-02 Thread jlmonteiro
This is an automated email from the ASF dual-hosted git repository.

jlmonteiro pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/johnzon.git.


from d0a2002  Remove the build for JDK 11
 new ef0001d  Fix for handling primitive arrays in JsonB
 new 630b5cf  Slight copy/paste mistake in the test case
 new 12c1687  Merge pull request #69 from jgallimore/primitive-fix

The 775 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/johnzon/jsonb/JohnzonJsonb.java |  10 +-
 .../org/apache/johnzon/jsonb/JohnzonJsonbTest.java | 122 +
 2 files changed, 130 insertions(+), 2 deletions(-)