关闭需要关闭的对象，如果关闭出错，给出警告

@param closeable 需要关闭的对象
481183
public static void closeWithWarn(Closeable closeable) {
        if (BeanUtil.nonNull(closeable)) {
            try {
                closeable.close();
            } catch (IOException e) {
                LOG.warn("关闭流出错......", e);
            }
        }
    }
767512
protected void closeLogExc(@Nullable final Closeable closeable) {
		if (closeable == null) {
			return;
		}

		try {
			closeable.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
1133075
public static void safeClose(final Iterable<? extends Closeable> ci) {
        if (ci != null) {
            for (Closeable closeable : ci) {
                safeClose(closeable);
            }
        }
    }
52059
public static <T> CloseableReference<T> of(
      @PropagatesNullable T t, ResourceReleaser<T> resourceReleaser) {
    if (t == null) {
      return null;
    } else {
      return new CloseableReference<T>(t, resourceReleaser);
    }
  }
472802
public static Closeable closeableFrom(@WillNotClose @Nullable final Blob blob) {
        return closeableFrom(blob, Blob::free);
    }
405961
public void onAbnormalClose(CloseInfo close) {
        if (LOG.isDebugEnabled())
            LOG.debug("onAbnormalClose({})", close);
        ConnectionState event = null;
        synchronized (this) {
            if (this.state == ConnectionState.CLOSED) {
                // already closed
                return;
            }

            if (this.state == ConnectionState.OPEN) {
                this.cleanClose = false;
            }

            this.state = ConnectionState.CLOSED;
            finalClose.compareAndSet(null, close);
            this.inputAvailable = false;
            this.outputAvailable = false;
            this.closeHandshakeSource = CloseHandshakeSource.ABNORMAL;
            event = this.state;
        }
        notifyStateListeners(event);
    }
203108
public static void cleanup(Log log, java.io.Closeable... closeables) {
    for(java.io.Closeable c : closeables) {
      if (c != null) {
        try {
          c.close();
        } catch(IOException e) {
          if (log != null && log.isDebugEnabled()) {
            log.debug("Exception in closing " + c, e);
          }
        }
      }
    }
  }
1240001
public static void close(@CheckForNull AutoCloseable c) {
        if (c == null) {
            return;
        }

        try {
            c.close();
        } catch (Exception e) {
            // Ignore
        }
    }
466300
public static void close(@Nullable final Closeable closeable) {
        if (null != closeable) {
            try {
                closeable.close();
            } catch (IOException ex) {
                LOGGER.trace("", ex);
            }
        }
    }
720027
def _close_callable(self, node, force=False):
        """"""
        # Only nodes that have a line number can be considered for closing
        # callables. Similarly, only nodes with lines greater than the one
        # already processed can be considered for closing callables
        try:
            lineno = node.lineno
        except AttributeError:
            return
        if lineno <= self._processed_line:
            return
        # [[[cog
        # code = """
        # print(pcolor('Close callable @ line = {0}'.format(lineno), 'green'))
        # """
        # cog.out(code)
        # ]]]
        # [[[end]]]
        # Extract node name for property closing. Once a property is found,
        # it can only be closed out by a node type that has a name
        name = ""
        try:
            name = (
                node.name
                if hasattr(node, "name")
                else (
                    node.targets[0].id
                    if hasattr(node.targets[0], "id")
                    else node.targets[0].value.id
                )
            )
        except AttributeError:
            pass
        # Traverse backwards through call stack and close callables as needed
        indent = self._get_indent(node)
        count = -1
        # [[[cog
        # code = """
        # print(
        #     pcolor(
        #         '    Name {0} @ {1}, indent = {2}'.format(
        #             name if name else 'None', lineno, indent
        #         ),
        #         'yellow'
        #     )
        # )
        # """
        # cog.out(code)
        # ]]]
        # [[[end]]]
        dlist = []
        while count >= -len(self._indent_stack):
            element_full_name = self._indent_stack[count]["full_name"]
            edict = self._callables_db.get(element_full_name, None)
            stack_indent = self._indent_stack[count]["level"]
            open_callable = element_full_name and (not edict["last_lineno"])
            # [[[cog
            # code = """
            # print(
            #     pcolor(
            #         '    Name {0}, indent, {1}, stack_indent {2}'.format(
            #             element_full_name, indent, stack_indent
            #         ),
            #         'yellow'
            #     )
            # )
            # """
            # cog.out(code)
            # ]]]
            # [[[end]]]
            if open_callable and (
                force
                or (indent < stack_indent)
                or (
                    (indent == stack_indent)
                    and (
                        (edict["type"] != "prop")
                        or (
                            (edict["type"] == "prop")
                            and (name and (name != element_full_name))
                        )
                    )
                )
            ):
                # [[[cog
                # code = """
                # print(
                #     pcolor(
                #         '    Closing {0} @ {1}'.format(
                #             element_full_name, lineno-1
                #         ),
                #         'yellow'
                #     )
                # )
                # """
                # cog.out(code)
                # ]]]
                # [[[end]]]
                edict["last_lineno"] = lineno - 1
                dlist.append(count)
            if indent > stack_indent:
                break
            count -= 1
        # Callables have to be removed from stack when they are closed,
        # otherwise if a callable is subsequently followed after a few
        # lines by another callable at a further indentation level (like a for
        # loop) the second callable would incorrectly appear within the scope
        # of the first callable
        stack = self._indent_stack
        stack_length = len(self._indent_stack)
        dlist = [item for item in dlist if stack[item]["type"] != "module"]
        for item in dlist:
            del self._indent_stack[stack_length + item]
738851
public void registerCloseables(final Collection<Closeable> registry, Closeable... closeables) {

        registry.addAll(Arrays.asList(closeables));

        addListener(resource -> {
            for (Closeable closeable : closeables) {
                if (closeable == RedisChannelHandler.this) {
                    continue;
                }

                try {
                    if (closeable instanceof AsyncCloseable) {
                        ((AsyncCloseable) closeable).closeAsync();
                    } else {
                        closeable.close();
                    }
                } catch (IOException e) {
                    if (debugEnabled) {
                        logger.debug(e.toString(), e);
                    }
                }
            }

            registry.removeAll(Arrays.asList(closeables));
        });
    }
207194
static <T> CloseableIterator<T> wrap(final Iterator<T> iterator, final AutoCloseable closeable) {
        return new CloseableIterator<T>() {

            @Override
            public void close() {
                try {
                    closeable.close();
                } catch (RuntimeException re) {
                    throw re;
                } catch (Exception e) {
                    throw new IllegalStateException(e);
                }
            }

            @Override
            public boolean hasNext() {
                return iterator.hasNext();
            }

            @Override
            public T next() {
                return iterator.next();
            }

            @Override
            public void remove() {
                iterator.remove();
            }
        };
    }
59868
public synchronized void close(final boolean forceClose) throws SQLException {
        Collection<SQLException> exceptions = new LinkedList<>();
        MasterVisitedManager.clear();
        exceptions.addAll(closeResultSets());
        exceptions.addAll(closeStatements());
        if (!stateHandler.isInTransaction() || forceClose) {
            exceptions.addAll(releaseConnections(forceClose));
        }
        stateHandler.doNotifyIfNecessary();
        throwSQLExceptionIfNecessary(exceptions);
    }
933383
private CloseableDataStore asCloseableDataStore(final DataStore dataStore, final Optional<Runnable> onClose) {
        return (CloseableDataStore) Proxy.newProxyInstance(
                DataStore.class.getClassLoader(), new Class[] { CloseableDataStore.class },
                new AbstractInvocationHandler() {
                    @Override
                    protected Object handleInvocation(Object proxy, Method method, Object[] args)
                            throws Throwable {
                        if ("close".equals(method.getName())) {
                            if (onClose.isPresent()) {
                                onClose.get().run();
                            }
                            return null;
                        } else {
                            return method.invoke(dataStore, args);
                        }
                    }
                });
    }
166711
public static void closeQuietly(XMLStreamReader reader) {
        if (reader != null) {
            try {
                reader.close();
            } catch (XMLStreamException e) {
                logger.warn("Error while closing", e);
            }
        }
    }
1069492
public static void closeEL(OutputStream os) {
	try {
	    if (os != null) os.close();
	}
	// catch (AlwaysThrow at) {throw at;}
	catch (Throwable t) {
	    ExceptionUtil.rethrowIfNecessary(t);
	}
    }
888989
public static void closeQuietly(@Nullable final AutoCloseable closeable) {
        try {
            if (closeable != null) {
                closeable.close();
            }
        } catch (Exception e) {
            LOG.warn("Error closing instance {}.", closeable, e);
        }
    }