You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2015/10/09 01:02:26 UTC

[jira] [Created] (CALCITE-915) Tests do not unset ThreadLocal values on exit

Julian Hyde created CALCITE-915:
-----------------------------------

             Summary: Tests do not unset ThreadLocal values on exit
                 Key: CALCITE-915
                 URL: https://issues.apache.org/jira/browse/CALCITE-915
             Project: Calcite
          Issue Type: Bug
            Reporter: Julian Hyde
            Assignee: Julian Hyde


A few tests give different results if run as part of the suite than if run individually. The reason is that previous tests that share the same ThreadLocal instances had not set the value back on exit.

Add a class TryThreadLocal extends ThreadLocal with a 'push' method that returns a Closeable memo that can be used in a try-with-resources block. The memo remembers the previous value and assigned that when close is called.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)