commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitri Blinov (JIRA)" <j...@apache.org>
Subject [jira] [Created] (JEXL-189) Possible bug in Interpreter.isCancelled()
Date Mon, 01 Feb 2016 12:06:39 GMT
Dmitri Blinov created JEXL-189:
----------------------------------

             Summary: Possible bug in Interpreter.isCancelled()
                 Key: JEXL-189
                 URL: https://issues.apache.org/jira/browse/JEXL-189
             Project: Commons JEXL
          Issue Type: Bug
    Affects Versions: 3.0
            Reporter: Dmitri Blinov
            Priority: Trivial


Reported by FindBugs is the message: 

"Questionable use of non-short-circuit logic in org.apache.commons.jexl3.internal.Interpreter.isCancelled()"

{code}
    protected boolean isCancelled() {
        if (cancelled | Thread.interrupted()) {
            cancelled = true;
        }
        return cancelled;
    }
{\code}

Maybe it is better to replace method as 

{code}
    protected boolean isCancelled() {
        if (Thread.interrupted())
            cancelled = true;

        return cancelled;
    }
{\code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message