I have the following code in order to set the Entity Expansion limit in Java with JDK8:
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
documentBuilderFactory.setAttribute(Constants.JDK_ENTITY_EXPANSION_LIMIT, "1000");
DocumentBuilder docBuilder = documentBuilderFactory.newDocumentBuilder();
And these are the corresponding packages I'm importing:
import javax.xml.parsers.DocumentBuilderFactory;
import com.sun.org.apache.xerces.internal.impl.Constants;
I need to migrate from JDK8 to JDK11 and unfortunately the com.sun.org.apache.xerces.internal.impl.Constants
package is not supported in JDK11 anymore.
What is the alternative in JDK11? is there another package with this JDK_ENTITY_EXPANSION_LIMIT
constant that is supported in JDK11?