-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DROOLS-7197] fix generics introspection on superclasses during exec … #5944
Conversation
@@ -164,59 +162,6 @@ public void setter_intToPrimitiveLongCoercionVarargs() { | |||
assertThat(fact.getValueList()).containsExactly(10L, 20L); // Coerced with both cases | |||
} | |||
|
|||
@Test | |||
public void property_subClassMethod_genericsReturnType() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is no longer a difference between interpreted mode and executable model I moved these 2 tests in a different class.
} else { | ||
return Optional.empty(); | ||
} | ||
private static boolean typeNeedsCast(Type t) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Optional wasn't really necessary here since the result was used only as a boolean testing if the Optional was present or not.
} else { | ||
return new TypedExpressionCursor(methodCallExpr, genericReturnType); | ||
} | ||
return new TypedExpressionCursor(methodCallExpr, actualTypeFromGenerics(originalTypeCursor, m.getGenericReturnType(), rawClassCursor)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the logic to deal with generics introspection has been moved in static utility methods of ClassUtils
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, and sorry that I was not aware that execmodel tried to resolve actual type from generics at the time of DROOLS-7197.
…model generation (apache#5944)
This fixes both problems reported in #5925 and https://issues.redhat.com/browse/DROOLS-7197