Axiom
  1. Axiom
  2. AXIOM-410

Exception when called setPrefix method of ElementImpl in axiom-dom

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.12
    • Fix Version/s: 1.2.13
    • Component/s: DOOM
    • Labels:
    • Environment:
      Ubuntu, jdk1.6.0_23

      Description

      In axiom-dom NodeImpl's [1] "setPrefix" method is implemented as follows,

      public void setPrefix(String prefix) throws DOMException

      { throw new DOMException(DOMException.NAMESPACE_ERR, DOMMessageFormatter .formatMessage(DOMMessageFormatter.DOM_DOMAIN, DOMException.NAMESPACE_ERR, null)); }

      According to current trunk the "setPrefix" method is not overridden at
      any child class. But this method is called from opensaml framework
      when document builder is set to axiom-dom one. Above method is called for Element (ElementImpl). Thus it throws DOMException.

      I am not sure why we should throw an Exception for Element. I override method with an empty body and according to my tests it works fine. (I have attached the patch).

      Please review the patch and apply.

      Thanks
      AmilaJ

      1. setprefix.diff
        0.7 kB
        Amila Jayasekara

        Issue Links

          Activity

          Hide
          Amila Jayasekara added a comment -

          Thanks Andreas.

          • AmilaJ
          Show
          Amila Jayasekara added a comment - Thanks Andreas. AmilaJ
          Hide
          Hudson added a comment -

          Integrated in ws-axiom-trunk #789 (See https://builds.apache.org/job/ws-axiom-trunk/789/)
          AXIOM-410: Correctly implement Node#setPrefix for Element and Attr nodes.

          veithen :
          Files :

          • /webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/DOMTestSuiteBuilder.java
          • /webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr
          • /webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestSetPrefixNotNullWithNamespace.java
          • /webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestSetPrefixNotNullWithoutNamespace.java
          • /webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestSetPrefixNotNullWithNamespace.java
          • /webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestSetPrefixNotNullWithoutNamespace.java
          • /webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestSetPrefixNull.java
          • /webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/text/TestSetPrefix.java
          • /webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttrImpl.java
          • /webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
          • /webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NamedNode.java
          • /webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NamedNodeHelper.java
          Show
          Hudson added a comment - Integrated in ws-axiom-trunk #789 (See https://builds.apache.org/job/ws-axiom-trunk/789/ ) AXIOM-410 : Correctly implement Node#setPrefix for Element and Attr nodes. veithen : Files : /webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/DOMTestSuiteBuilder.java /webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr /webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestSetPrefixNotNullWithNamespace.java /webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestSetPrefixNotNullWithoutNamespace.java /webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestSetPrefixNotNullWithNamespace.java /webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestSetPrefixNotNullWithoutNamespace.java /webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestSetPrefixNull.java /webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/text/TestSetPrefix.java /webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttrImpl.java /webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java /webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NamedNode.java /webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NamedNodeHelper.java
          Hide
          Andreas Veithen added a comment -

          I think that "Do nothing" isn't a correct implementation for setPrefix either...

          Show
          Andreas Veithen added a comment - I think that "Do nothing" isn't a correct implementation for setPrefix either...
          Hide
          Amila Jayasekara added a comment -

          Patch is created relative to trunk/modules/axiom-dom.

          Thanks
          AmilaJ

          Show
          Amila Jayasekara added a comment - Patch is created relative to trunk/modules/axiom-dom. Thanks AmilaJ

            People

            • Assignee:
              Andreas Veithen
              Reporter:
              Amila Jayasekara
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development