protected void addNonRecursiveHints(LightweightBoundTypeArgument original, UnboundTypeReference reference, Set<Object> seenHandles, List<LightweightBoundTypeArgument> result) { Object otherHandle = reference.getHandle(); if (seenHandles.add(otherHandle)) { if (isResolved(otherHandle)) { result.addAll(getHints(otherHandle)); } else { addNonRecursiveHints(original, getHints(otherHandle), seenHandles, result); } } }
public List<LightweightBoundTypeArgument> getAllHints(Object handle) { List<LightweightBoundTypeArgument> actualHints = getHints(handle); int i = 0; while(i < actualHints.size()) { LightweightBoundTypeArgument hint = actualHints.get(i); if (hint.getTypeReference() instanceof UnboundTypeReference) { break; } i++; } if (i >= actualHints.size()) return actualHints; List<LightweightBoundTypeArgument> transitivity = Lists.newArrayList(); Set<Object> seenHandles = Sets.newHashSet(handle); transitivity.addAll(actualHints.subList(0, i)); List<LightweightBoundTypeArgument> allRemaining = actualHints.subList(i, actualHints.size()); addNonRecursiveHints(allRemaining, seenHandles, transitivity); return transitivity; }
@Override protected List<LightweightBoundTypeArgument> getHints(Object handle) { List<LightweightBoundTypeArgument> result = super.getHints(handle); if (result.size() == 1 && super.isResolved(handle)) { return result; List<LightweightBoundTypeArgument> parentHints = getParent().getHints(handle); if (parentHints.size() == 1 && getParent().isResolved(handle)) { LightweightBoundTypeArgument parentHint = parentHints.get(0);
if (actualType.getKind() == LightweightTypeReference.KIND_UNBOUND_TYPE_REFERENCE && !((UnboundTypeReference) actualType).internalIsResolved()) { UnboundTypeReference casted = (UnboundTypeReference) actualType; List<LightweightBoundTypeArgument> hints = getHints(casted.getHandle()); boolean canAddHint = true; for(int i = 0; i < hints.size() && canAddHint; i++) {
List<LightweightBoundTypeArgument> hints = first.getResolvedTypes().getHints(casted.getHandle()); for(int i = 0; i < hints.size(); i++) { LightweightBoundTypeArgument hint = hints.get(i);