@Override protected void doVisitParameterizedTypeReference(ParameterizedTypeReference reference, StringBuilder param) { JvmType type = reference.getType(); if (type instanceof JvmDeclaredType) { boolean local = ((JvmDeclaredType) type).isLocal(); if (local) { param.append("new "); Iterables.getLast(reference.getSuperTypes()).accept(this, param); param.append("(){}"); return; } } super.doVisitParameterizedTypeReference(reference, param); }
JvmTypeParameter overridingTypeParameter = overriding.getTypeParameters().get(i); JvmTypeParameter overriddenTypeParameter = overridden.getTypeParameters().get(i); List<LightweightTypeReference> overridingSuperTypes = owner.newParameterizedTypeReference(overridingTypeParameter).getSuperTypes(); List<LightweightTypeReference> overriddenSuperTypes = owner.newParameterizedTypeReference(overriddenTypeParameter).getSuperTypes(); if (overridingSuperTypes.size() != overriddenSuperTypes.size()) { return false;
@Override public JvmTypeReference toJavaCompliantTypeReference(IVisibilityHelper visibilityHelper) { if (isTypeVisible(visibilityHelper)) { JvmParameterizedTypeReference result = getTypesFactory().createJvmParameterizedTypeReference(); result.setType(type); if (typeArguments != null) { for(LightweightTypeReference typeArgument: typeArguments) { result.getArguments().add(typeArgument.toJavaCompliantTypeReference()); } } return result; } else { return toJavaCompliantTypeReference(getSuperTypes(), visibilityHelper); } }
JvmType type = typeReference.getType(); if (recursionGuard.tryNext((JvmTypeParameter) type)) { List<LightweightTypeReference> superTypes = typeReference.getSuperTypes(); for(int i = 0, size = superTypes.size(); i < size; i++) { LightweightTypeReference superType = superTypes.get(i);
@Override public List<JvmOperation> getOverriddenAndImplementedMethodCandidates() { if (overrideCandidates != null) return overrideCandidates; // here we are only interested in the raw type thus the declarator is not substituted // the found operation will be put in the right context by clients, e.g. #getOverriddenAndImplementedMethods ParameterizedTypeReference currentDeclarator = getContextType().getOwner().newParameterizedTypeReference(getDeclaration().getDeclaringType()); List<LightweightTypeReference> superTypes = currentDeclarator.getSuperTypes(); List<JvmOperation> result = Lists.newArrayListWithCapacity(5); for(LightweightTypeReference superType: superTypes) { if (superType.getType() instanceof JvmDeclaredType) { JvmDeclaredType declaredSuperType = (JvmDeclaredType) superType.getType(); if (declaredSuperType != null) { Iterable<JvmFeature> equallyNamedFeatures = declaredSuperType.findAllFeaturesByName(getDeclaration().getSimpleName()); for(JvmFeature equallyNamedFeature: equallyNamedFeatures) { if (equallyNamedFeature instanceof JvmOperation) { result.add((JvmOperation) equallyNamedFeature); } } } } } return overrideCandidates = Collections.unmodifiableList(result); }
JvmType type = reference.getType(); if (!(type instanceof JvmTypeParameter) && EcoreUtil.isAncestor(boundary, type)) { SubstitutionResult visited = reference.getSuperTypes().get(0).accept(this, varianceInfo); switch(varianceInfo) { case IN: