Fix generic array being changed (#13103)
This commit is contained in:
parent
0fb1e4c4c6
commit
da5c7ed33d
|
|
@ -158,9 +158,10 @@ public class DecodeableRpcInvocation extends RpcInvocation implements Codec, Dec
|
|||
pts = drawPts(path, version, desc, pts);
|
||||
if (pts == DubboCodec.EMPTY_CLASS_ARRAY) {
|
||||
if (RpcUtils.isGenericCall(desc, getMethodName())) {
|
||||
pts = DubboCodec.GENERIC_PTS_ARRAY;
|
||||
// Should recreate here for each invocation because the parameterTypes may be changed by user.
|
||||
pts = new Class<?>[]{String.class, String[].class, Object[].class};
|
||||
} else if (RpcUtils.isEcho(desc, getMethodName())) {
|
||||
pts = DubboCodec.ECHO_PTS_ARRAY;
|
||||
pts = new Class<?>[]{Object.class};
|
||||
} else {
|
||||
throw new IllegalArgumentException("Service not found:" + path + ", " + getMethodName());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,8 +69,6 @@ public class DubboCodec extends ExchangeCodec {
|
|||
public static final byte RESPONSE_NULL_VALUE_WITH_ATTACHMENTS = 5;
|
||||
public static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];
|
||||
public static final Class<?>[] EMPTY_CLASS_ARRAY = new Class<?>[0];
|
||||
public static final Class<?>[] GENERIC_PTS_ARRAY = new Class<?>[]{String.class, String[].class, Object[].class};
|
||||
public static final Class<?>[] ECHO_PTS_ARRAY = new Class<?>[]{Object.class};
|
||||
private static final ErrorTypeAwareLogger log = LoggerFactory.getErrorTypeAwareLogger(DubboCodec.class);
|
||||
|
||||
private static final AtomicBoolean decodeInUserThreadLogged = new AtomicBoolean(false);
|
||||
|
|
|
|||
Loading…
Reference in New Issue