Un-derpecate IOUtils.closeQuietly() methods.
MODIFY
src/changes/changes.xml
src/changes/changes.xml
@@ -57,6 +57,9 @@ The <action> type attribute can be add,update,fix,remove.
<action dev="ggregory" type="fix" due-to="Michael Ernst, Gary Gregory">
Make `FilenameUtils.equals()` not throw an exception #154.
</action>
+ <action dev="ggregory" type="fix" due-to="Jan Peter Stotz, Bernd Eckenfels, Gary Gregory">
+ Un-derpecate IOUtils.closeQuietly() methods.
+ </action>
<!-- ADD -->
<action dev="ggregory" type="add" due-to="Gary Gregory">
Add FileSystemProviders class.

MODIFY
src/main/java/org/apache/commons/io/IOUtils.java
src/main/java/org/apache/commons/io/IOUtils.java
@@ -359,6 +359,7 @@ public static void close(final URLConnection conn) {
/**
* Closes a <code>Closeable</code> unconditionally.
+ *
* <p>
* Equivalent to {@link Closeable#close()}, except any exceptions will be ignored. This is typically used in
* finally blocks.
@@ -388,15 +389,15 @@ public static void close(final URLConnection conn) {
* IOUtils.closeQuietly(outputStream);
* }
* </pre>
+ * <p>
+ * Also consider using a try-with-resources statement where appropriate.
+ * </p>
*
* @param closeable the objects to close, may be null or already closed
* @since 2.0
*
- * @deprecated As of 2.6 deprecated without replacement. Please use the try-with-resources statement or handle
- * suppressed exceptions manually.
* @see Throwable#addSuppressed(java.lang.Throwable)
*/
- @Deprecated
public static void closeQuietly(final Closeable closeable) {
closeQuietly(closeable, (Consumer<IOException>) null);
}
@@ -439,16 +440,14 @@ public static void closeQuietly(final Closeable closeable) {
* IOUtils.closeQuietly(inputStream, outputStream);
* }
* </pre>
- *
+ * <p>
+ * Also consider using a try-with-resources statement where appropriate.
+ * </p>
* @param closeables the objects to close, may be null or already closed
* @see #closeQuietly(Closeable)
* @since 2.5
- *
- * @deprecated As of 2.6 deprecated without replacement. Please use the try-with-resources statement or handle
- * suppressed exceptions manually.
* @see Throwable#addSuppressed(java.lang.Throwable)
*/
- @Deprecated
public static void closeQuietly(final Closeable... closeables) {
if (closeables == null) {
return;
@@ -497,14 +496,13 @@ public static void closeQuietly(final Closeable closeable, final Consumer<IOExce
* IOUtils.closeQuietly(in);
* }
* </pre>
+ * <p>
+ * Also consider using a try-with-resources statement where appropriate.
+ * </p>
*
* @param input the InputStream to close, may be null or already closed
- *
- * @deprecated As of 2.6 deprecated without replacement. Please use the try-with-resources statement or handle
- * suppressed exceptions manually.
* @see Throwable#addSuppressed(java.lang.Throwable)
*/
- @Deprecated
public static void closeQuietly(final InputStream input) {
closeQuietly((Closeable) input);
}
@@ -530,14 +528,13 @@ public static void closeQuietly(final InputStream input) {
* IOUtils.closeQuietly(out);
* }
* </pre>
+ * <p>
+ * Also consider using a try-with-resources statement where appropriate.
+ * </p>
*
* @param output the OutputStream to close, may be null or already closed
- *
- * @deprecated As of 2.6 deprecated without replacement. Please use the try-with-resources statement or handle
- * suppressed exceptions manually.
* @see Throwable#addSuppressed(java.lang.Throwable)
*/
- @Deprecated
public static void closeQuietly(final OutputStream output) {
closeQuietly((Closeable) output);
}
@@ -562,14 +559,13 @@ public static void closeQuietly(final OutputStream output) {
* IOUtils.closeQuietly(in);
* }
* </pre>
+ * <p>
+ * Also consider using a try-with-resources statement where appropriate.
+ * </p>
*
* @param input the Reader to close, may be null or already closed
- *
- * @deprecated As of 2.6 deprecated without replacement. Please use the try-with-resources statement or handle
- * suppressed exceptions manually.
* @see Throwable#addSuppressed(java.lang.Throwable)
*/
- @Deprecated
public static void closeQuietly(final Reader input) {
closeQuietly((Closeable) input);
}
@@ -593,15 +589,14 @@ public static void closeQuietly(final Reader input) {
* IOUtils.closeQuietly(selector);
* }
* </pre>
+ * <p>
+ * Also consider using a try-with-resources statement where appropriate.
+ * </p>
*
* @param selector the Selector to close, may be null or already closed
* @since 2.2
- *
- * @deprecated As of 2.6 deprecated without replacement. Please use the try-with-resources statement or handle
- * suppressed exceptions manually.
* @see Throwable#addSuppressed(java.lang.Throwable)
*/
- @Deprecated
public static void closeQuietly(final Selector selector) {
closeQuietly((Closeable) selector);
}
@@ -625,15 +620,14 @@ public static void closeQuietly(final Selector selector) {
* IOUtils.closeQuietly(socket);
* }
* </pre>
+ * <p>
+ * Also consider using a try-with-resources statement where appropriate.
+ * </p>
*
* @param serverSocket the ServerSocket to close, may be null or already closed
* @since 2.2
- *
- * @deprecated As of 2.6 deprecated without replacement. Please use the try-with-resources statement or handle
- * suppressed exceptions manually.
* @see Throwable#addSuppressed(java.lang.Throwable)
*/
- @Deprecated
public static void closeQuietly(final ServerSocket serverSocket) {
closeQuietly((Closeable) serverSocket);
}
@@ -657,15 +651,14 @@ public static void closeQuietly(final ServerSocket serverSocket) {
* IOUtils.closeQuietly(socket);
* }
* </pre>
+ * <p>
+ * Also consider using a try-with-resources statement where appropriate.
+ * </p>
*
* @param socket the Socket to close, may be null or already closed
* @since 2.0
- *
- * @deprecated As of 2.6 deprecated without replacement. Please use the try-with-resources statement or handle
- * suppressed exceptions manually.
* @see Throwable#addSuppressed(java.lang.Throwable)
*/
- @Deprecated
public static void closeQuietly(final Socket socket) {
closeQuietly((Closeable) socket);
}
@@ -689,14 +682,13 @@ public static void closeQuietly(final Socket socket) {
* IOUtils.closeQuietly(out);
* }
* </pre>
+ * <p>
+ * Also consider using a try-with-resources statement where appropriate.
+ * </p>
*
* @param output the Writer to close, may be null or already closed
- *
- * @deprecated As of 2.6 deprecated without replacement. Please use the try-with-resources statement or handle
- * suppressed exceptions manually.
* @see Throwable#addSuppressed(java.lang.Throwable)
*/
- @Deprecated
public static void closeQuietly(final Writer output) {
closeQuietly((Closeable) output);
}

Un-derpecate IOUtils.closeQuietly() methods.