if (!c.cascadeOnClose() && toClose.containsKey(c.view)) { // Keep (do not remove) the "top level" view. while ((c = c.wrapperFor) != null) { if (c.cascadeOnClose()) break;
if (!c.cascadeOnClose() && toClose.containsKey(c.view)) { // Keep (do not remove) the "top level" view. while ((c = c.wrapperFor) != null) { if (c.cascadeOnClose()) break;
/** * Identifies the other views to <strong>not</strong> close if we don't want to close the {@link #view} * wrapped by this {@code Coupled}. This method identifies only the views that <em>use</em> this view; * it does not identify the views <em>used</em> by this view. * * This method is for {@link StorageConnector#closeAllExcept(Object)} internal usage. * * @param toClose the map where to write the list of views to not close. */ final void protect(final Map<AutoCloseable,Boolean> toClose) { if (wrappedBy != null) { for (final Coupled c : wrappedBy) { if (!c.cascadeOnClose()) { if (c.view instanceof AutoCloseable) { toClose.put((AutoCloseable) c.view, Boolean.FALSE); } c.protect(toClose); } } } }
/** * Identifies the other views to <strong>not</strong> close if we don't want to close the {@link #view} * wrapped by this {@code Coupled}. This method identifies only the views that <em>use</em> this view; * it does not identify the views <em>used</em> by this view. * * This method is for {@link StorageConnector#closeAllExcept(Object)} internal usage. * * @param toClose the map where to write the list of views to not close. */ final void protect(final Map<AutoCloseable,Boolean> toClose) { if (wrappedBy != null) { for (final Coupled c : wrappedBy) { if (!c.cascadeOnClose()) { if (c.view instanceof AutoCloseable) { toClose.put((AutoCloseable) c.view, Boolean.FALSE); } c.protect(toClose); } } } }