dubbo接口定义成泛型时,参数类型拿不到问题:

https://github.com/yu199195/hmily/issues/36
This commit is contained in:
jiys 2018-08-30 11:43:58 +08:00
parent 68949efcb2
commit 5ee6d2afb7

View File

@ -67,6 +67,7 @@ public class HmilyTransactionFilter implements Filter {
Class clazz = invoker.getInterface();
Class[] args = invocation.getParameterTypes();
final Object[] arguments = invocation.getArguments();
converterParamsClass (args, arguments);
Method method = null;
Tcc tcc = null;
try {
@ -103,6 +104,24 @@ public class HmilyTransactionFilter implements Filter {
}
}
/**
* params class converter
*
* @param args
* @param arguments
*/
private void converterParamsClass(Class[] args, Object[] arguments) {
if (arguments == null || arguments.length < 1) {
return;
}
for (int i = 0; i < arguments.length; i++) {
if (arguments == null) {
continue;
}
args[i] = arguments[i].getClass ();
}
}
@SuppressWarnings("unchecked")
private Participant buildParticipant(final TccTransactionContext tccTransactionContext,
final Tcc tcc,