Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 96565 invoked from network); 9 Jun 2008 20:01:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Jun 2008 20:01:10 -0000 Received: (qmail 92991 invoked by uid 500); 9 Jun 2008 20:01:08 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 92904 invoked by uid 500); 9 Jun 2008 20:01:08 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 92876 invoked by uid 99); 9 Jun 2008 20:01:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Jun 2008 13:01:08 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Jun 2008 20:00:27 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 24E08234C139 for ; Mon, 9 Jun 2008 13:00:45 -0700 (PDT) Message-ID: <1894586634.1213041645150.JavaMail.jira@brutus> Date: Mon, 9 Jun 2008 13:00:45 -0700 (PDT) From: "Mamta A. Satoor (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-3338) CancelQueryTask.forgetContext() could be simplified. In-Reply-To: <31744788.1200956314640.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-3338?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mamta A. Satoor updated DERBY-3338: ----------------------------------- Attachment: DERBY_3338_rework_forgetContext_v1.diff > 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 > 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.