[
https://issues.apache.org/jira/browse/WICKET-4574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13284379#comment-13284379
]
Martin Grigorov commented on WICKET-4574:
-----------------------------------------
The suggested fix is applied in master branch.
Will be applied in 1.5.x after releasing 1.5.7. The fix looks OK but I don't
want to commit it just before the release.
-beta2 is not in the dropdown because it is not released yet. It will be there
once the vote is closed.
> ThreadContext does not properly remove the ThreadLocal from the current thread
> ------------------------------------------------------------------------------
>
> Key: WICKET-4574
> URL: https://issues.apache.org/jira/browse/WICKET-4574
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 6.0.0-beta1
> Reporter: Jesse Long
> Assignee: Martin Grigorov
> Attachments: threadContext.patch
>
>
> Actually, I only checked 6.0.0-beta2 and master, 6.0.0-beta2 is not in the
> drop down.
> ThreadLocal.get() returns the current value, if one is set. If not, it
> creates a new value using the initialValue() method, AND (importantly)
> registers the ThreadLocal in the Thread's Map of ThreadLocals.
> In order for the get(false) method to work as expected, we must actually call
> ThreadLocal.remove() after a ThreadLocal.get() that returned null.
> Also, after the request was processed, we never properly remove the
> ThreadLocal from the Thread, we were simply setting it to the previous value,
> which was null most of the time. This is not enough. The ThreadLocal was
> still attached to the Thread, just the value it was storing was null.
> Here's hoping that Jira is working again and I can attach a patch.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira