region AutoCloseable Implementation
967132
@Override
    public void close() {
        if (this.closed.compareAndSet(false, true)) {
            Futures.await(Services.stopAsync(this, this.executor));
            this.storage.close();
            log.info("Closed.");
        }
    }
1359281
public void onCloseRemote(CloseInfo closeInfo) {
        if (LOG.isDebugEnabled())
            LOG.debug("onCloseRemote({})", closeInfo);
        ConnectionState event = null;
        synchronized (this) {
            if (this.state == ConnectionState.CLOSED) {
                // already closed
                return;
            }

            if (LOG.isDebugEnabled())
                LOG.debug("onCloseRemote(), input={}, output={}", inputAvailable, outputAvailable);

            this.closeInfo = closeInfo;

            // turn off further input
            inputAvailable = false;

            if (closeHandshakeSource == CloseHandshakeSource.NONE) {
                closeHandshakeSource = CloseHandshakeSource.REMOTE;
            }

            if (!outputAvailable) {
                LOG.debug("Close Handshake satisfied, disconnecting");
                cleanClose = true;
                state = ConnectionState.CLOSED;
                finalClose.compareAndSet(null, closeInfo);
                event = this.state;
            } else if (this.state == ConnectionState.OPEN) {
                // We are now entering CLOSING (or half-closed)
                this.state = ConnectionState.CLOSING;
                event = this.state;
            }
        }

        // Only notify on state change events
        if (event != null) {
            notifyStateListeners(event);
        }
    }
1052181
function(name, region){
      region.close();
      delete this._regions[name];
      this._setLength();
      this.triggerMethod("region:remove", name, region);
    }
1309624
@Override
    public void close() throws IOException {
        try {
            if (inPart)
                out.write(__CRLF);
            out.write(__DASHDASH);
            out.write(boundary);
            out.write(__DASHDASH);
            out.write(__CRLF);
            inPart = false;
        } finally {
            super.close();
        }
    }
1057075
@Override
  void leaveEnclosingElement() throws IOException {
    depthCounter.decLevel();
    if(tagQ.size() == 0)
      throw new IOException("Tried to exit non-existent enclosing element " +
                "in EditLog file");

    EditsElement element = tagQ.pop();
    printIndents();
    write("</" + element.toString() + ">\n");
  }
1210332
@Override
    public void close() {
        this.createSegment.close();
        this.deleteSegment.close();
        this.updateConditional.close();
        this.updateUnconditional.close();
        this.removeConditional.close();
        this.removeUnconditional.close();
        this.getKeys.close();
        this.iterateKeys.close();
        this.iterateEntries.close();
    }
356753
public void onClose(CmmnActivityExecution execution) {
    String id = execution.getId();
    if (execution.isCaseInstanceExecution()) {

      if (execution.isClosed()) {
        throw LOG.alreadyClosedCaseException("close", id);
      }

      if (execution.isActive()) {
        throw LOG.wrongCaseStateException("close", id, "[completed|terminated|suspended]", "active");
      }

    } else {
      throw LOG.notACaseInstanceException("close", id);
    }
  }
717556
private synchronized void rootWindowClosing(WindowEvent evt) {
        // Notify to all the debuggers to stop debugging
        for (EnhancedDebugger debugger : debuggers) {
            debugger.cancel();
        }
        // Release any reference to the debuggers
        debuggers.clear();
        // Release the default instance
        instance = null;
        frame = null;
        notifyAll();
    }
1200034
public static void closeEL(Closeable c) {
	try {
	    if (c != null) c.close();
	}
	// catch (AlwaysThrow at) {throw at;}
	catch (Throwable e) {
	    ExceptionUtil.rethrowIfNecessary(e);
	}
    }
245981
@Nonnull
  public static ESuccess closeWithoutFlush (@Nullable @WillClose final AutoCloseable aCloseable)
  {
    if (aCloseable != null)
    {
      try
      {
        // close stream
        aCloseable.close ();
        return ESuccess.SUCCESS;
      }
      catch (final Exception ex)
      {
        if (!isKnownEOFException (ex))
          LOGGER.error ("Failed to close object " + aCloseable.getClass ().getName (),
                        ex instanceof IMockException ? null : ex);
      }
    }
    return ESuccess.FAILURE;
  }
613340
public static Closeable closeableFrom(@WillNotClose @Nullable final Clob clob) {
        return closeableFrom(clob, Clob::free);
    }
829559
protected void close() {

        if (!m_enabled) {
            return;
        }
        m_openClose.setDown(false);
        m_popup.hide();
        m_selectBoxState.setValue(I_CmsLayoutBundle.INSTANCE.generalCss().cornerAll());
    }
46333
def OnClose(self, event):
        """"""

        # If changes have taken place save of old grid

        if undo.stack().haschanged():
            save_choice = self.interfaces.get_save_request_from_user()

            if save_choice is None:
                # Cancelled close operation
                return

            elif save_choice:
                # User wants to save content
                post_command_event(self.main_window, self.main_window.SaveMsg)

        # Save the AUI state

        config["window_layout"] = repr(self.main_window._mgr.SavePerspective())

        # Uninit the AUI stuff

        self.main_window._mgr.UnInit()

        # Save config
        config.save()

        # Close main_window

        self.main_window.Destroy()

        # Set file mode to 600 to protect GPG passwd a bit
        sp = wx.StandardPaths.Get()
        pyspreadrc_path = sp.GetUserConfigDir() + "/." + config.config_filename
        try:
            os.chmod(pyspreadrc_path, 0600)
        except OSError:
            dummyfile = open(pyspreadrc_path, "w")
            dummyfile.close()
            os.chmod(pyspreadrc_path, 0600)
817865
public static <T> void closeQuietly(@Nullable final Iterable<T> iterable) {
        if (iterable != null) {
            iterable.forEach(AutoCloseables::closeQuietly);
        }
    }
972936
protected void close() {

        if (m_dialog != null) {
            m_dialog.hide();
            m_dialog = null;
            m_editorHandler.onClose(m_editableData.getSitePath(), m_editableData.getStructureId(), m_isNew, false);
            m_editorHandler = null;
        }
        if (m_form != null) {
            m_form.removeFromParent();
            m_form = null;
        }
        if (m_closingHandlerRegistration != null) {
            m_closingHandlerRegistration.removeHandler();
            m_closingHandlerRegistration = null;
        }
    }
282840
@Deprecated
    public static <T> T withCloseable(Closeable self, @ClosureParams(value = SimpleType.class, options = "java.io.Closeable") Closure<T> action) throws IOException {
        return IOGroovyMethods.withCloseable(self, action);
    }
1058056
function(){
    if (this.isClosed){ return; }

    this.triggerMethod('item:before:close');

    Marionette.View.prototype.close.apply(this, slice(arguments));

    this.triggerMethod('item:closed');
  }