public class CloseableUtils extends Object
Constructor and Description |
---|
CloseableUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
closeQuietly(Closeable closeable)
This method has been added because Guava has removed the
closeQuietly() method from Closeables in v16.0. |
public static void closeQuietly(Closeable closeable)
This method has been added because Guava has removed the
closeQuietly()
method from Closeables
in v16.0. It's
tempting simply to replace calls to closeQuietly(closeable)
with calls to close(closeable, true)
to close
Closeable
s while swallowing IOException
s, but
close()
is declared as throws IOException
whereas
closeQuietly()
is not, so it's not a drop-in replacement.
On the whole, Guava is very backwards compatible. By fixing this nit, Curator can continue to support newer versions of Guava without having to bump its own dependency version.
Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.