Skip to content

Commit

Permalink
Remove hard-coded param type check in MapTypeBuilder (#9849)
Browse files Browse the repository at this point in the history
fix #9847
  • Loading branch information
wangchengming666 committed Mar 30, 2022
1 parent 2dc577d commit 807b10e
Showing 1 changed file with 0 additions and 8 deletions.
Expand Up @@ -22,8 +22,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 @@ -53,12 +51,6 @@ public TypeDefinition build(Type type, Class<?> clazz, Map<String, TypeDefinitio
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 = ClassUtils.getCanonicalNameForParameterizedType(parameterizedType);

TypeDefinition td = typeCache.get(mapType);
Expand Down

0 comments on commit 807b10e

Please sign in to comment.