@Override /* @Nullable */ public LightweightTypeReference getSuperType(JvmType rawType) { Object rawResult = internalGetSuperType(rawType); if (rawResult instanceof ParameterizedTypeReference) { return (LightweightTypeReference) rawResult; } else if (rawResult != null) { JvmTypeReference superType = (JvmTypeReference) rawResult; if (isRawType()) { return createRawTypeReference(rawType); } if (superType.eClass() == TypesPackage.Literals.JVM_PARAMETERIZED_TYPE_REFERENCE) { if (((JvmParameterizedTypeReference) superType).getArguments().isEmpty()) { return getOwner().newParameterizedTypeReference(rawType); } } LightweightTypeReference unresolved = getOwner().toLightweightTypeReference(rawType); TypeParameterSubstitutor<?> substitutor = createSubstitutor(); LightweightTypeReference result = substitutor.substitute(unresolved); return result; } return null; }
private LightweightTypeReference getSuperTypeByName(String typeName, boolean interfaceType) { JvmTypeReference superType = getSuperTypeByName(typeName, interfaceType, type, new RecursionGuard<JvmType>()); if (superType != null) { JvmType rawType = superType.getType(); if (isRawType()) { return createRawTypeReference(rawType); } if (superType.eClass() == TypesPackage.Literals.JVM_PARAMETERIZED_TYPE_REFERENCE) { if (((JvmParameterizedTypeReference) superType).getArguments().isEmpty()) { return getOwner().newParameterizedTypeReference(rawType); } } LightweightTypeReference unresolved = getOwner().toLightweightTypeReference(rawType); TypeParameterSubstitutor<?> substitutor = createSubstitutor(); LightweightTypeReference result = substitutor.substitute(unresolved); return result; } return null; }