/** * Validate the elements in a {@link Iterable}. * * @param iterable the items to check * @param errors the {@link List} of errros seen so far. * @param <T> The type of each object in the {@link Iterable}. * @return any new errors. */ private static <T> List<RaveError> checkIterable(Iterable<T> iterable, @Nullable List<RaveError> errors) { Rave rave = Rave.getInstance(); for (T type : iterable) { if (type == null) { continue; } try { rave.validate(type); } catch (UnsupportedObjectException e) { return (errors == null) ? Collections.<RaveError>emptyList() : errors; } catch (RaveException e) { errors = appendErrors(e, errors); } } return (errors == null) ? Collections.<RaveError>emptyList() : errors; }
return Collections.<RaveError>emptyList(); } catch (RaveException e) { return appendErrors(e, null);
return errors; } catch (RaveException e) { errors = appendErrors(e, errors);