Uploaded image for project: 'Spatial Information Systems'
  1. Spatial Information Systems
  2. SIS-157

NullPointerException during unmarshalling of an empty codeListValue attribute

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.3
    • 0.4
    • Metadata
    • None

    Description

      Unmarshalling the following XML fragment:

      <gmd:MD_LegalConstraints>
          <gmd:accessConstraints>
              <gmd:MD_RestrictionCode codeListValue="intellectualPropertyRights" codeList="http://www.isotc211.org/2005/resources/codeList.xml#MD_RestrictionCode"/>
          </gmd:accessConstraints>
          <gmd:useConstraints>
              <gmd:MD_RestrictionCode codeListValue="" codeList="http://www.isotc211.org/2005/resources/codeList.xml#MD_RestrictionCode"/>
          </gmd:useConstraints>
      </gmd:MD_LegalConstraints>
      

      cause the following exception on the second code list element (the one with an empty codeListValue attribute):

      Exception in thread "main" java.lang.NullPointerException
        at org.apache.sis.util.collection.CodeListSet.add(CodeListSet.java:218)
        at org.apache.sis.util.collection.CodeListSet.add(CodeListSet.java:60)
        at com.sun.xml.internal.bind.v2.runtime.reflect.Lister$CollectionLister.addToPack(Lister.java:290)
        (...snip...)
      

      While an empty codeListValue attribute is probably invalid, SIS should be robust to minor errors in XML files. SIS should probably emit a warning however.

      Attachments

        Issue Links

          Activity

            People

              desruisseaux Martin Desruisseaux
              desruisseaux Martin Desruisseaux
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: