Skip to content

Incompatible Constructor Parameter Type in EnumDeserializer #4581

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

Closed
Hunter-Lam opened this issue Jun 14, 2024 · 1 comment
Closed

Incompatible Constructor Parameter Type in EnumDeserializer #4581

Hunter-Lam opened this issue Jun 14, 2024 · 1 comment

Comments

@Hunter-Lam
Copy link

Hunter-Lam commented Jun 14, 2024

Code Link

public EnumDeserializer(EnumResolver byNameResolver, boolean caseInsensitive,

Description

Type of caseInsensitive should be Boolean instead of boolean. Otherwise, when using contructors without caseInsensitive, e.g. EnumDeserializer(com.fasterxml.jackson.databind.util.EnumResolver), will cause NullPointerException.

Version Information

since 2.15.0

Exception Related to 2.15.4 Version

java.lang.NullPointerException: Cannot invoke "java.lang.Boolean.booleanValue()" because "caseInsensitive" is null
	at com.fasterxml.jackson.databind.deser.std.EnumDeserializer.<init>(EnumDeserializer.java:82)
	at com.fasterxml.jackson.databind.deser.std.EnumDeserializer.<init>(EnumDeserializer.java:131)
...
@Hunter-Lam Hunter-Lam changed the title Incompatible contructor parameter type in EnumDeserializer Incompatible Constructor Parameter Type in EnumDeserializer Jun 14, 2024
@cowtowncoder cowtowncoder changed the title Incompatible Constructor Parameter Type in EnumDeserializer Incompatible Constructor Parameter Type in EnumDeserializer Jun 15, 2024
@cowtowncoder
Copy link
Member

Ok I see what you mean; there is a sub-optimal mix of primitive and wrapper: ideally it'd actually be boolean (primitive), I think.

Regardless I cannot simply change type as signature change is compatibility breaking, but I can easily add handling of nulls where applicable.

I will merge fix in 2.15 but it is unlikely there will be new 2.15 releases; so fix will be released first either in 2.16(.3) or 2.17(.2).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants