The current code was written before Java 1.5 added the Iterable class, so it tries to partially add support for it by invoking the iterator method through reflection, but this doesn't work for inaccessible classes (see
VELOCITY-870). Since 1.7 requires Java 1.5, we can check if the target object implements Iterable directly.
- relates to
VELOCITY-870 Exception displayed when trying to loop over an Iterable private class