-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Drop deprecated (in 2.12) PropertyNamingStrategy
implementations from 2.20
#4136
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
Comments
🔍 Reasons
📑 Todo's (More like what I think we can do)
In essencePragmatic perspective, not dropping the deprecated will improve things. |
PropertyNamingStrategy
implementations from 2.17 or laterPropertyNamingStrategy
implementations from 2.17 or later
Thank you for raising this topic. I personally prefer to drop these fields even in 2.x series because impact of dead-lock issue caused by these deprecated classes is significant depending on the use case even though it could happen very rarely. However, I also understand importance of backwards compatibility in SemVer concept. That's reason why I raised #4109 which (slightly) mitigates the issue without breaking backwards compatibility. One idea is that mentioning a potential dead-lock in the deprecated message. It may make risk of using deprecated classes easier to notice. However, we have no ways to realize that deprecated classes are used unless recompile from the source code, in particular, if those classes are used inside third-party libraries. I initially thought that producing warning log in a constructor of deprecated classes might be helpful but Jackson doesn't have a logger, unfortunately. Anyway, it would be great if we can do something to reduce risk of dead-lock issue even if deprecated classes will be maintained in 2.x series. |
@takezoe Hmmmh. I'd be ok adding use of JDK-bundled Logger for constructors of deprecated instances. If you or anyone else wanted to do a PR. Jackson tries to avoid use of loggers in general, but this would be reasonable case to use them. We could even combine approach to get logging into 2.16, warning about imminent removal, then consider removal for a later 2.x version (whether 2.17 or later). |
I see. I have seen #2913 that dropped a dependency on |
Yes, if we add logging, would need that to be re-added as part of changes. |
@takezoe does have a point also. |
Created a pull request for warning logs: #4144 |
Merged #4144 so Jackson 2.16 will start warning about usage. We can then consider dropping from 2.17 or perhaps 2.18 (depending on how things go). |
What is the workaround or replacement for using |
@genslein |
Quick note: I don't think this should be yet done for 2.17, will update title. |
PropertyNamingStrategy
implementations from 2.17 or laterPropertyNamingStrategy
implementations from 2.18 or later
PropertyNamingStrategy
implementations from 2.18 or laterPropertyNamingStrategy
implementations from 2.19 or later
Due to timing (2.19.0-rc2 already out), probably has to wait for 2.20... |
PropertyNamingStrategy
implementations from 2.19 or laterPropertyNamingStrategy
implementations from 2.20
(note: inspired by #4109)
As per #2715 there is a nasty race condition possibility for anyone using constants like
PropertyNamingStrategy.LOWER_CAMEL_CASE
or classes themselves likePropertyNamingStrategy.SnakeCaseStrategy.class
; and because of this, constants and implementations were marked as deprecated.But while these are deprecated, problematic usage is still possible. Question then is, for existing legacy usage, which is worse:
Arguably (1) is worse, as even new code could start using problematic classes, constants (when copy-pasting).
At the same time, SemVer would suggest we only remove these from Jackson 3.0 (from which they are removed, see
master
.I propose these classes, constants, would, however, be removed earlier than this, from Jackson 2.17. Please add comments on WDYT.
The text was updated successfully, but these errors were encountered: