Github user afs commented on a diff in the pull request:

    https://github.com/apache/jena/pull/366#discussion_r170642885
  
    --- Diff: 
jena-arq/src/main/java/org/apache/jena/riot/lang/ReaderRIOTRDFXML.java ---
    @@ -116,17 +154,29 @@ public void parse() {
             arp.getHandlers().setErrorHandler(rslt) ;
             arp.getHandlers().setNamespaceHandler(rslt) ;
     
    +        // ARPOptions.
    +        ARPOptions arpOptions = arp.getOptions() ;
             if ( RiotUniformCompatibility ) {
    -            ARPOptions options = arp.getOptions() ;
                 // Convert some warnings to errors for compatible behaviour 
for all parsers.
                 for ( int code : additionalErrors )
    -                options.setErrorMode(code, ARPErrorNumbers.EM_ERROR) ;
    -            arp.setOptionsWith(options) ;
    +                arpOptions.setErrorMode(code, ARPErrorNumbers.EM_ERROR) ;
             }
             
             if ( JenaRuntime.isRDF11 )
                 arp.getOptions().setIRIFactory(IRIResolver.iriFactory());
     
    +        if ( context != null ) {
    +            try { 
    +                @SuppressWarnings("unchecked")
    +                Map<String, Object> p = (Map<String, 
Object>)(context.get(SysRIOT.sysRdfReaderProperties)) ;
    +                if ( p != null )
    +                    p.forEach((k,v) -> oneProperty(arpOptions, k, v)) ;
    +            } catch (Throwable ex) {
    +                Log.warn(AdapterRDFWriter.class, "Problem setting 
properties", ex);
    --- End diff --
    
    Will revise. The important item being covered is the class cast (maybe it 
should throw a meaningful exception?)  If `oneProperty` throws an exception, it 
can propagate as normal.


---

Reply via email to