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 Object implements Closer.Suppressor
Suppresses exceptions by adding them to the exception that will be thrown using JDK7's addSuppressed(Throwable) mechanism.
  • Field Details

    • addSuppressed

      private final Method addSuppressed
  • Constructor Details

    • SuppressingSuppressor

      private SuppressingSuppressor(Method addSuppressed)
  • Method Details

    • tryCreate

      @CheckForNull static Closer.SuppressingSuppressor tryCreate()
    • suppress

      public void suppress(Closeable closeable, Throwable thrown, 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 interface Closer.Suppressor