Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-3338

CancelQueryTask.forgetContext() could be simplified.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 10.4.2.0, 10.5.1.1
    • Services, SQL
    • None

    Description

      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();
      }

      Attachments

        Issue Links

          Activity

            People

              mamtas Mamta A. Satoor
              djd Daniel John Debrunner
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: