/** * Process the property. * * @param clazz * The type. * @param genericParameter * The generic parameter number. * @param propertyHierarchy * The property hierachy. * @param property * The property. * @return The property type. */ private static Type processProperty(final Class<?> clazz, final int genericParameter, final Deque<? extends Member> propertyHierarchy, final Member property) { Type result = null; // Get the type path. final Type genericType = property.getGenericType(); final Deque<Type> typePath = GenericsUtil.findTypePath(genericType, clazz); // This field is part of the path. if (genericType instanceof ParameterizedType) { typePath.push(genericType); } if (!typePath.isEmpty()) { // Trace to root type. result = GenericsUtil.traceType(property, typePath, genericParameter); result = GenericsUtil.handleTypeVariable(propertyHierarchy, property, result); } return result; }