This is an automated email from the ASF dual-hosted git repository.
garydgregory pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/commons-secure-xml.git
The following commit(s) were added to refs/heads/main by this push:
new 94898e3 Remove unthrown exceptions (#78)
94898e3 is described below
commit 94898e312a4536abfcc53d1e0756ebcaac67d2ec
Author: Elliotte Rusty Harold <[email protected]>
AuthorDate: Tue Sep 1 14:10:57 2026 +0000
Remove unthrown exceptions (#78)
Co-authored-by: Piotr P. Karwasz <[email protected]>
---
.../org/apache/commons/xml/secure/FallbackIgnoreEntityResolver2.java | 4 ++--
.../org/apache/commons/xml/secure/SecureTransformerFactoryTest.java | 2 +-
src/test/java/org/apache/commons/xml/secure/XIncludeTest.java | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git
a/src/main/java/org/apache/commons/xml/secure/FallbackIgnoreEntityResolver2.java
b/src/main/java/org/apache/commons/xml/secure/FallbackIgnoreEntityResolver2.java
index b920d96..50e6e4d 100644
---
a/src/main/java/org/apache/commons/xml/secure/FallbackIgnoreEntityResolver2.java
+++
b/src/main/java/org/apache/commons/xml/secure/FallbackIgnoreEntityResolver2.java
@@ -109,11 +109,11 @@ public InputSource getExternalSubset(final String name,
final String baseURI) th
* @param publicId The public identifier, or {@code null} if none.
* @param baseURI The base URI for relative resolution, or {@code null}.
* @param systemId The system identifier of the unresolved entity.
- * @return An empty {@link InputSource} carrying the requested identifiers.
+ * @return an empty {@link InputSource} carrying the requested identifiers.
* @throws SAXException when {@value SecureException#THROW_ON_UNRESOLVED}
is set: unresolved references are rejected instead of resolved to empty.
* @throws IOException never by the default implementation.
*/
- private InputSource onUnresolved(final String name, final String publicId,
final String baseURI, final String systemId) throws SAXException, IOException {
+ private InputSource onUnresolved(final String name, final String publicId,
final String baseURI, final String systemId) throws SAXException {
if (SecureException.throwOnUnresolved()) {
throw new SAXException(SecureException.forbidden(name, null,
publicId, systemId, baseURI));
}
diff --git
a/src/test/java/org/apache/commons/xml/secure/SecureTransformerFactoryTest.java
b/src/test/java/org/apache/commons/xml/secure/SecureTransformerFactoryTest.java
index 1e5fbf0..1c309b8 100644
---
a/src/test/java/org/apache/commons/xml/secure/SecureTransformerFactoryTest.java
+++
b/src/test/java/org/apache/commons/xml/secure/SecureTransformerFactoryTest.java
@@ -157,7 +157,7 @@ public void setFeature(final String name, final boolean
value) throws Transforme
}
}
- private static void associatedStylesheet(final SAXTransformerFactory
factory, final Source source) throws Exception {
+ private static void associatedStylesheet(final SAXTransformerFactory
factory, final Source source) {
try {
factory.getAssociatedStylesheet(source, null, null, null);
} catch (final TransformerConfigurationException |
NullPointerException expected) {
diff --git a/src/test/java/org/apache/commons/xml/secure/XIncludeTest.java
b/src/test/java/org/apache/commons/xml/secure/XIncludeTest.java
index fc8aee0..3426bef 100644
--- a/src/test/java/org/apache/commons/xml/secure/XIncludeTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/XIncludeTest.java
@@ -192,7 +192,7 @@ void secureDomBlocksParseText() throws Exception {
@Test
@Tag("dom")
- void secureDomBlocksParseXml() throws Exception {
+ void secureDomBlocksParseXml() {
final InputSource input = inputSource(xiIncludeXml(REFERENCED_XML,
"xml"));
final DocumentBuilderFactory factory =
SecureDocumentBuilderFactory.newInstance();
@@ -306,7 +306,7 @@ void secureSaxBlocksParseText() throws Exception {
@Test
@Tag("sax")
- void secureSaxBlocksParseXml() throws Exception {
+ void secureSaxBlocksParseXml() {
final InputSource input = inputSource(xiIncludeXml(REFERENCED_XML,
"xml"));
final SAXParserFactory factory = SecureSAXParserFactory.newInstance();