commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Gainty (JIRA)" <>
Subject [jira] [Created] (CONFIGURATION-585) Hardcoded Parameters prevents correct initialisation of XML DocumentBuilder
Date Sat, 12 Jul 2014 01:34:06 GMT
Martin Gainty created CONFIGURATION-585:

             Summary: Hardcoded Parameters prevents correct initialisation of XML DocumentBuilder
                 Key: CONFIGURATION-585
             Project: Commons Configuration
          Issue Type: Bug
          Components: File reloading
    Affects Versions: 1.8
         Environment: JDK
MvN 3.0.5
            Reporter: Martin Gainty
            Priority: Blocker
             Fix For: 2.0

 protected DocumentBuilder createDocumentBuilder()
            throws ParserConfigurationException
        if (getDocumentBuilder() != null)
            return getDocumentBuilder();
            DocumentBuilderFactory factory = DocumentBuilderFactory
            if (isValidating())
                if (isSchemaValidation())
                    factory.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);

            DocumentBuilder result = factory.newDocumentBuilder();

            if (isValidating())
                // register an error handler which detects validation errors
                result.setErrorHandler(new DefaultHandler()
                    public void error(SAXParseException ex) throws SAXException
                        throw ex;
            return result;
There is no way to externally set any of these parameters
I propose 2 changes
1)read properties from pom.xml
2)morph this into a XMLConfigurationPlugin which will run goal to set the params from configuration
for new commons-configuration-plugin
(Bug originally reported by Ron DiFrango from CapitalOne)
Martin Gainty
11 July 2014

This message was sent by Atlassian JIRA

View raw message