diff --git a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/JsonUtils.java b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/JsonUtils.java index 5fe2a5664d..efe89aba7a 100644 --- a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/JsonUtils.java +++ b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/JsonUtils.java @@ -104,13 +104,9 @@ public class JsonUtils { * @throws IOException */ public static boolean isValidJson(InputStream inputStream) throws IOException { - boolean isValid = false; - try (InputStreamReader inputStreamReader = new InputStreamReader(inputStream)) { - isValid = JSONValue.isValidJsonStrict(inputStreamReader); + return JSONValue.isValidJsonStrict(inputStreamReader); } - - return isValid; } /**