db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mamta A. Satoor (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-3338) CancelQueryTask.forgetContext() could be simplified.
Date Thu, 12 Jun 2008 15:56:45 GMT

    [ https://issues.apache.org/jira/browse/DERBY-3338?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12604552#action_12604552
] 

Mamta A. Satoor commented on DERBY-3338:
----------------------------------------

Migrated the changes into 10.3.3.1 codeline also with revision 667136.

> 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.


Mime
View raw message