/* (non-Javadoc)
@see java.lang.AutoCloseable#close()
775380
@Override
    public void close() {
        if (this.inputStream != null) {
            try {
                this.inputStream.close();
            } catch (final IOException e) {
                // Ignore
            }
            this.inputStream = null;
        }
        this.byteBuffer = null;
        this.buf = null;
    }
95652
@Override
  public void close() throws IOException {
    super.close();
    if (fs != null) {
      try {
        fs.close();
        fs = null;
      } catch(IOException ie) {
        //this might already be closed, ignore
      }
    }
    if (cacheFs != null) {
      try {
        cacheFs.close();
        cacheFs = null;
      } catch(IOException ie) {
        //this might already be closed, ignore
      }
    }
  }
1187800
@Override
  public void close() {
    try {
      if ( content != null ) content.close();
    } catch (XMLStreamException e) {
      logger.error("Failed to close underlying XMLStreamReader",e);
      throw new MarkLogicIOException(e);
      // whether that failed or not, attempt to close underlying InputStream
    } finally {
      if ( contentSource != null ) {
        try {
          contentSource.close();
        } catch (IOException e) {
          logger.error("Failed to close underlying InputStream",e);
          throw new MarkLogicIOException(e);
        }
      }
    }
  }
1354297
@Override
  public void close()
  {
    super.close();
    facts.clear();
    indexAndOffsets.clear();

    if (selectors != null) {
      selectors.clear();
    }

    Closer c = Closer.create();
    aggBuffers.forEach(c::register);
    try {
      c.close();
    }
    catch (IOException e) {
      throw new RuntimeException(e);
    }
    aggBuffers.clear();
  }
712144
@Override
    public void close()
    {
        if(workbook != null)
            workbook.close();

        try
        {
            if(writableWorkbook != null)
                writableWorkbook.close();
        }
        catch(IOException e)
        {
        }
        catch(WriteException e)
        {
        }
    }
1097867
@Override
  public void close() throws IOException {
    if (inputStream != null) {
      inputStream.close();
      inputStream = null;
    }

    if (buffer != null) {
      buffer = null;
    }
  }
719025
@Override
    public final void close() {
        stopped = true;
        super.close();
        final ScheduledFuture<?> scheduledFuture = this.scheduledFuture;
        if (scheduledFuture != null) {
            scheduledFuture.cancel(true);
        }
    }
830345
@Override
  public final void close()
    throws IOException
  {
    State state = _state;
    
    if (state.isClosing()) {
      return;
    }
    
    _state = state.toClosing();
    
    try {
      flush(true);
    } finally {
      try {
        _state = _state.toClose();
      } catch (RuntimeException e) {
        throw new RuntimeException(state + ": " + e, e);
      }
    }
  }
206404
public void close() {
        Log.info("Closing index");
        try {
            Log.info("Closing");
            searcherReopener.interrupt();
            searcherManager.close();
            indexWriter.close();
            directory.close();
        } catch (IOException e) {
            Log.error(e, "Error while closing index");
            throw new RuntimeException(e);
        }
    }
859553
synchronized
  public
  void close() {
    closed = true;
    if (sqw != null) {
        try {
            if (layoutHeaderChecked && layout != null && layout.getFooter() != null) {
                sendLayoutMessage(layout.getFooter());
            }
            sqw.close();
            sqw = null;
        } catch(java.io.IOException ex) {
            sqw = null;
        }
    }
  }
1093790
@Override
    public void close() {
        if (!this.closed.get()) {
            ArrayList<RocksDBCache> toClose;
            synchronized (this.caches) {
                toClose = new ArrayList<>(this.caches.values());
            }

            toClose.forEach(RocksDBCache::close);
            this.closed.set(true);
            log.info("{}: Closed.", LOG_ID);
        }
    }
1176222
protected synchronized void close() {

        this.closed = true;

        setReadable(false);
        setWritable(false);
        freeOutputStream();
        freeInputStream();

        this.gzdata = null;
    }
834998
@Override
  public void close() {
    synchronized (lock) {
      if (closed) {
        return;
      }

      closed = true;
      tokenSource.unregister(this);
      tokenSource = null;
      action = null;
    }
  }
1094811
@Override
  public void close() throws IOException {
    if (!closed) {
      objectOutputStream.close();
      fileOutputStream.close();
      closed = true;
    }
  }
195340
public void close() throws IOException {
        if (!_closed) {
            try {
                flush();
            } catch (Throwable t) {
                LOG.debug(t.getMessage(), t);
            }
            _closed = true;
            super.close();
        }
    }
1061960
@Override
    public void close() {
        if (!this.closed.getAndSet(true)) {
            if (this.fileSystem != null) {
                try {
                    this.fileSystem.close();
                    this.fileSystem = null;
                } catch (IOException e) {
                    log.warn("Could not close the HDFS filesystem: {}.", e);
                }
            }
        }
    }
883497
public void setAutoClose(boolean autoClose) {
        this.autoClose = autoClose;

        if (autoCloseHandlerRegistration != null) {
            autoCloseHandlerRegistration.removeHandler();
            autoCloseHandlerRegistration = null;
        }

        if (autoClose) {
            autoCloseHandlerRegistration = registerHandler(addValueChangeHandler(event -> close()));
        }
    }