sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Desruisseaux (JIRA)" <j...@apache.org>
Subject [jira] [Created] (SIS-157) NullPointerException during unmarshalling of an empty codeListValue attribute
Date Thu, 26 Dec 2013 04:01:50 GMT
Martin Desruisseaux created SIS-157:
---------------------------------------

             Summary: NullPointerException during unmarshalling of an empty codeListValue
attribute
                 Key: SIS-157
                 URL: https://issues.apache.org/jira/browse/SIS-157
             Project: Spatial Information Systems
          Issue Type: Bug
          Components: Metadata
    Affects Versions: 0.3
            Reporter: Martin Desruisseaux
            Assignee: Martin Desruisseaux
             Fix For: 0.4


Unmarshalling the following XML fragment:

{code:xml}
<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>
{code}

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

{noformat}
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...)
{noformat}

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.




--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message