garydgregory commented on code in PR #2635:
URL: https://github.com/apache/activemq/pull/2635#discussion_r4179683338


##########
activemq-console/src/main/java/org/apache/activemq/console/command/CreateCommand.java:
##########
@@ -158,10 +160,10 @@ protected void copyActivemqConf(File srcBase, File 
targetBase, String activemqCo
         File dest = new File(targetBase, DEFAULT_TARGET_ACTIVEMQ_CONF);
         context.print("Copying from: " + src.getCanonicalPath() + "\n          
to: " + dest.getCanonicalPath());
 
-        DocumentBuilder builder = 
XmlFactories.getSafeDocumentBuilderFactory().newDocumentBuilder();
+        DocumentBuilder builder = 
SecureDocumentBuilderFactory.newNSInstance().newDocumentBuilder();
         Element docElem = builder.parse(src).getDocumentElement();
 
-        XPath xpath = XPathFactory.newInstance().newXPath();
+        XPath xpath = SecureXPathFactory.newInstance().newXPath();
         Attr brokerNameAttr = (Attr) xpath.evaluate(DEFAULT_BROKERNAME_XPATH, 
docElem, XPathConstants.NODE);

Review Comment:
   @ppkarwasz I implemented your suggestion 2 in commit 
d64bcfd05d025d9d2657749d539a7f861c981617.
   I like the XPath approach with namespaces because it is more precise IMO.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to