[ 
https://issues.apache.org/jira/browse/JENA-2193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17439228#comment-17439228
 ] 

Henry Kuijpers commented on JENA-2193:
--------------------------------------

I'm sorry, I wanted to do this yesterday, but I got involved in other things.
Here is a minimal use-case:

{code:java}
ModelFactory.createDefaultModel().read(new ByteArrayInputStream(("<rdf:RDF 
xmlns:dcterms=\"http://purl.org/dc/terms/\"; 
xmlns:nbc=\"http://data.bibliotheek.nl/ns/nbc#\"; 
xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"; 
xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\";>\n" +     "    
<rdf:Description rdf:about=\"http://data.bibliotheek.nl/ggc/ppn/425871568\";>\n" 
+     "        <dcterms:isPartOf>\n" +     "            <rdf:Description>\n" +  
   "                <rdfs:label>Foeksia de miniheks</rdfs:label>\n" +     "     
           <dcterms:isFormatOf 
rdf:resource=\"http://data.bibliotheek.nl/ggc/ppn/352103043\"; />\n" +     "     
       </rdf:Description>\n" +     "        </dcterms:isPartOf>\n" +     "    
</rdf:Description>\n" +     "    <rdf:Description 
rdf:about=\"http://data.bibliotheek.nl/ggc/ppn/425871568\";>\n" +     "        
<nbc:isPartOf nbc:source=\"ggc\" nbc:type=\"serie\" 
nbc:identifier=\"PPN:352103043\">\n" +     "            <nbc:title>Foeksia de 
miniheks</nbc:title>\n" +     "        </nbc:isPartOf>\n" +     "    
</rdf:Description>\n" +     "</rdf:RDF>").getBytes(StandardCharsets.UTF_8)), 
null);
{code}


> XMLHandler#endElement can throw NPE
> -----------------------------------
>
>                 Key: JENA-2193
>                 URL: https://issues.apache.org/jira/browse/JENA-2193
>             Project: Apache Jena
>          Issue Type: Improvement
>            Reporter: Henry Kuijpers
>            Priority: Major
>
> In our case:
> {code:java}
> package org.apache.jena.rdfxml.xmlinput.impl;
> public class XMLHandler extends ... {
>     public void endElement(String uri, String localName, String rawName) 
> throws SAXException {
>         this.frame.endElement();
>         this.frame = this.frame.getParent();
>         this.frame.afterChild();
>     }
> }
> {code}
> The result of getParent was null, which triggered a NullPointerException. 
> However, maybe the issue is one of the upper layers (I'm not too familiar 
> with all the internals of JENA/RDF and I also don't see any nullability 
> annotations)?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to