Safely close {@link Closeable} instance. Log error
in case of exception.
421075
public static void safeClose(Closeable obj)
   {
      try
      {
         obj.close();
      }
      catch (IOException e)
      {
         LOG.error("Error while closing " + obj, e);
      }
   }
232203
protected void closeFile() {
	if (this.qw != null) {
	    try {
		this.qw.close();
	    }
	    catch (java.io.IOException e) {
		// Exceptionally, it does not make sense to delegate to an
		// ErrorHandler. Since a closed appender is basically dead.
		LogLog.error("Could not close " + qw, e);
	    }
	}
    }
1247024
public static void closeQuietly(Iterable<Closeable> closeables) {
    for (Closeable c : closeables) {
      try {
        //Check if we also need to flush
        if (c instanceof Flushable) {
          ((Flushable) c).flush();
        }

        if (c != null) {
          c.close();
        }
      } catch (IOException e) {
        LOGGER.debug("Error closing:" + c);
      }
    }
  }
1180901
void tryClose()
    {
        if (!mayBeShared)
        {
            // First: free the hounds, er, the CL leak hunter
            ClassLoaderLeakCleaner.clean(this);
            ClassLoaderLeakCleaner.cleanJdbc(Thread.currentThread());

            // Then try to call CL.close()
            Method m = null;
            try
            {
                m = this.getClass().getMethod("close");
            }
            catch (NoSuchMethodException e)
            {
                jqmlogger.trace("CL cannot be closed");
                return;
            }
            catch (SecurityException e)
            {
                jqmlogger.error("Cannot access CL.close", e);
                return;
            }

            try
            {
                m.invoke(this);
            }
            catch (Exception e)
            {
                jqmlogger.error("Cannot close CL", e);
                return;
            }
            jqmlogger.debug("CL was closed");
        }
    }
867723
public void destroy() {
        try {
            ctx.close();
        }
        catch (javax.naming.NamingException e) {
            LOG.warn("Error when closing", e);
        }
    }
1016541
public static void close(Closeable a) {
        try {
            if (a != null) {
                a.close();
            }
        } catch (Exception e) {
            throw wrap(e);
        }
    }
104817
public void close() {
    Closeable closable = getClosable();
    try {
      LOG.closingResponse(this);
      closable.close();
      LOG.successfullyClosedResponse(this);
    } catch (IOException e) {
      throw LOG.exceptionWhileClosingResponse(e);
    }
  }
481046
public void close() throws java.io.IOException
  {
                if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
                        logger.logp(Level.FINE, CLASS_NAME,"close", "Closing");
        }

                if (_observer != null) {
      _observer.alertClose();
    }
    super.close();
  }
1352824
public static void closeQuietly(final Writer aWriter) {
        if (aWriter != null) {
            try {
                aWriter.close();
            } catch (final IOException details) {
                LOGGER.error(details.getMessage(), details);
            }
        }
    }
767512
protected void closeLogExc(@Nullable final Closeable closeable) {
		if (closeable == null) {
			return;
		}

		try {
			closeable.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
232252
public static void closeWithWarning(Closeable c) {
        if (c != null) {
            try {
                c.close();
            } catch (IOException e) {
                LOG.warning("Caught exception during close(): " + e);
            }
        }
    }
288277
public void error(Object o) {
        if (o instanceof Throwable) {
            logger.error(o, (Throwable) o);
        } else {
            logger.error(o);
        }
    }
403790
public static void close(Closeable closeable) {
        if (closeable != null) {
            try {
                closeable.close();
            } catch (IOException ioe) {
                // Suppress the exception
                logger.log(Level.FINEST, "Unable to close resource.", ioe);
            }
        }
    }
481183
public static void closeWithWarn(Closeable closeable) {
        if (BeanUtil.nonNull(closeable)) {
            try {
                closeable.close();
            } catch (IOException e) {
                LOG.warn("关闭流出错......", e);
            }
        }
    }
958078
void closeLog() throws InternalLogException
    {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "closeLog", this);

        // Check that the file is actually open
        if (_activeFile == null)
        {
            if (tc.isEntryEnabled())
                Tr.exit(tc, "closeLog", "InternalLogException");
            throw new InternalLogException(null);
        }

        try
        {
            _file1.fileClose();
            _file2.fileClose();
        } catch (InternalLogException exc)
        {
            FFDCFilter.processException(exc, "com.ibm.ws.recoverylog.spi.LogHandle.closeLog", "736", this);
            if (tc.isEntryEnabled())
                Tr.exit(tc, "closeLog", exc);
            throw exc;
        } catch (Throwable exc)
        {
            FFDCFilter.processException(exc, "com.ibm.ws.recoverylog.spi.LogHandle.closeLog", "742", this);
            if (tc.isEntryEnabled())
                Tr.exit(tc, "closeLog", "InternalLogException");
            throw new InternalLogException(exc);
        }

        _file1 = null;
        _file2 = null;
        _activeFile = null;
        _recoveredRecords = null;
        _physicalFreeBytes = 0;

        if (tc.isEntryEnabled())
            Tr.exit(tc, "closeLog");
    }
412020
public static void safeClose(@Nullable Object object) {
		if (object instanceof Closeable) {
			try {
				((Closeable) object).close();
			} catch (IOException e) {
				Exceptions.ignore(e);
			}
		}
	}
277622
@Override
    public void close() throws IOException {
        try {
            releaseLock();
        } catch (Exception e) {
            logger.error("Got an exception during close()", e);
        }
        IOUtils.closeQuietly(this.fileSystem);
    }