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

Remove getClass() from _valueType argument for error reporting #1907

Closed
wants to merge 1 commit into from

Conversation

jschaf
Copy link

@jschaf jschaf commented Jan 22, 2018

From ErrorProne:

src/main/java/com/fasterxml/jackson/databind/deser/std/FactoryBasedEnumDeserializer.java:184: error: [GetClassOnClass] Calling getClass() on an object of type Class returns the Class object for java.lang.Class; you probably meant to operate on the object directly
                wrapAndThrow(e, _valueClass.getClass(), prop.getName(), ctxt);
                                                    ^
    (see http://errorprone.info/bugpattern/GetClassOnClass)
  Did you mean 'wrapAndThrow(e, _valueClass, prop.getName(), ctxt);' or 'wrapAndThrow(e, Class.class, prop.getName(), ctxt);'?

From ErrorProne:

src/main/java/com/fasterxml/jackson/databind/deser/std/FactoryBasedEnumDeserializer.java:184: error: [GetClassOnClass] Calling getClass() on an object of type Class returns the Class object for java.lang.Class; you probably meant to operate on the object directly
                wrapAndThrow(e, _valueClass.getClass(), prop.getName(), ctxt);
                                                    ^
    (see http://errorprone.info/bugpattern/GetClassOnClass)
  Did you mean 'wrapAndThrow(e, _valueClass, prop.getName(), ctxt);' or 'wrapAndThrow(e, Class.class, prop.getName(), ctxt);'?
@cowtowncoder
Copy link
Member

Good catch, yes. I'll probably patch this manually in 2.9: thank you for submitting the fix!

@cowtowncoder cowtowncoder changed the title Remove getClass from Class type Remove getClass() from _valueType argument for error reporting Jan 23, 2018
@cowtowncoder cowtowncoder added this to the 2.9.4 milestone Jan 23, 2018
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

Successfully merging this pull request may close these issues.

2 participants