void (final Object obj, final StandardJavaFileManager delegateTo, final Set<Object> visited) { if (obj instanceof JavaFileManager && visited.add(obj)) { forEachField(obj.getClass(), new BooleanFunction<Field>() { @Override public boolean fun(Field field) { try { if (JavaFileManager.class.isAssignableFrom(field.getType())) { final Object value = field.get(obj); if (isClientCodeWrapper(value, delegateTo)) { field.set(obj, APIWrappers.wrap(StandardJavaFileManager.class, value, Object.class, delegateTo)); } else { installCallDispatcherRecursively(value, delegateTo, visited); } } } catch (Throwable ignored) { } return true; } }); } }