mariofusco commented on code in PR #5836:
URL:
https://github.com/apache/incubator-kie-drools/pull/5836#discussion_r1559428184
##########
drools-util/src/main/java/org/drools/util/ClassUtils.java:
##########
@@ -597,11 +595,11 @@ public static Class<?> toRawClass(Type type) {
if (type instanceof Class<?>) {
return ( Class ) type;
}
- if (type instanceof ParameterizedType ) {
+ if (type instanceof ParameterizedType) {
return toRawClass( (( ParameterizedType ) type).getRawType() );
}
- if (type instanceof TypeVariable ) {
- return Object.class;
+ if (type instanceof TypeVariable typeVar) {
+ return typeVar.getBounds().length == 1 ?
toRawClass(typeVar.getBounds()[0]) : Object.class;
Review Comment:
This one-liner is the only actual fix. All other changes are refactors that
I made to improve the code readability (and clarify to myself what was
happening) while investigating this issue.
--
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]