@Override public LightweightTypeReference getUpperBoundSubstitute() { if (isUnbounded()) { return getOwner().newReferenceToObject(); } List<LightweightTypeReference> upperBounds = getUpperBounds(); if (upperBounds.size() == 1) { LightweightTypeReference result = upperBounds.get(0); return result; } CompoundTypeReference result = getOwner().newCompoundTypeReference(false); for (LightweightTypeReference upperBound : upperBounds) { result.addComponent(upperBound); } return result; }
protected void doVisitCompoundTypeReference(CompoundTypeReference reference) { List<LightweightTypeReference> components = reference.getMultiTypeComponents(); if (components.isEmpty()) doVisitTypeReference(reference); else for (LightweightTypeReference component : components) { component.accept(this); } }