mariofusco commented on code in PR #5944:
URL:
https://github.com/apache/incubator-kie-drools/pull/5944#discussion_r1600187175
##########
drools-model/drools-model-codegen/src/main/java/org/drools/model/codegen/execmodel/generator/expressiontyper/ExpressionTyper.java:
##########
@@ -922,16 +923,7 @@ private TypedExpressionCursor
parseMethodCallExpr(MethodCallExpr methodCallExpr,
return new TypedExpressionCursor(methodCallExpr,
((ParameterizedType) originalTypeCursor).getActualTypeArguments()[0]);
}
- java.lang.reflect.Type genericReturnType = m.getGenericReturnType();
- if (genericReturnType instanceof TypeVariable) {
- if (originalTypeCursor instanceof ParameterizedType) {
- return new TypedExpressionCursor( methodCallExpr,
getActualType( rawClassCursor, ( ParameterizedType ) originalTypeCursor, (
TypeVariable ) genericReturnType ) );
- } else {
- return new TypedExpressionCursor(methodCallExpr, Object.class);
- }
- } else {
- return new TypedExpressionCursor(methodCallExpr,
genericReturnType);
- }
+ return new TypedExpressionCursor(methodCallExpr,
actualTypeFromGenerics(originalTypeCursor, m.getGenericReturnType(),
rawClassCursor));
Review Comment:
All the logic to deal with generics introspection has been moved in static
utility methods of `ClassUtils`.
--
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]