Get rid of the setDOOMRequired hack
-----------------------------------

                 Key: WSCOMMONS-412
                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-412
             Project: WS-Commons
          Issue Type: Improvement
          Components: AXIOM
         Environment: N/A
            Reporter: Andreas Veithen
            Priority: Minor


The DocumentBuilderFactoryImpl class has static methods that allow to switch 
between DOOM and the default DOM implementation as returned by JAXP. This was a 
hack introduced for Rampart. Recent versions of Rampart no longer rely on this 
hack. On the other hand usage of setDOOMRequired in a concurrent environment 
can lead to unexpected behavior and severe bugs, as shown in WSCOMMONS-210 and 
AXIS2-1570. Therefore we should get rid of this hack.

We should do this in a way that doesn't break existing code and with a clear 
migration path. The proposal is to first deprecate the related methods and to 
remove them altogether in the next major release.

One problem is the current implementation of newDocumentBuilder:

public DocumentBuilder newDocumentBuilder() throws ParserConfigurationException 
{
    return isDOOMRequired() ? new DocumentBuilderImpl(this) : 
originalDocumentBuilderFactory.newDocumentBuilder();
}

Since isDOMMRequired returns false by default, this means that the current 
implementation of DocumentBuilderFactoryImpl can only be used in a meaningful 
way in conjunction with setDOOMRequired. This in turn implies that deprecation 
of setDOOMRequired is not sufficient.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to