History | Log In     View a printable version of the current page. Get help!  
Issue Details [XML]

Key: SES-693
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Unassigned
Reporter: Nick Giles
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Sesame

TriXParser throws NullPointerException on use

Created: 11/Dec/09 04:42 PM   Updated: 15/Dec/09 07:32 PM
Component/s: Rio
Affects Version/s: 2.3.0
Fix Version/s: None


 Description   
The following code will throw a null pointer exception:

RDFParser parser = Rio.createParser(RDFFormat.TRIX);
parser.parse(new ByteArrayInputStream(("<trix>" + "<graph><triple>"
+ "<uri>http://example.org/Bob&lt;/uri>" + "<uri>http://example.org/wife&lt;/uri>"
+ "<uri>http://example.org/Mary&lt;/uri>" + "</triple></graph>" + "</trix>")
.getBytes()), "");

Don't know whether this is somehow related to the fix for SES-691, but just in case it is, the following test case should also work:

public void testTrixParserErrorHandling() throws Exception {
RDFParser parser = Rio.createParser(RDFFormat.TRIX);
try {
parser.parse(new ByteArrayInputStream("rubbish".getBytes()), "");
fail("Parse should not succeed.");
} catch(RDFParseException e) {
//Expected
}
}

 All   Comments   Change History      Sort Order:
Comment by Nick Giles [11/Dec/09 05:22 PM]
Never mind, I was missing a line in the tests to set an RDFHandler. Apologies.