-
Notifications
You must be signed in to change notification settings - Fork 26
fix: Allow to remove a ThreadLocalAccessor by Key of Type Object #413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 1.1.x
Are you sure you want to change the base?
Conversation
I'd guess it's a breaking change for binary compatibility (side note: we should probably have japicmp setup to detect breaking changes). I think we can work around it by having a method that takes a String and delegates to the new method with argument type Object. |
I agree :) However, I fear we should not have a situation like this:
I am worried about this for two reasons:
How about the existing method gets deprecated and a new method is added:
|
Sure, feel free to change the PR or to close it by adding a new one. Thanks. |
Deprecation in a minor or major sounds fine to eventually migrate to a corrected method signature. For a backport, we could simply introduce the additional method to avoid any potential disruption. |
@boubaker are you interested in modifying this PR according to the above consensus?
|
52ea54c
to
795442c
Compare
The `ThreadLocalAccessor.key()` is of Type Object. Thus, when it comes to delete a predefined `ThreadLocalAccessor` which have a non-String key, it's becomes impossible to delete. This behavior was observed while attempting to remove `org.springframework.security.core.context.ReactiveSecurityContextHolderThreadLocalAccessor` from the `ContextRegistry`, which have a key of type `java.lang.Class`. This change will add a dedicated method to allow deleting a `ThreadLocalAccessor` identified by its key of type `java.lang.Object`. Signed-off-by: Boubaker Khanfir <[email protected]>
Yes, I 'm ok with the fix as well. Thanks for your help |
Please let me know if that's ok for you, I 'll close this one. |
The
ThreadLocalAccessor.key()
is of Type Object. Thus, when it comes to delete a predefinedThreadLocalAccessor
which have a non-String key, it's becomes impossible to delete. This behavior was observed while attempting to removeorg.springframework.security.core.context.ReactiveSecurityContextHolderThreadLocalAccessor
from theContextRegistry
, which have a key of typejava.lang.Class
.This change will just switch the method parameter in order to support the Type
java.lang.Object
as key, which shouldn't be a breaking change, even in a minor version.