Conversation
…ethods * getGenericType is removed completely in Jackson 2.11 * This fix allows Druid to compile with Jackson 2.12+ as well as for existing distributions to replace version 2.10 with 2.12 at runtime.
| throw new IAE("Annotated methods don't work very well yet..."); | ||
| } | ||
| return Key.get(m.getGenericType()); | ||
| return Key.get(m.getRawType()); |
There was a problem hiding this comment.
/**
* JDK declared generic type of the annotated element; definition
* of what exactly this means depends on sub-class. Note that such type
* cannot be reliably resolved without {@link TypeResolutionContext}, and
* as a result use of this method was deprecated in Jackson 2.7: see
* {@link #getType} for replacement.
*
* @deprecated Since 2.7 should instead use {@link #getType()}. To be removed from 2.9
*/I'm a little confused that the javadoc indicates that getType should be used as a replacement, and current getGenericType calls getRawType() internally.
There was a problem hiding this comment.
Hmm good catch. Here's some more confusion for the pile. getType was marked deprecated in 2.10 as well but seems to be un-deprecated in 2.11+
I can swap this to getType() instead if that is preferred.
There was a problem hiding this comment.
I didn't see that getType was marked deprecated in 2.10 from the link above. Instead public final JavaType getType(TypeBindings bogus) was marked deprecated.
IMO, it's better to follow the javadoc the replace the deprecated API.
There was a problem hiding this comment.
Sorry for the delay on getting back to you.
Oof yep I misread. I will update this Pull Request!
There was a problem hiding this comment.
Seems like the Javadoc recommendation doesn't work the same and getRawType is what we want here.
I'm working on getting tests building locally, I was using JDK17 which I see is a no-no in the build instructions. Sorry for the churn on this. Are you okay with pulling 671c984 as is?
|
This pull request has been marked as stale due to 60 days of inactivity. |
|
This pull request/issue has been closed due to lack of activity. If you think that |
Description
Druid uses deprecated Jackson methods
getGenericType. This method was deprecated in Jackson 2.7 and is dropped in Jackson 2.11This PR allows any version of Druid built with Jackson 2.10 to be able to run against more recent versions of Jackson in its classpath
This PR also allows Druid to build against both Jackson 2.10 and Jackson 2.12, setting it up to migrate should any Jackson security issues be exposed in older version.
This PR has: