From: Robert Varga Date: Fri, 25 Aug 2023 09:26:23 +0000 (+0200) Subject: Remove unused jsonPatchBodyReader.readFrom() X-Git-Tag: v7.0.0~642 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=6192eb0d46f143972ed404272516d5bc1604cbb9;p=netconf.git Remove unused jsonPatchBodyReader.readFrom() This method is completely unused, remove it. JIRA: NETCONF-1128 Change-Id: Ib74ee6a414982ce9432f032eb2a49bf5ff085b37 Signed-off-by: Robert Varga --- diff --git a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/JsonPatchBodyReader.java b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/JsonPatchBodyReader.java index ac9a7b82b7..079756d40f 100644 --- a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/JsonPatchBodyReader.java +++ b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/JsonPatchBodyReader.java @@ -20,7 +20,6 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.StringReader; import java.nio.charset.StandardCharsets; -import java.util.List; import java.util.concurrent.atomic.AtomicReference; import javax.ws.rs.Consumes; import javax.ws.rs.WebApplicationException; @@ -33,7 +32,6 @@ import org.opendaylight.restconf.common.patch.PatchContext; import org.opendaylight.restconf.common.patch.PatchEntity; import org.opendaylight.restconf.nb.rfc8040.MediaTypes; import org.opendaylight.restconf.nb.rfc8040.databind.DatabindProvider; -import org.opendaylight.restconf.nb.rfc8040.utils.parser.ParserIdentifier; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.patch.rev170222.yang.patch.yang.patch.Edit.Operation; import org.opendaylight.yangtools.yang.common.ErrorTag; import org.opendaylight.yangtools.yang.common.ErrorType; @@ -75,22 +73,10 @@ public class JsonPatchBodyReader extends AbstractPatchBodyReader { private PatchContext readFrom(final InstanceIdentifierContext path, final InputStream entityStream) throws IOException { - final JsonReader jsonReader = new JsonReader(new InputStreamReader(entityStream, StandardCharsets.UTF_8)); - AtomicReference patchId = new AtomicReference<>(); - final List resultList = read(jsonReader, path, patchId); - jsonReader.close(); - - return new PatchContext(path, resultList, patchId.get()); - } - - @SuppressWarnings("checkstyle:IllegalCatch") - public PatchContext readFrom(final String uriPath, final InputStream entityStream) - throws RestconfDocumentedException { - try { - return readFrom(ParserIdentifier.toInstanceIdentifier(uriPath, getSchemaContext(), getMountPointService()), - entityStream); - } catch (final Exception e) { - throw propagateExceptionAs(e); + try (var jsonReader = new JsonReader(new InputStreamReader(entityStream, StandardCharsets.UTF_8))) { + final var patchId = new AtomicReference(); + final var resultList = read(jsonReader, path, patchId); + return new PatchContext(path, resultList, patchId.get()); } }