Copilot commented on code in PR #96:
URL: https://github.com/apache/commons-secure-xml/pull/96#discussion_r4001076422
##########
src/main/java/org/apache/commons/xml/secure/SecureTransformer.java:
##########
@@ -106,7 +111,7 @@ public URIResolver getURIResolver() {
@Override
public void reset() {
delegate.reset();
- floor.setDelegate(uriResolver);
+ floor.setDelegate(initialUriResolver);
Review Comment:
The new `initialUriResolver` path is also used by `reset()`, but the reset
regression test only verifies that the floor still blocks an unlisted URI. A
reset that restored the factory or null resolver instead of the
delegate-carried resolver would still pass; add a test that sets a carried
resolver, calls `reset()`, and verifies it still handles an opted-in
`document()` URI.
##########
src/test/java/org/apache/commons/xml/secure/TransformerHandlerTest.java:
##########
@@ -19,16 +19,23 @@
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.StringWriter;
+import java.util.Properties;
import javax.xml.transform.Templates;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.URIResolver;
import javax.xml.transform.sax.SAXTransformerFactory;
+import javax.xml.transform.sax.TemplatesHandler;
Review Comment:
This import is unused, and the repository's Checkstyle configuration enables
`UnusedImports` (src/conf/checkstyle.xml:83), so `mvn verify` will fail on this
added line. Remove it.
--
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]