diff --git a/src/main/java/emissary/util/xml/AbstractJDOMUtil.java b/src/main/java/emissary/util/xml/AbstractJDOMUtil.java index de36ce9400..06ae50ff8b 100755 --- a/src/main/java/emissary/util/xml/AbstractJDOMUtil.java +++ b/src/main/java/emissary/util/xml/AbstractJDOMUtil.java @@ -33,6 +33,7 @@ public abstract class AbstractJDOMUtil { public static final String ERR_MSG = "Could not parse document: "; + @SuppressWarnings("MemberName") protected static SAXBuilder createSAXBuilder(final boolean validate) { SAXBuilder builder; if (validate) { diff --git a/src/main/java/emissary/util/xml/SaferJDOMUtil.java b/src/main/java/emissary/util/xml/SaferJDOMUtil.java index 99e58bd638..7c027400ad 100755 --- a/src/main/java/emissary/util/xml/SaferJDOMUtil.java +++ b/src/main/java/emissary/util/xml/SaferJDOMUtil.java @@ -14,6 +14,7 @@ */ public class SaferJDOMUtil extends AbstractJDOMUtil { + @SuppressWarnings("MemberName") protected static SAXBuilder createSAXBuilder() { SAXBuilder builder = createSAXBuilder(false); // This is the PRIMARY defense. If DTDs (doctypes) are disallowed, almost all XML entity attacks are prevented diff --git a/src/test/java/emissary/util/xml/JDOMUtilTest.java b/src/test/java/emissary/util/xml/JDOMUtilTest.java index 86a1fd73a2..5b6ea40236 100644 --- a/src/test/java/emissary/util/xml/JDOMUtilTest.java +++ b/src/test/java/emissary/util/xml/JDOMUtilTest.java @@ -12,7 +12,7 @@ class JDOMUtilTest extends UnitTest { - static final String plist_xml = + static final String PLIST_XML = "\n" + "\n" + "\n" + "\n" + " Label\n" + " com.apple.AOSNotification\n" @@ -25,7 +25,7 @@ class JDOMUtilTest extends UnitTest { @Test void testNonValidatingDTDRetrievalSuppression() { try { - final Document doc = JDOMUtil.createDocument(plist_xml, null, false); + final Document doc = JDOMUtil.createDocument(PLIST_XML, null, false); assertNotNull(doc, "Document should be created"); } catch (Throwable t) { fail("An exception should not be thrown here, perhaps the DTD validation is not fully disabled.", t); @@ -34,6 +34,6 @@ void testNonValidatingDTDRetrievalSuppression() { @Test void testValidationFailedDTDRetrieval() { - assertThrows(JDOMParseException.class, () -> JDOMUtil.createDocument(plist_xml, null, true)); + assertThrows(JDOMParseException.class, () -> JDOMUtil.createDocument(PLIST_XML, null, true)); } }