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
- relates to
-
SIS-139 NullPointerException during unmarshalling of an empty collection
- Closed