chaokunyang commented on code in PR #1553:
URL: https://github.com/apache/incubator-fury/pull/1553#discussion_r1577737448
##########
java/fury-core/src/main/java/org/apache/fury/type/GenericType.java:
##########
@@ -129,31 +129,31 @@ public static GenericType build(Type type,
Predicate<Type> finalPredicate) {
list.add(build);
}
GenericType[] genericTypes = list.toArray(new GenericType[0]);
- return new GenericType(TypeToken.of(type), finalPredicate.test(type),
genericTypes);
+ return new GenericType(TypeRef.of(type), finalPredicate.test(type),
genericTypes);
} else if (type instanceof GenericArrayType) { // List<String>[] or T[]
Type componentType = ((GenericArrayType) type).getGenericComponentType();
- return new GenericType(TypeToken.of(type), finalPredicate.test(type),
build(componentType));
+ return new GenericType(TypeRef.of(type), finalPredicate.test(type),
build(componentType));
} else if (type instanceof TypeVariable) { // T
TypeVariable typeVariable = (TypeVariable) type;
Type typeVariableBound =
typeVariable.getBounds()[0]; // Bound 0 are a class, other bounds
are interface.
- return new GenericType(TypeToken.of(typeVariableBound),
finalPredicate.test(type));
+ return new GenericType(TypeRef.of(typeVariableBound),
finalPredicate.test(type));
} else if (type instanceof WildcardType) {
// WildcardType: `T extends Number`, not a type, just an expression.
// `? extends java.util.Collection<? extends
java.util.Collection<java.lang.Integer>>`
Type upperBound = ((WildcardType) type).getUpperBounds()[0];
if (upperBound instanceof ParameterizedType) {
return build(upperBound);
} else {
- return new GenericType(TypeToken.of(upperBound),
finalPredicate.test(type));
+ return new GenericType(TypeRef.of(upperBound),
finalPredicate.test(type));
}
} else {
// Class type: String, Integer
- return new GenericType(TypeToken.of(type), finalPredicate.test(type));
+ return new GenericType(TypeRef.of(type), finalPredicate.test(type));
}
}
- public TypeToken<?> getTypeToken() {
+ public TypeRef<?> getTypeToken() {
Review Comment:
```suggestion
public TypeRef<?> getTypeRef() {
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]