You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
while ((Objects.isNull(interfaces) || 0 == interfaces.length) && Objects.nonNull(superclass)) {
interfaces = superclass.getGenericInterfaces();
superclass = targetClass.getSuperclass();
}
If there is more than one inheritance from RocketMQListener, there will be an infinite loop. For example, MyRocketMQListener --extend--> BaseRocketMQListener --extend--> AbstractRocketMQListener --implement--> RocketMQListener.
Suggestion: Adjust the method getMessageType.
Our way to get actual type of generic:
private static Type[] getGenericTypesOfInterface(Class clazz, Class targetGenericInterface) {
Type matchedGenericInterface = null;
while (clazz != null) {
Type[] genericInterfaces = clazz.getGenericInterfaces();
if (genericInterfaces != null) {
for (Type genericInterface : genericInterfaces) {
if (genericInterface instanceof ParameterizedType && targetGenericInterface.equals(((ParameterizedType) genericInterface).getRawType())) {
matchedGenericInterface = genericInterface;
break;
}
}
}
clazz = clazz.getSuperclass();
}
if (matchedGenericInterface == null) {
return null;
}
return ((ParameterizedType) matchedGenericInterface).getActualTypeArguments();
}
The text was updated successfully, but these errors were encountered:
rocketmq-spring/rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/support/DefaultRocketMQListenerContainer.java
Lines 392 to 395 in 908ea48
If there is more than one inheritance from RocketMQListener, there will be an infinite loop. For example, MyRocketMQListener --extend--> BaseRocketMQListener --extend--> AbstractRocketMQListener --implement--> RocketMQListener.
Suggestion: Adjust the method getMessageType.
Our way to get actual type of generic:
The text was updated successfully, but these errors were encountered: