From 5ee6d2afb777dacded7e581dd39dc1ea99b41e5e Mon Sep 17 00:00:00 2001 From: jiys Date: Thu, 30 Aug 2018 11:43:58 +0800 Subject: [PATCH] =?UTF-8?q?dubbo=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=88=90=E6=B3=9B=E5=9E=8B=E6=97=B6=EF=BC=8C=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=8B=BF=E4=B8=8D=E5=88=B0=E9=97=AE=E9=A2=98?= =?UTF-8?q?:=20https://github.com/yu199195/hmily/issues/36?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dubbo/filter/HmilyTransactionFilter.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/hmily-tcc-dubbo/src/main/java/com/hmily/tcc/dubbo/filter/HmilyTransactionFilter.java b/hmily-tcc-dubbo/src/main/java/com/hmily/tcc/dubbo/filter/HmilyTransactionFilter.java index 9c46387f..2aeb9e0e 100644 --- a/hmily-tcc-dubbo/src/main/java/com/hmily/tcc/dubbo/filter/HmilyTransactionFilter.java +++ b/hmily-tcc-dubbo/src/main/java/com/hmily/tcc/dubbo/filter/HmilyTransactionFilter.java @@ -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,