Package com.google.common.io
Class Closer.SuppressingSuppressor
- java.lang.Object
-
- com.google.common.io.Closer.SuppressingSuppressor
-
- All Implemented Interfaces:
Closer.Suppressor
- Enclosing class:
- Closer
static final class Closer.SuppressingSuppressor extends java.lang.Object implements Closer.Suppressor
Suppresses exceptions by adding them to the exception that will be thrown using JDK7's addSuppressed(Throwable) mechanism.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.reflect.Method
addSuppressed
(package private) static Closer.SuppressingSuppressor
INSTANCE
-
Constructor Summary
Constructors Constructor Description SuppressingSuppressor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.lang.reflect.Method
addSuppressedMethodOrNull()
(package private) static boolean
isAvailable()
void
suppress(java.io.Closeable closeable, java.lang.Throwable thrown, java.lang.Throwable suppressed)
Suppresses the given exception (suppressed
) which was thrown when attempting to close the given closeable.
-
-
-
Field Detail
-
INSTANCE
static final Closer.SuppressingSuppressor INSTANCE
-
addSuppressed
static final java.lang.reflect.Method addSuppressed
-
-
Method Detail
-
isAvailable
static boolean isAvailable()
-
addSuppressedMethodOrNull
private static java.lang.reflect.Method addSuppressedMethodOrNull()
-
suppress
public void suppress(java.io.Closeable closeable, java.lang.Throwable thrown, java.lang.Throwable suppressed)
Description copied from interface:Closer.Suppressor
Suppresses the given exception (suppressed
) which was thrown when attempting to close the given closeable.thrown
is the exception that is actually being thrown from the method. Implementations of this method should not throw under any circumstances.- Specified by:
suppress
in interfaceCloser.Suppressor
-
-