region AutoCloseable Implementation
355447
@Override
    public void close() {
        if (!this.closed) {
            this.closed = true;

            // If we have already returned a result but it hasn't been consumed yet, cancel it.
            CompletableFuture<ReadResultEntryContents> lastReturnedFuture = this.lastEntryFuture;
            if (lastReturnedFuture != null && !lastReturnedFuture.isDone()) {
                lastReturnedFuture.cancel(true);
                this.lastEntryFuture = null;
            }

            log.trace("{}.ReadResult[{}]: Closed.", this.traceObjectId, this.streamSegmentStartOffset);
        }
    }
1347079
protected void closeDialog() {
		if (m_CustomEditor instanceof Container) {
			Dialog dlg = PropertyDialog.getParentDialog((Container) m_CustomEditor);
			if (dlg != null)
				dlg.setVisible(false);
		}
	}
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) { }
            }
        }
    }
303532
private void slideClose() {
        if (!isClosing_) {
            isClosing_ = true;
            TranslateAnimation slideDown = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 1f);
            slideDown.setDuration(500);
            slideDown.setInterpolator(new DecelerateInterpolator());

            ((ViewGroup) getWindow().getDecorView()).getChildAt(0).startAnimation(slideDown);
            slideDown.setAnimationListener(new Animation.AnimationListener() {
                @Override
                public void onAnimationStart(Animation animation) {
                }

                @Override
                public void onAnimationEnd(Animation animation) {
                    dismiss();
                }

                @Override
                public void onAnimationRepeat(Animation animation) {
                }
            });
        }
    }
1240001
public static void close(@CheckForNull AutoCloseable c) {
        if (c == null) {
            return;
        }

        try {
            c.close();
        } catch (Exception e) {
            // Ignore
        }
    }
1065634
private void closeInputGates() throws IOException, InterruptedException {
		for (int i = 0; i < this.inputGates.size(); i++) {
			final InputGate<? extends IOReadableWritable> eig = this.inputGates.get(i);
			// Important: close must be called on each input gate exactly once
			eig.close();
		}

	}
885428
def on_close_grid(self, event):
        
        if self.parent.grid_frame:
            self.parent.grid_frame.onSave(None)
            self.parent.grid_frame.Destroy()
36401
protected void onClose(boolean reload) {

        if (reload) {
            Scheduler.get().scheduleDeferred(new ScheduledCommand() {

                public void execute() {

                    String url = Window.Location.getHref();
                    m_menuHandler.leavePage(url);

                }
            });
        }
    }
1083577
protected void onWindowClose() {

        boolean savePage = Window.confirm(
            Messages.get().key(Messages.GUI_EDITOR_SAVE_BEFORE_LEAVING_1, m_editableData.getSitePath()));
        if (savePage) {
            saveEditorContent();
        }
    }
821764
private void takeCloseLock()
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "takeCloseLock");

      while (true)
      {
         try
         {
            closeLock.readLock().lockInterruptibly();
            break;
         }
         catch (InterruptedException e)
         {
            // No FFDC code needed.
         }
      }

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "takeCloseLock");
   }
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);
                }
            }
        }
    }
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();
        }
    }
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');
		}
158445
protected void _closeChild()
    {
        if (_child != null) {
            Object value = _child._safeFinish();
            _map.put(_fieldName, value);
            _child = null;
        }
    }
1139309
@Override
	public void close() {
		executor.shutdown();
		for (SelectionKey key : selector.keys()) {
			((Attachment) key.attachment()).finishClose();
		}
		try {
			selector.close();
		} catch (IOException e) {/**/}
	}
1058056
function(){
    if (this.isClosed){ return; }

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

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

    this.triggerMethod('item:closed');
  }
340011
private void closeRemainingEnumerations()
    {
        List<AbstractQueueBrowserEnumeration> enumsToClose = new Vector<>();
        synchronized (enumMap)
        {
        	enumsToClose.addAll(enumMap.values());
            for (int n = 0 ; n < enumsToClose.size() ; n++)
            {
            	AbstractQueueBrowserEnumeration queueBrowserEnum = enumsToClose.get(n);
                log.debug("Auto-closing unclosed queue browser enumeration : "+queueBrowserEnum);
                try
                {
                	queueBrowserEnum.close();
                }
                catch (Exception e)
                {
                    log.error("Could not close queue browser enumeration "+queueBrowserEnum,e);
                }
            }
        }
    }