public void adapt(final Type source, final Type target) throws AdaptFailure { visit(source, target); ImmutableList<Type<?>> fromList = from.toList(); ImmutableList<Type<?>> toList = to.toList(); while (!fromList.isEmpty()) { final Type t = mapping.get(fromList.head); if (toList.head != t) { toList.head = t; } fromList = fromList.tail; toList = toList.tail; } }
public void adapt(final Type source, final Type target) throws AdaptFailure { visit(source, target); ImmutableList<Type<?>> fromList = from.toList(); ImmutableList<Type<?>> toList = to.toList(); while (!fromList.isEmpty()) { final Type t = mapping.get(fromList.head); if (toList.head != t) { toList.head = t; } fromList = fromList.tail; toList = toList.tail; } }
public void adapt(final Type source, final Type target) throws AdaptFailure { visit(source, target); ImmutableList<Type<?>> fromList = from.toList(); ImmutableList<Type<?>> toList = to.toList(); while (!fromList.isEmpty()) { final Type t = mapping.get(fromList.head); if (toList.head != t) { toList.head = t; } fromList = fromList.tail; toList = toList.tail; } }
@Override public Void visitClassType(final Type source, final Type target) throws AdaptFailure { adaptRecursive( source.getTypeArguments(), target.getTypeArguments() ); return null; }
private void adaptRecursive(final Type source, final Type target) { final TypePair pair = new TypePair(source, target); if (cache.add(pair)) { try { visit(source, target); } finally { cache.remove(pair); } } }
@Override public Void visitArrayType(final Type source, final Type target) throws AdaptFailure { adaptRecursive(elementType(source), elementType(target)); return null; }
@Override public Void visitClassType(final Type source, final Type target) throws AdaptFailure { adaptRecursive( source.getTypeArguments(), target.getTypeArguments() ); return null; }
private void adaptRecursive(final Type source, final Type target) { final TypePair pair = new TypePair(source, target); if (cache.add(pair)) { try { visit(source, target); } finally { cache.remove(pair); } } }
private void adaptRecursive(final TypeList source, final TypeList target) throws AdaptFailure { if (source.size() != target.size()) { return; } for (int i = 0, n = source.size(); i < n; i++) { adapt(source.get(i), target.get(i)); } } }
private void adaptRecursive(final TypeList source, final TypeList target) throws AdaptFailure { if (source.size() != target.size()) { return; } for (int i = 0, n = source.size(); i < n; i++) { adapt(source.get(i), target.get(i)); } } }
private void adaptRecursive(final Type source, final Type target) { final TypePair pair = new TypePair(source, target); if (cache.add(pair)) { try { visit(source, target); } finally { cache.remove(pair); } } }
@Override public Void visitArrayType(final Type source, final Type target) throws AdaptFailure { adaptRecursive(elementType(source), elementType(target)); return null; }
@Override public Void visitWildcardType(final Type source, final Type target) throws AdaptFailure { if (source.hasExtendsBound()) { adaptRecursive(upperBound(source), upperBound(target)); } else if (source.hasSuperBound()) { adaptRecursive(lowerBound(source), lowerBound(target)); } return null; }
@Override public Void visitClassType(final Type source, final Type target) throws AdaptFailure { adaptRecursive( source.getTypeArguments(), target.getTypeArguments() ); return null; }
private void adaptRecursive(final TypeList source, final TypeList target) throws AdaptFailure { if (source.size() != target.size()) { return; } for (int i = 0, n = source.size(); i < n; i++) { adapt(source.get(i), target.get(i)); } } }
@Override public Void visitWildcardType(final Type source, final Type target) throws AdaptFailure { if (source.hasExtendsBound()) { adaptRecursive(upperBound(source), upperBound(target)); } else if (source.hasSuperBound()) { adaptRecursive(lowerBound(source), lowerBound(target)); } return null; }
@Override public Void visitWildcardType(final Type source, final Type target) throws AdaptFailure { if (source.hasExtendsBound()) { adaptRecursive(upperBound(source), upperBound(target)); } else if (source.hasSuperBound()) { adaptRecursive(lowerBound(source), lowerBound(target)); } return null; }