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-xml.git
commit 989eb48091a240c53d4ca136c711eb6ba3062f57 Author: Gary Gregory <[email protected]> AuthorDate: Fri Aug 28 14:17:37 2026 -0400 Name like in the JRE example in MethodHandles.Lookup.findStatic(). --- src/main/java/org/apache/commons/xml/SecureXMLInputFactory.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/apache/commons/xml/SecureXMLInputFactory.java b/src/main/java/org/apache/commons/xml/SecureXMLInputFactory.java index 6a116ce..90b6edb 100644 --- a/src/main/java/org/apache/commons/xml/SecureXMLInputFactory.java +++ b/src/main/java/org/apache/commons/xml/SecureXMLInputFactory.java @@ -58,7 +58,7 @@ public final class SecureXMLInputFactory { /** Class name of the JDK's built-in default implementation, the Java 8 fallback for {@link #newDefaultFactory()}. */ private static final String JDK_XML_INPUT_FACTORY = "com.sun.xml.internal.stream.XMLInputFactoryImpl"; - private static final MethodHandle NEW_DEFAULT_FACTORY = MethodHandleFactory.findStatic(XMLInputFactory.class, "newDefaultFactory", + private static final MethodHandle MH_newDefaultInstance = MethodHandleFactory.findStatic(XMLInputFactory.class, "newDefaultFactory", MethodType.methodType(XMLInputFactory.class)); /** @@ -89,10 +89,10 @@ static XMLInputFactory secure(final XMLInputFactory factory) { * (for example Android). */ public static XMLInputFactory newDefaultFactory() { - if (NEW_DEFAULT_FACTORY != null) { + if (MH_newDefaultInstance != null) { final XMLInputFactory factory; try { - factory = (XMLInputFactory) NEW_DEFAULT_FACTORY.invokeExact(); + factory = (XMLInputFactory) MH_newDefaultInstance.invokeExact(); } catch (final FactoryConfigurationError e) { throw e; } catch (final Throwable e) {
