Skip to content

Commit

Permalink
Remove params type size check in MapTypeBuilder (#9848)
Browse files Browse the repository at this point in the history
fixes #5122 & #8212
  • Loading branch information
wangchengming666 committed Apr 1, 2022
1 parent 1222676 commit 3a8e5e6
Showing 1 changed file with 0 additions and 8 deletions.
Expand Up @@ -21,8 +21,6 @@

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.text.MessageFormat;
import java.util.Arrays;
import java.util.Map;

import static org.apache.dubbo.common.utils.TypeUtils.getRawClass;
Expand Down Expand Up @@ -52,12 +50,6 @@ public TypeDefinition build(Type type, Class<?> clazz, Map<Class<?>, TypeDefinit
Type[] actualTypeArgs = parameterizedType.getActualTypeArguments();
int actualTypeArgsLength = actualTypeArgs == null ? 0 : actualTypeArgs.length;

if (actualTypeArgsLength != 2) {
throw new IllegalArgumentException(MessageFormat.format(
"[ServiceDefinitionBuilder] Map type [{0}] with unexpected amount of arguments [{1}]."
+ Arrays.toString(actualTypeArgs), type, actualTypeArgs));
}

String mapType = type.toString();

TypeDefinition typeDefinition = new TypeDefinition(mapType);
Expand Down

0 comments on commit 3a8e5e6

Please sign in to comment.