[ 
https://issues.apache.org/jira/browse/DERBY-3338?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mamta A. Satoor updated DERBY-3338:
-----------------------------------

    Fix Version/s: 10.4.1.4

> CancelQueryTask.forgetContext() could be simplified.
> ----------------------------------------------------
>
>                 Key: DERBY-3338
>                 URL: https://issues.apache.org/jira/browse/DERBY-3338
>             Project: Derby
>          Issue Type: Improvement
>          Components: Newcomer, Services, SQL
>            Reporter: Daniel John Debrunner
>            Assignee: Mamta A. Satoor
>            Priority: Minor
>             Fix For: 10.4.1.4, 10.5.0.0
>
>         Attachments: DERBY_3338_rework_forgetContext_v1.diff
>
>
> Minor issue but CancelQueryTask.forgetContext() has this code (in 
> GenericStatementContext.java)
>         public void forgetContext() {
>             boolean mayStillRun = !cancel();
>             if (mayStillRun) {
>                 synchronized (this) {
>                     statementContext = null;
>                 }
>             }
>         }
> The mayStillRun = !cancel() is somewhat confusing. I can't see from the 
> javadoc of TimerTask.cancel() how its return value could indicate the task 
> may still run.
> Less confusing code could be:
>         public void forgetContext() {
>                synchronized (this) {
>                     statementContext = null;
>                 }
>                 cancel();
>         }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Reply via email to