You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by rvesse <gi...@git.apache.org> on 2017/10/25 10:27:29 UTC

[GitHub] jena pull request #294: Fix and tests for possible NPE (JENA-1405)

GitHub user rvesse opened a pull request:

    https://github.com/apache/jena/pull/294

    Fix and tests for possible NPE (JENA-1405)

    Fixes a possible NPE in AdaptorFileManager by aligning its behaviour
    with FileManager to throw NotFoundException
    
    Adds specific tests for these cases

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/rvesse/jena JENA-1405

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/jena/pull/294.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #294
    
----
commit 643bd7a944e23554d21d1f01c207fe7e1a3d3098
Author: Rob Vesse <rv...@apache.org>
Date:   2017-10-25T10:26:37Z

    Fix and tests for possible NPE (JENA-1405)
    
    Fixes a possible NPE in AdaptorFileManager by aligning its behaviour
    with FileManager to throw NotFoundException
    
    Adds specific tests for these cases

----


---

[GitHub] jena issue #294: Fix and tests for possible NPE (JENA-1405)

Posted by afs <gi...@git.apache.org>.
Github user afs commented on the issue:

    https://github.com/apache/jena/pull/294
  
    More recently, `FmtLog.debug(logger, fmtString, args...)`.


---

[GitHub] jena pull request #294: Fix and tests for possible NPE (JENA-1405)

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/jena/pull/294


---

[GitHub] jena pull request #294: Fix and tests for possible NPE (JENA-1405)

Posted by afs <gi...@git.apache.org>.
Github user afs commented on a diff in the pull request:

    https://github.com/apache/jena/pull/294#discussion_r146905463
  
    --- Diff: jena-arq/src/main/java/org/apache/jena/riot/adapters/AdapterFileManager.java ---
    @@ -285,6 +286,12 @@ protected Model readModelWorker(Model model, String filenameOrURI, String baseUR
             if ( baseURI == null )
                 baseURI = SysRIOT.chooseBaseIRI(filenameOrURI) ;
             try(TypedInputStream in = streamManager.openNoMapOrNull(mappedURI)) {
    +            if ( in == null )
    +            {
    +                if ( log.isDebugEnabled() )
    +                    log.debug("Failed to locate '"+mappedURI+"'") ;
    --- End diff --
    
    More recently, `FmtLog.debug(logger, fmtString, args...)`.


---

[GitHub] jena pull request #294: Fix and tests for possible NPE (JENA-1405)

Posted by ajs6f <gi...@git.apache.org>.
Github user ajs6f commented on a diff in the pull request:

    https://github.com/apache/jena/pull/294#discussion_r146827609
  
    --- Diff: jena-arq/src/main/java/org/apache/jena/riot/adapters/AdapterFileManager.java ---
    @@ -285,6 +286,12 @@ protected Model readModelWorker(Model model, String filenameOrURI, String baseUR
             if ( baseURI == null )
                 baseURI = SysRIOT.chooseBaseIRI(filenameOrURI) ;
             try(TypedInputStream in = streamManager.openNoMapOrNull(mappedURI)) {
    +            if ( in == null )
    +            {
    +                if ( log.isDebugEnabled() )
    +                    log.debug("Failed to locate '"+mappedURI+"'") ;
    --- End diff --
    
    As I understand it, `log.debug("Failed to locate '{}'", mappedURI) ` [avoids the need](https://www.slf4j.org/faq.html#logging_performance) to explicitly check `isDebugEnabled()`.


---

[GitHub] jena pull request #294: Fix and tests for possible NPE (JENA-1405)

Posted by rvesse <gi...@git.apache.org>.
Github user rvesse commented on a diff in the pull request:

    https://github.com/apache/jena/pull/294#discussion_r146852236
  
    --- Diff: jena-arq/src/main/java/org/apache/jena/riot/adapters/AdapterFileManager.java ---
    @@ -285,6 +286,12 @@ protected Model readModelWorker(Model model, String filenameOrURI, String baseUR
             if ( baseURI == null )
                 baseURI = SysRIOT.chooseBaseIRI(filenameOrURI) ;
             try(TypedInputStream in = streamManager.openNoMapOrNull(mappedURI)) {
    +            if ( in == null )
    +            {
    +                if ( log.isDebugEnabled() )
    +                    log.debug("Failed to locate '"+mappedURI+"'") ;
    --- End diff --
    
    Yes, I just copied and pasted this from the parent class where the same logic is present


---