github-code-scanning[bot] commented on code in PR #14770:
URL: https://github.com/apache/druid/pull/14770#discussion_r1286411927


##########
processing/src/main/java/org/apache/druid/guice/GuiceAnnotationIntrospector.java:
##########
@@ -54,39 +67,54 @@
       }
     }
 
+    // Annotated.getGenericType() is removed since jackson-databind 2.11 
version. We need the generic type so that we can inject values of the type such 
as List<XYZ> correctly.
+    // Jackson library removed the method on the abstract class but the 
methods are still there in the implementations of AnnotatedMember. The method 
signatures are implementation specific and we are calling those methods to get 
the generic type.
+
+    if (m instanceof AnnotatedField) {
+      genericType = ((AnnotatedField) m).getAnnotated().getGenericType();
+    } else if (m instanceof AnnotatedMethod) {
+      genericType = ((AnnotatedMethod) 
m).getAnnotated().getGenericReturnType();
+    } else if (m instanceof AnnotatedParameter) {
+      genericType = ((AnnotatedParameter) 
m).getOwner().getGenericParameterType(((AnnotatedParameter) m).getIndex());

Review Comment:
   ## Deprecated method or constructor invocation
   
   Invoking [AnnotatedWithParams.getGenericParameterType](1) should be avoided 
because it has been deprecated.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/5415)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to