- final JsonReader jsonReader = new JsonReader(new InputStreamReader(entityStream, StandardCharsets.UTF_8));
- AtomicReference<String> patchId = new AtomicReference<>();
- final List<PatchEntity> 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<String>();
+ final var resultList = read(jsonReader, path, patchId);
+ return new PatchContext(path, resultList, patchId.get());