A single instance of OMDOMFactory can't be used to create multiple documents
----------------------------------------------------------------------------

                 Key: WSCOMMONS-348
                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-348
             Project: WS-Commons
          Issue Type: Bug
          Components: AXIOM
            Reporter: Andreas Veithen


OMDOMFactory contains the following code:

    protected DocumentImpl document;

    public OMDocument createOMDocument() {
        if (this.document == null)
            this.document = new DocumentImpl(this);

        return this.document;
    }

This means that when createOMDocument is invoked several times on the same 
OMDOMFactory instance, the same OMDocument object is returned, i.e. a single 
instance of OMDOMFactory can't be used to create multiple documents. This is OK 
if DOOMAbstractFactory was used to obtain the OMDOMFactory because it creates a 
new instance each time. However OMAbstractFactory considers the factories as 
singletons and therefore configuring OMDOMFactory as the default OMFactory 
leads to unexpected results.

-- 
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