region AutoCloseable Implementation
544369
@Override
    public void close() {
        if (!this.closed.getAndSet(true)) {
            closeIndices(null, false); // This will close all registered indices, without cleaning the cache.
            this.cache.close();
            log.info("{}: Closed.", this.traceObjectId);
        }
    }
1016541
public static void close(Closeable a) {
        try {
            if (a != null) {
                a.close();
            }
        } catch (Exception e) {
            throw wrap(e);
        }
    }
988036
public void rootWindowClosing(WindowEvent evt) {
        // TODO: Remove debugger from connection.
        ((ObservableReader) reader).removeReaderListener(readerListener);
        ((ObservableWriter) writer).removeWriterListener(writerListener);
    }
1279286
public void close() {
        // Turn back the cursor to POINTER
        RootPanel.get().getElement().getStyle().setCursor(Style.Cursor.DEFAULT);

        windowCount--;
        if (closeAnimation == null) {
            getOpenMixin().setOn(false);
            if(windowOverlay != null && windowOverlay.isAttached() && windowCount < 1) {
                windowOverlay.removeFromParent();
            }
            CloseEvent.fire(this, false);
        } else {
            closeAnimation.animate(this, () -> {
                getOpenMixin().setOn(false);
                if(windowOverlay != null && windowOverlay.isAttached() && windowCount < 1) {
                    windowOverlay.removeFromParent();
                }
                CloseEvent.fire(this, false);
            });
        }
    }
319123
public static void closeAll(Closeable a, Closeable b) throws IOException {
    Throwable thrown = null;
    try {
      a.close();
    } catch (Throwable e) {
      thrown = e;
    }
    try {
      b.close();
    } catch (Throwable e) {
      if (thrown == null) thrown = e;
    }
    if (thrown == null) return;
    if (thrown instanceof IOException) throw (IOException) thrown;
    if (thrown instanceof RuntimeException) throw (RuntimeException) thrown;
    if (thrown instanceof Error) throw (Error) thrown;
    throw new AssertionError(thrown);
  }
251330
void closePath(
      Graphics2D g, Path2D.Double path, double previousX, Rectangle2D bounds, double yTopMargin) {

    if (path != null) {
      double yBottomOfArea = getBounds().getY() + getBounds().getHeight() - yTopMargin;
      path.lineTo(previousX, yBottomOfArea);
      path.closePath();
      g.fill(path);
    }
  }
158445
protected void _closeChild()
    {
        if (_child != null) {
            Object value = _child._safeFinish();
            _map.put(_fieldName, value);
            _child = null;
        }
    }
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");
        }
    }
943570
private void releaseCloseLock()
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "releaseCloseLock");
      closeLock.readLock().unlock();
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "releaseCloseLock");
   }
1133075
public static void safeClose(final Iterable<? extends Closeable> ci) {
        if (ci != null) {
            for (Closeable closeable : ci) {
                safeClose(closeable);
            }
        }
    }
65316
function() {
			this.writeDebug('closeDirections');

			// Close directions callback
			if (this.settings.callbackCloseDirections) {
				this.settings.callbackCloseDirections.call(this);
			}

			// Remove the close icon, remove the directions, add the list back
			this.reset();

			if ((olat) && (olng)) {
				if (this.countFilters() === 0) {
					this.settings.mapSettings.zoom = originalZoom;
				}
				else {
					this.settings.mapSettings.zoom = 0;
				}
				this.processForm(null);
			}

			$(document).off('click.'+pluginName, '.' + this.settings.locationList + ' .bh-sl-close-icon');
		}
619373
function(inst) {
		var onClose = this._get(inst, 'onClose');
		if (onClose)
			onClose.apply((inst.input ? inst.input[0] : null),
						  [(inst.input ? inst.input.val() : ''), inst]);
	}
977506
@Override
    @SneakyThrows(Exception.class)
    public void close() {
        ReusableLatch waitSignal = null;
        synchronized (this.stateLock) {
            if (this.closed) {
                return;
            }

            this.closed = true;
            if (this.activeCount != 0 || !this.pendingItems.isEmpty()) {
                // Setup a latch that will be released when the last item completes.
                this.emptyNotifier = new ReusableLatch(false);
                waitSignal = this.emptyNotifier;
            }
        }

        if (waitSignal != null) {
            // We have unfinished items. Wait for them.
            waitSignal.await(CLOSE_TIMEOUT_MILLIS);
        }
    }
262941
protected final void _writeAndClose(Object value, JsonGenerator g)
        throws IOException
    {
        boolean closed = false;
        try {
            _config(g);
            _writerForOperation(g).writeValue(value);
            closed = true;
            g.close();
        } finally {
            if (!closed) {
                // need to catch possible failure, so as not to mask problem
                try {
                    g.close();
                } catch (IOException ioe) { }
            }
        }
    }
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);
                }
            }
        }
    }
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;
  }
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;
        }
    }