CookieAroundTheBend commented on code in PR #13244:
URL: https://github.com/apache/druid/pull/13244#discussion_r1028096351
##########
core/src/main/java/org/apache/druid/guice/GuiceAnnotationIntrospector.java:
##########
@@ -58,9 +58,9 @@ public Object findInjectableValueId(AnnotatedMember m)
if (m instanceof AnnotatedMethod) {
throw new IAE("Annotated methods don't work very well yet...");
}
- return Key.get(m.getGenericType());
+ return Key.get(m.getType());
}
- return Key.get(m.getGenericType(), guiceAnnotation);
+ return Key.get(m.getType(), guiceAnnotation);
}
Review Comment:
```suggestion
return Key.get(getParamType(m), guiceAnnotation);
}
private Type getParamType(AnnotatedMember m) {
if(m.getType().isContainerType()){
return Types.newParameterizedType(m.getType().getRawClass(),
m.getType().getContentType().getRawClass());
}
return m.getRawType();
}
```
This seems to work for me (and of course changing the Key.get(m.getType());
to Key.get(getParamType(m)); on line 61.
But this was on version 0.22.1 and I'm not sure if this is as robust
handling that could be needed.
--
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]