@Override protected void doVisitParameterizedTypeReference(ParameterizedTypeReference reference, ParameterizedTypeReference declaration) { JvmType type = declaration.getType(); if (type instanceof JvmTypeParameter) { if (type != reference.getType() && shouldProcess((JvmTypeParameter) type)) { JvmTypeParameter typeParameter = (JvmTypeParameter) type; processTypeParameter(typeParameter, reference); } } else if (type instanceof JvmTypeParameterDeclarator && !((JvmTypeParameterDeclarator) type).getTypeParameters().isEmpty() && !declaration.getTypeArguments().isEmpty()) { doVisitMatchingTypeParameters(reference, declaration); } }
protected void doVisitMatchingTypeParameters(ParameterizedTypeReference reference, ParameterizedTypeReference declaration) { Map<JvmTypeParameter, LightweightMergedBoundTypeArgument> actualMapping = getTypeParameterMapping(reference); TypeParameterSubstitutor<?> actualSubstitutor = createTypeParameterSubstitutor(actualMapping); Map<JvmTypeParameter, LightweightMergedBoundTypeArgument> declaredMapping = getTypeParameterMapping(declaration); TypeParameterSubstitutor<?> declaredSubstitutor = createTypeParameterSubstitutor(declaredMapping); Set<JvmTypeParameter> actualBoundParameters = actualMapping.keySet(); if (declaredType instanceof JvmTypeParameter) { JvmTypeParameter declaredTypeParameter = (JvmTypeParameter) declaredType; if (!shouldProcessInContextOf(declaredTypeParameter, actualBoundParameters, visited)) continue; declaredTypeReference = declaredSubstitutor.substitute(declaredTypeReference);
protected ParameterizedTypeReferenceTraverser createParameterizedTypeReferenceTraverser() { return new ParameterizedTypeReferenceTraverser(); }