You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by "Andreas Veithen (JIRA)" <ji...@apache.org> on 2008/05/19 23:59:55 UTC

[jira] Created: (WSCOMMONS-348) A single instance of OMDOMFactory can't be used to create multiple documents

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.


[jira] Resolved: (WSCOMMONS-348) A single instance of OMDOMFactory can't be used to create multiple documents

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSCOMMONS-348?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Veithen resolved WSCOMMONS-348.
---------------------------------------

    Resolution: Won't Fix

This issue is not fixable (at least not easily) due to the fact that DOM requires nodes to have an owner document even if they have not yet been added to a tree. I updated the Javadoc of OMAbstractFactory and OMDOMFactory to explain this and to specify the restrictions that apply to the usage of OMDOMFactory.

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