We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@Override public TypeDefinition build(Type type, Class<?> clazz, Map<Class<?>, TypeDefinition> typeCache) { if (!(type instanceof ParameterizedType)) { return new TypeDefinition(clazz.getName()); } ParameterizedType parameterizedType = (ParameterizedType) type; Type[] actualTypeArgs = parameterizedType.getActualTypeArguments(); if (actualTypeArgs == null || actualTypeArgs.length != 2) { throw new IllegalArgumentException(MessageFormat.format( "[ServiceDefinitionBuilder] Map type [{0}] with unexpected amount of arguments [{1}]." + actualTypeArgs, new Object[] {type, actualTypeArgs})); } for (Type actualType : actualTypeArgs) { if (actualType instanceof ParameterizedType) { // Nested collection or map. Class<?> rawType = (Class<?>) ((ParameterizedType) actualType).getRawType(); TypeDefinitionBuilder.build(actualType, rawType, typeCache); } else if (actualType instanceof Class<?>) { Class<?> actualClass = (Class<?>) actualType; if (actualClass.isArray() || actualClass.isEnum()) { TypeDefinitionBuilder.build(null, actualClass, typeCache); } else { DefaultTypeBuilder.build(actualClass, typeCache); } } }
如下所示,参数长度为1。
package it.unimi.dsi.fastutil.ints; public interface Int2ObjectMap<V> extends Int2ObjectFunction<V>, Map<Integer, V> {}
该类来自于
<dependency> <groupId>it.unimi.dsi</groupId> <artifactId>fastutil</artifactId> </dependency>
是否可以判断他的上层实现来进行判断
能否定义一个order接口,然后sort一下,这样外部拓展的时候可以手动调准新增的builder的顺序
The text was updated successfully, but these errors were encountered:
遇到同样的问题 public class WebResult extends HashMap<String, Object> implements Serializable { ......... }
Sorry, something went wrong.
1.创建自定义TypeBuilder
package com.xxx.dubbo.TreeBuilder; public class TreeBuilder implements TypeBuilder , Prioritized { @Override public boolean accept(Type type, Class<?> clazz) { if (clazz == null) { return false; } return Tree.class.isAssignableFrom(clazz); } @Override public int getPriority() { return -1; } @Override public TypeDefinition build(Type type, Class<?> clazz, Map<Class<?>, TypeDefinition> typeCache) { // balabala... } }
META-INF
dubbo/internal/org.apache.dubbo.metadata.definition.builder.TypeBuilder
tree=com.xxx.dubbo.TreeBuilder
#6306
Remove params type size check in MapTypeBuilder (#9848)
3a8e5e6
fixes #5122 & #8212
No branches or pull requests
Environment
Steps to reproduce this issue
如下所示,参数长度为1。
该类来自于
Expected Result
是否可以判断他的上层实现来进行判断能否定义一个order接口,然后sort一下,这样外部拓展的时候可以手动调准新增的builder的顺序
The text was updated successfully, but these errors were encountered: