Tabnine Logo
MessagingException.addSuppressed
Code IndexAdd Tabnine to your IDE (free)

How to use
addSuppressed
method
in
javax.mail.MessagingException

Best Java code snippets using javax.mail.MessagingException.addSuppressed (Showing top 5 results out of 315)

origin: com.sun.mail/javax.mail

/**
 * Try to attach a suppressed exception to a MessagingException in any order
 * that is possible.
 * @param required the exception expected to see as a reported failure.
 * @param optional the suppressed exception.
 * @return either the required or the optional exception.
 */
private static MessagingException attach(
    MessagingException required, Exception optional) {
  if (optional != null && !required.setNextException(optional)) {
    if (optional instanceof MessagingException) {
      final MessagingException head = (MessagingException) optional;
      if (head.setNextException(required)) {
        return head;
      }
    }
    if (optional != required) {
      required.addSuppressed(optional);
    }
  }
  return required;
}
origin: com.sun.mail/android-mail

/**
 * Try to attach a suppressed exception to a MessagingException in any order
 * that is possible.
 * @param required the exception expected to see as a reported failure.
 * @param optional the suppressed exception.
 * @return either the required or the optional exception.
 */
private static MessagingException attach(
    MessagingException required, Exception optional) {
  if (optional != null && !required.setNextException(optional)) {
    if (optional instanceof MessagingException) {
      final MessagingException head = (MessagingException) optional;
      if (head.setNextException(required)) {
        return head;
      }
    }
    if (optional != required) {
      required.addSuppressed(optional);
    }
  }
  return required;
}
origin: jboss/jboss-javaee-specs

/**
 * Try to attach a suppressed exception to a MessagingException in any order
 * that is possible.
 * @param required the exception expected to see as a reported failure.
 * @param optional the suppressed exception.
 * @return either the required or the optional exception.
 */
private static MessagingException attach(
    MessagingException required, Exception optional) {
  if (optional != null && !required.setNextException(optional)) {
    if (optional instanceof MessagingException) {
      final MessagingException head = (MessagingException) optional;
      if (head.setNextException(required)) {
        return head;
      }
    }
    if (optional != required) {
      required.addSuppressed(optional);
    }
  }
  return required;
}
origin: com.sun.mail/jakarta.mail

/**
 * Try to attach a suppressed exception to a MessagingException in any order
 * that is possible.
 * @param required the exception expected to see as a reported failure.
 * @param optional the suppressed exception.
 * @return either the required or the optional exception.
 */
private static MessagingException attach(
    MessagingException required, Exception optional) {
  if (optional != null && !required.setNextException(optional)) {
    if (optional instanceof MessagingException) {
      final MessagingException head = (MessagingException) optional;
      if (head.setNextException(required)) {
        return head;
      }
    }
    if (optional != required) {
      required.addSuppressed(optional);
    }
  }
  return required;
}
origin: org.glassfish.metro/webservices-extra

/**
 * Try to attach a suppressed exception to a MessagingException in any order
 * that is possible.
 * @param required the exception expected to see as a reported failure.
 * @param optional the suppressed exception.
 * @return either the required or the optional exception.
 */
private static MessagingException attach(
    MessagingException required, Exception optional) {
  if (optional != null && !required.setNextException(optional)) {
    if (optional instanceof MessagingException) {
      final MessagingException head = (MessagingException) optional;
      if (head.setNextException(required)) {
        return head;
      }
    }
    if (optional != required) {
      required.addSuppressed(optional);
    }
  }
  return required;
}
javax.mailMessagingExceptionaddSuppressed

Popular methods of MessagingException

  • getMessage
  • <init>
    Constructs a MessagingException with the specified Exception and detail message. The specified excep
  • printStackTrace
  • getNextException
    Get the next exception chained to this one. If the next exception is a MessagingException, the chain
  • toString
    Override toString method to provide information on nested exceptions.
  • setNextException
    Add an exception to the end of the chain. If the end is not a MessagingException, this exception can
  • initCause
  • getCause
    Overrides the getCause method of Throwable to return the next exception in the chain of nested excep
  • superToString
    Return the "toString" information for this exception, without any information on nested exceptions.
  • getLocalizedMessage
  • getStackTrace
  • setStackTrace
  • getStackTrace,
  • setStackTrace

Popular in Java

  • Creating JSON documents from java classes using gson
  • getContentResolver (Context)
  • getResourceAsStream (ClassLoader)
  • setRequestProperty (URLConnection)
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • JTextField (javax.swing)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now