You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Biestro (JIRA)" <ji...@apache.org> on 2016/02/23 19:07:18 UTC
[jira] [Resolved] (JEXL-189) Possible bug in
Interpreter.isCancelled()
[ https://issues.apache.org/jira/browse/JEXL-189?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Henri Biestro resolved JEXL-189.
--------------------------------
Resolution: Fixed
Used this opportunity to avoid tinkering with the thread interruption status (see Goetz - Java concurrency in practice @ 7.1 p 141)
src/main/java/org/apache/commons/jexl3/internal/Interpreter.java
Committed revision 1731917.
> 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
> Assignee: Henri Biestro
> Priority: Trivial
> Fix For: 3.1
>
>
> 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)