ASF GitHub Bot commented on JENA-1591:

GitHub user kinow opened a pull request:


    JENA-1591: use boolean value in if expression

    Another one found in Eclipse while I was reading some other code for 
UUID's. The value returned from the `Set` object will be a `boolean`, so the 
`== null` won't ever eval to true.
    This pull request uses the expression `! x` as that's what I thought we 
actually wanted to test. But happy to update it if I made the wrong assumption.
    Could not find an easy way to generate a unit test, but if there's some 
simple approach, please let me know and I will update the pull request.

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

    $ git pull https://github.com/kinow/jena JENA-1591

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


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

    This closes #461
commit 76a02057a4f6e43bb1e237bf4caca17c9b395435
Author: Bruno P. Kinoshita <kinow@...>
Date:   2018-08-11T12:59:46Z

    JENA-1591: use boolean value in if expression


> DBOE TransactionCoordinator#finishActiveTransaction has an invalid if with a 
> boolean/Object
> -------------------------------------------------------------------------------------------
>                 Key: JENA-1591
>                 URL: https://issues.apache.org/jira/browse/JENA-1591
>             Project: Apache Jena
>          Issue Type: Improvement
>    Affects Versions: Jena 3.8.0
>            Reporter: Bruno P. Kinoshita
>            Assignee: Bruno P. Kinoshita
>            Priority: Minor
>             Fix For: Jena 3.9.0
> TransactionCoordinator's finishActiveTransaction method calls the Set method: 
> activeTransactions.remove(transaction) ;
> It stores the return value as `x`, and then checks if x == null. As Set 
> returns a boolean, it won't ever be true.
> Submitting a pull request where we actually use the boolean value.
> Another simple issue, but that I could not come up with a simple unit test, 
> sorry.

This message was sent by Atlassian JIRA

Reply via email to