region AutoCloseable Implementation
186193
@Override
    public void close() throws Exception {
        try {
            this.servers.stream().filter(Objects::nonNull).forEach(BookieServer::shutdown);
            if (this.zkServer.get() != null) {
                this.zkServer.get().close();
            }
        } finally {
            cleanupDirectories();
        }

        Thread c = this.cleanup.getAndSet(null);
        if (c != null) {
            Runtime.getRuntime().removeShutdownHook(c);
        }
    }
1240001
public static void close(@CheckForNull AutoCloseable c) {
        if (c == null) {
            return;
        }

        try {
            c.close();
        } catch (Exception e) {
            // Ignore
        }
    }
1203462
private void closeCurrent() {
	if (components.size() > 0) {
	  Component component = components.remove(components.size() - 1);
	  getModalPanel().removeAll();
	  fireCloseActionListener(listeners.get(component));
	  listeners.remove(component);

	  if (components.size() > 0) {
		showNextComponent();
	  } else {
		restoreRootPane();
	  }
	}
  }
186434
public static void safeClose(@Nullable Closeable closeable) {
        if (closeable == null) return;

        try {
            closeable.close();
        } catch (IOException ignored) {
            // We made out best effort to release this resource. Nothing more we can do.
        }
    }
1373394
public static void close(final AutoCloseable closeable)
    {
        try
        {
            if (null != closeable)
            {
                closeable.close();
            }
        }
        catch (final Exception e)
        {
            LangUtil.rethrowUnchecked(e);
        }
    }
336347
void visitEnclosingElement(ImageElement element,
      ImageElement key, int value)
     throws IOException {
    visitEnclosingElement(element, key, Integer.toString(value));
  }
852001
private static void closeQuietly(State state) {
        // ensure only closed once and avoid race conditions
        if (state.closed.compareAndSet(false, true)) {
            // set the state fields to null after closing for garbage
            // collection purposes
            log.debug("closing rs");
            Util.closeQuietly(state.rs);
            log.debug("closing ps");
            Util.closeQuietly(state.ps);
            log.debug("closing con");
            Util.closeQuietlyIfAutoCommit(state.con);
            log.debug("closed");
        }
    }
120024
public synchronized void onClose() {
        if (state == State.DISABLED || state == State.DISABLING)
            throw new IllegalStateException("Do not call onClose if not opened before");
        if (state == State.WAITING) {
            state = State.DISABLED;
        } else {
            state = State.DISABLING;
        }
    }
792068
function writeAndCloseOpenState(isClosed) {
    var isShouldClose = true;

    if (state.tag) {
        var isRoot = isRootNode();

        if (isHelperTag(state.tag)) { // helper case
            helperOpen(state.tag, state.attributes);
            isShouldClose = isClosed;
        } else if (isTagBinded(state.tag)) {
            binderOpen(state.tag, state.attributes);
            isShouldClose = isClosed;
        } else if (isClosed || _options.voidRequireTags.indexOf(state.tag) !== -1) { // void mode
            writeCommand(Command.elementVoid, state.tag, state.attributes, isRoot);
            nestingLevelInfo.level--;
            isShouldClose = false;
        } else if (state.tag !== _options.evaluate.name) { // standard mode
            writeCommand(Command.elementOpen, state.tag, state.attributes, isRoot);
        } // if we write code, do nothing

        nestingLevelInfo.level++;
    }

    // clear builder state for next tag
    state.tag = null;
    state.attributes = {};

    return isShouldClose; // should we close this tag: no if we have void element
}
880195
public static void close(Object... objsToClose) {
		for (Object obj : objsToClose) {
			if (obj instanceof AutoCloseable) {
				IoUtil.close((AutoCloseable) obj);
			} else if (obj instanceof Closeable) {
				IoUtil.close((Closeable) obj);
			} else {
				try {
					if (obj != null) {
						if (obj instanceof ResultSet) {
							((ResultSet) obj).close();
						} else if (obj instanceof Statement) {
							((Statement) obj).close();
						} else if (obj instanceof PreparedStatement) {
							((PreparedStatement) obj).close();
						} else if (obj instanceof Connection) {
							((Connection) obj).close();
						} else {
							log.warn("Object {} not a ResultSet or Statement or PreparedStatement or Connection!", obj.getClass().getName());
						}
					}
				} catch (SQLException e) {
					// ignore
				}
			}
		}
	}
1295164
public void close(final ComponentDescriptor<?> descriptor, final Object component, final boolean success) {
        final Set<CloseMethodDescriptor> closeMethods = descriptor.getCloseMethods();
        for (final CloseMethodDescriptor closeDescriptor : closeMethods) {
            if (_includeNonDistributedTasks || closeDescriptor.isDistributed()) {
                if (success && closeDescriptor.isEnabledOnSuccess()) {
                    closeDescriptor.close(component);
                } else if (!success && closeDescriptor.isEnabledOnFailure()) {
                    closeDescriptor.close(component);
                } else {
                    logger.debug("Omitting close method {} since success={}", closeDescriptor, success);
                }
            }
        }
    }
726247
@SideOnly(Side.CLIENT)
	@SubscribeEvent
	public void onGuiClose(GuiOpenEvent event)
	{
		if (!MalisisGui.cancelClose || event.getGui() != null)
			return;

		MalisisGui.cancelClose = false;
		event.setCanceled(true);
	}
1135325
public static void closeAllQuietly(Iterable<? extends AutoCloseable> closeables) {
		if (null != closeables) {
			for (AutoCloseable closeable : closeables) {
				closeQuietly(closeable);
			}
		}
	}
158445
protected void _closeChild()
    {
        if (_child != null) {
            Object value = _child._safeFinish();
            _map.put(_fieldName, value);
            _child = null;
        }
    }
1052181
function(name, region){
      region.close();
      delete this._regions[name];
      this._setLength();
      this.triggerMethod("region:remove", name, region);
    }
1115290
protected void onClose() {

        if ((m_selectedItem != null)) {
            if (m_selectedItem.hasSubmenu()) {
                m_selectedItem.getSubMenu().onClose();
            }
            m_selectedItem.deselectItem();
        }
        m_popup.hide();
    }
1329733
public static boolean safeCloseAll(Closeable... closeables) {
        boolean result = true;
        for (final Closeable c : closeables) {
            result &= safeClose(c);
        }
        return result;
    }