@@ -0,0 +1,2084 @@
+package io.quarkus.jdbc.postgresql.runtime.graal;%0A%0Aimport javax.xml.XMLConstants;%0A%0Aimport com.oracle.svm.core.annotate.Alias;%0Aimport com.oracle.svm.core.annotate.Substitute;%0Aimport com.oracle.svm.core.annotate.TargetClass;%0A%0A/**%0A * Some features which are being set by DefaultPGXmlFactoryFactory#setFactoryProperties%0A * by default are not supported by the current GraalVM version: when using them they%0A * will result in fatal errors.%0A * These same features are also not supported in JVM mode, except that when running in JVM%0A * these errors are caught and ignored, rather than crashing the application; so the solution%0A * seems simple: ignore these features.%0A */%0A@TargetClass(className = %22org.postgresql.xml.DefaultPGXmlFactoryFactory%22)%0Apublic final class UnsupportedTransformerFactoryFeatures %7B%0A%0A    @Substitute%0A    private static void setFactoryProperties(Object factory) %7B%0A        setFeatureQuietly(factory, XMLConstants.FEATURE_SECURE_PROCESSING, true);%0A        //%09%09setFeatureQuietly(factory, %22http://apache.org/xml/features/disallow-doctype-decl%22, true);%0A        //%09%09setFeatureQuietly(factory, %22http://apache.org/xml/features/nonvalidating/load-external-dtd%22, false);%0A        //%09%09setFeatureQuietly(factory, %22http://xml.org/sax/features/external-general-entities%22, false);%0A        //%09%09setFeatureQuietly(factory, %22http://xml.org/sax/features/external-parameter-entities%22, false);%0A        // Values from XMLConstants inlined for JDK 1.6 compatibility%0A        setAttributeQuietly(factory, %22http://javax.xml.XMLConstants/property/accessExternalDTD%22, %22%22);%0A        //%09%09setAttributeQuietly(factory, %22http://javax.xml.XMLConstants/property/accessExternalSchema%22, %22%22);%0A        setAttributeQuietly(factory, %22http://javax.xml.XMLConstants/property/accessExternalStylesheet%22, %22%22);%0A    %7D%0A%0A    @Alias%0A    private static void setFeatureQuietly(Object factory, String name, boolean value) %7B%0A        //no-op : will use the original code%0A    %7D%0A%0A    @Alias%0A    private static void setAttributeQuietly(Object factory, String name, Object value) %7B%0A        //no-op : will use the original code%0A    %7D%0A%0A%7D%0A

Introduce a Substitution to fix PostgreSQL's driver handling of XML default features