exceptionfactory commented on code in PR #10959:
URL: https://github.com/apache/nifi/pull/10959#discussion_r2884136649


##########
nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/TransformXml.java:
##########
@@ -375,10 +380,23 @@ private StreamSource getTemplateSource(final 
LookupService<String> lookupService
         return streamSource;
     }
 
+    private Source getSource(final InputStream inputStream) {
+        final Source source;
+
+        final StreamSource streamSource = new StreamSource(inputStream);
+        if (secureProcessingEnabled) {
+            final XMLStreamReader streamReader = 
STREAM_READER_PROVIDER.getStreamReader(streamSource);
+            source = new StAXSource(streamReader);
+        } else {
+            source = streamSource;
+        }

Review Comment:
   I considered that, but in this case, the calling method has a general `catch 
(Exception)` block, so there is no need to wrap a potential `RuntimeException`.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to