/** * Find the Class that a given type refers to. * * @param type The type of interest * @return The Class that type represents */ public static Class<?> getClassFromType(Type type, DequeMap<TypeVariable<?>, Type> resolvedTypes) { Type actualType = findActualType(type, resolvedTypes); if (actualType instanceof Class) { return (Class<?>) actualType; } if (type instanceof ParameterizedType) { return getClassFromType(((ParameterizedType) actualType).getRawType(), resolvedTypes); } return null; }
for (int j = 0; !haveMatch && j < instanceTypes.length; ++j) { if (expectedParameterTypes[i] == instanceTypes[j]) { Type capturedType = findActualType(instanceTypes[j], resolvedTypes); if (!(capturedType instanceof TypeVariable)) { expectedParameterTypes[i] = capturedType;
if (actualTypes[i] == foundParameter) { Type capturedType = findActualType(classGenericTypes[i], resolvedTypes); if (capturedType != classGenericTypes[i]) { return capturedType;
Type actualType = findActualType(expectedType, resolvedTypes);
return deserializeArray(instanceClass, instance); Type actualExpectedType = SerializabilityUtil.findActualType(expectedType, resolvedTypes); if (actualExpectedType instanceof GenericArrayType) { Type arrayType = ((GenericArrayType) actualExpectedType).getGenericComponentType();
throw new SerializedTypeViolationException("Attempt to deserialize an object of type " + instanceClass.toString() + " when an object of type " + SerializabilityUtil.findActualType(expectedType, resolvedTypes).toString() + " is expected");
/** * Find the Class that a given type refers to. * * @param type The type of interest * @return The Class that type represents */ public static Class<?> getClassFromType(Type type, DequeMap<TypeVariable<?>, Type> resolvedTypes) { Type actualType = findActualType(type, resolvedTypes); if (actualType instanceof Class) { return (Class<?>) actualType; } if (type instanceof ParameterizedType) { return getClassFromType(((ParameterizedType) actualType).getRawType(), resolvedTypes); } return null; }
/** * Find the Class that a given type refers to. * * @param type The type of interest * @return The Class that type represents */ public static Class<?> getClassFromType(Type type, DequeMap<TypeVariable<?>, Type> resolvedTypes) { Type actualType = findActualType(type, resolvedTypes); if (actualType instanceof Class) { return (Class<?>) actualType; } if (type instanceof ParameterizedType) { return getClassFromType(((ParameterizedType) actualType).getRawType(), resolvedTypes); } return null; }
for (int j = 0; !haveMatch && j < instanceTypes.length; ++j) { if (expectedParameterTypes[i] == instanceTypes[j]) { Type capturedType = findActualType(instanceTypes[j], resolvedTypes); if (!(capturedType instanceof TypeVariable)) { expectedParameterTypes[i] = capturedType;
for (int j = 0; !haveMatch && j < instanceTypes.length; ++j) { if (expectedParameterTypes[i] == instanceTypes[j]) { Type capturedType = findActualType(instanceTypes[j], resolvedTypes); if (!(capturedType instanceof TypeVariable)) { expectedParameterTypes[i] = capturedType;
if (actualTypes[i] == foundParameter) { Type capturedType = findActualType(classGenericTypes[i], resolvedTypes); if (capturedType != classGenericTypes[i]) { return capturedType;
if (actualTypes[i] == foundParameter) { Type capturedType = findActualType(classGenericTypes[i], resolvedTypes); if (capturedType != classGenericTypes[i]) { return capturedType;
Type actualType = findActualType(expectedType, resolvedTypes);
Type actualType = findActualType(expectedType, resolvedTypes);
return deserializeArray(instanceClass, instance); Type actualExpectedType = SerializabilityUtil.findActualType(expectedType, resolvedTypes); if (actualExpectedType instanceof GenericArrayType) { Type arrayType = ((GenericArrayType) actualExpectedType).getGenericComponentType();
return deserializeArray(instanceClass, instance); Type actualExpectedType = SerializabilityUtil.findActualType(expectedType, resolvedTypes); if (actualExpectedType instanceof GenericArrayType) { Type arrayType = ((GenericArrayType) actualExpectedType).getGenericComponentType();
throw new SerializedTypeViolationException("Attempt to deserialize an object of type " + instanceClass.toString() + " when an object of type " + SerializabilityUtil.findActualType(expectedType, resolvedTypes).toString() + " is expected");
throw new SerializedTypeViolationException("Attempt to deserialize an object of type " + instanceClass.toString() + " when an object of type " + SerializabilityUtil.findActualType(expectedType, resolvedTypes).toString() + " is expected");