Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-2818

NPE during conversion of object to XML

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 1.7 M2
    • 1.4.1
    • {Unused} Core
    • None
    • NPE BaseObject XML

    Description

      toXML() (which is called by toString()) on a BaseObject may throw a "java.lang.IllegalArgumentException: Adding text to an XML document must not be null" if it is not yet linked to a document and its name has not been set.

      This may be annoying since, for example, current release of Groovy may calls toString() when it prepare the message of exceptions about an object. This cause a double exception, that is not properly chained, and hide the initial cause. Moreover, it is almost impossible to catch the real cause in groovy. Triggering this situation could be done in groovy by creating an object from BaseClass.newObject() and then calling an unexistant method on it.

      Attachments

        Issue Links

          Activity

            People

              sdumitriu Sergiu Dumitriu
              softec Denis Gervalle
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: