Skip to content
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

Initialization warning when extending PropertyNamingStrategies.UpperCamelCaseStrategy #4402

Closed
1 task done
ashok-oweal opened this issue Feb 29, 2024 · 2 comments
Closed
1 task done
Labels
need-test-case To work on issue, a reproduction (ideally unit test) needed

Comments

@ashok-oweal
Copy link

ashok-oweal commented Feb 29, 2024

Search before asking

  • I searched in the issues and found nothing similar.

Describe the bug

I have extended PropertyNamingStrategies.UpperCamelCaseStrategy to have my custom implementation.Below is my code.
I am using jackson-databind-2.16.1.jar.

public class ODataCaseStrategy extends PropertyNamingStrategies.UpperCamelCaseStrategy
{
    @Override
    public String translate(final String input)
    {
        if ("d".equals(input) || "results".equals(input))
        {
            return input;
        }
        else if ("ID".equalsIgnoreCase(input))
        {
            return "ID";
        }
        else
        {
            return super.translate(input);
        }
    }
}

I am getting the below warning.
WARNING: PropertyNamingStrategy.ODataCaseStrategy is used but it has been deprecated due to risk of deadlock. Consider using PropertyNamingStrategies.ODataCaseStrategy instead. See #2715 for more details.

Can someone provide a solution for this?

Version Information

jackson-databind-2.16.1.jar

Reproduction

<-- Any of the following

  1. Brief code sample/snippet: include here in preformatted/code section
  2. Longer example stored somewhere else (diff repo, snippet), add a link
  3. Textual explanation: include here
    -->
// Your code here

Expected behavior

No response

Additional context

No response

@ashok-oweal ashok-oweal added the to-evaluate Issue that has been received but not yet evaluated label Feb 29, 2024
@cowtowncoder
Copy link
Member

This is very weird: warning should only be printed for instances that extend PropertyNamingStrategy.PropertyNamingStrategyBase -- and ODataCaseStrategy does not seem to extend it directly or indirectly.

At this point a unit test showing the issue would be necessary (either embedded in comment here or as PR).

@cowtowncoder cowtowncoder added need-test-case To work on issue, a reproduction (ideally unit test) needed and removed to-evaluate Issue that has been received but not yet evaluated labels Mar 1, 2024
@cowtowncoder
Copy link
Member

Cannot reproduce, closing. May be reopened with FULL reproduction (class, unit test, some stand-alone thing).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-test-case To work on issue, a reproduction (ideally unit test) needed
Projects
None yet
Development

No branches or pull requests

2 participants