All Downloads are FREE. Search and download functionalities are using the official Maven repository.

br.com.objectos.lang.ThrowablesJava7 Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2021 Objectos Software LTDA.
 *
 * Reprodução parcial ou total proibida.
 */
package br.com.objectos.lang;

import static br.com.objectos.lang.Lang.checkNotNull;

import br.com.objectos.multirelease.Singleton;

class ThrowablesJava7 extends Throwables {

  @Singleton.Field
  static final Throwables INSTANCE = new ThrowablesJava7();

  ThrowablesJava7() {}

  @Override
  public final Exception addSuppressed(Exception exception, Exception suppressed) {
    checkNotNull(suppressed, "suppressed == null");

    if (exception != null) {
      exception.addSuppressed(suppressed);

      return exception;
    } else {
      return suppressed;
    }
  }

  @Override
  public final Throwable[] getSuppressed(Throwable throwable) {
    checkNotNull(throwable, "throwable == null");

    return throwable.getSuppressed();
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy