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

How to use
addSuppressed
method
in
java.lang.IllegalArgumentException

Best Java code snippets using java.lang.IllegalArgumentException.addSuppressed (Showing top 14 results out of 315)

origin: Alluxio/alluxio

  String.format("Unable to create an UnderFileSystem instance for path: %s", path));
for (Throwable t : errors) {
 e.addSuppressed(t);
origin: org.elasticsearch/elasticsearch

@Override
public TemporalAccessor parse(String input) {
  IllegalArgumentException failure = null;
  for (DateFormatter formatter : formatters) {
    try {
      return formatter.parse(input);
      // TODO: remove DateTimeParseException when JavaDateFormatter throws IAE
    } catch (IllegalArgumentException | DateTimeParseException e) {
      if (failure == null) {
        // wrap so the entire multi format is in the message
        failure = new IllegalArgumentException("failed to parse date field [" + input + "] with format [" + pattern + "]",
          e);
      } else {
        failure.addSuppressed(e);
      }
    }
  }
  throw failure;
}
origin: org.elasticsearch/elasticsearch

ex1.addSuppressed(ex);
throw ex1;
origin: neo4j-contrib/neo4j-graph-algorithms

/**
 * Creates a new Tree that can hold up to {@code capacity} nodes.
 */
public UndirectedTree(int capacity) {
  try {
    children = new int[capacity];
    siblings = new int[capacity];
  } catch (OutOfMemoryError | NegativeArraySizeException e) {
    IllegalArgumentException iae =
        new IllegalArgumentException("Invalid capacity: " + capacity);
    iae.addSuppressed(e);
    throw iae;
  }
  Arrays.fill(children, INVALID_NODE);
  Arrays.fill(siblings, INVALID_NODE);
  this.capacity = capacity;
}
origin: org.neo4j/graph-algorithms-core

/**
 * Creates a new Tree that can hold up to {@code capacity} nodes.
 */
public UndirectedTree(int capacity) {
  try {
    children = new int[capacity];
    siblings = new int[capacity];
  } catch (OutOfMemoryError | NegativeArraySizeException e) {
    IllegalArgumentException iae =
        new IllegalArgumentException("Invalid capacity: " + capacity);
    iae.addSuppressed(e);
    throw iae;
  }
  Arrays.fill(children, INVALID_NODE);
  Arrays.fill(siblings, INVALID_NODE);
  this.capacity = capacity;
}
origin: org.apache.ratis/ratis-common

/**
 * Parse the given string as a {@link SupportedRpcType}
 * or a user-defined {@link RpcType}.
 *
 * @param rpcType The string representation of an {@link RpcType}.
 * @return a {@link SupportedRpcType} or a user-defined {@link RpcType}.
 */
static RpcType valueOf(String rpcType) {
 final Throwable fromSupportedRpcType;
 try { // Try parsing it as a SupportedRpcType
  return SupportedRpcType.valueOfIgnoreCase(rpcType);
 } catch (Throwable t) {
  fromSupportedRpcType = t;
 }
 try {
  // Try using it as a class name
  return ReflectionUtils.newInstance(
    ReflectionUtils.getClass(rpcType, RpcType.class));
 } catch(Throwable t) {
  final IllegalArgumentException iae = new IllegalArgumentException(
    "Invalid " + RpcType.class.getSimpleName() + ": \"" + rpcType + "\" "
      + " cannot be used as a user-defined " + RpcType.class.getSimpleName()
      + " and it is not a " + SupportedRpcType.class.getSimpleName() + ".");
  iae.addSuppressed(t);
  iae.addSuppressed(fromSupportedRpcType);
  throw iae;
 }
}
origin: apache/incubator-ratis

/**
 * Parse the given string as a {@link SupportedRpcType}
 * or a user-defined {@link RpcType}.
 *
 * @param rpcType The string representation of an {@link RpcType}.
 * @return a {@link SupportedRpcType} or a user-defined {@link RpcType}.
 */
static RpcType valueOf(String rpcType) {
 final Throwable fromSupportedRpcType;
 try { // Try parsing it as a SupportedRpcType
  return SupportedRpcType.valueOfIgnoreCase(rpcType);
 } catch (Throwable t) {
  fromSupportedRpcType = t;
 }
 try {
  // Try using it as a class name
  return ReflectionUtils.newInstance(
    ReflectionUtils.getClass(rpcType, RpcType.class));
 } catch(Throwable t) {
  final IllegalArgumentException iae = new IllegalArgumentException(
    "Invalid " + RpcType.class.getSimpleName() + ": \"" + rpcType + "\" "
      + " cannot be used as a user-defined " + RpcType.class.getSimpleName()
      + " and it is not a " + SupportedRpcType.class.getSimpleName() + ".");
  iae.addSuppressed(t);
  iae.addSuppressed(fromSupportedRpcType);
  throw iae;
 }
}
origin: org.alluxio/alluxio-core-common

  String.format("Unable to create an UnderFileSystem instance for path: %s", path));
for (Throwable t : errors) {
 e.addSuppressed(t);
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

ex1.addSuppressed(ex);
throw ex1;
origin: apache/servicemix-bundles

ex1.addSuppressed(ex);
throw ex1;
origin: com.strapdata.elasticsearch/elasticsearch

ex1.addSuppressed(ex);
throw ex1;
origin: org.n52.series-api.db/dao

/**
 * Parse the {@code value} either as a {@link TimeInstant} or as a {@link TimePeriod}.
 *
 * @param value the string value
 *
 * @return the time
 *
 * @throws IllegalArgumentException if the {@code value} does not represent a valud time instant or period
 */
public static Time parseTime(String value) throws IllegalArgumentException {
  try {
    return new TimeInstant(Instant.parse(value));
  } catch (IllegalArgumentException ex1) {
    try {
      return new TimePeriod(Interval.parse(value));
    } catch (IllegalArgumentException ex2) {
      ex2.addSuppressed(ex1);
      throw ex2;
    }
  }
}
origin: org.apache.sis.core/sis-referencing

  method = DefaultOperationMethod.redimension(method, sourceDimensions, targetDimensions);
} catch (NoSuchIdentifierException | IllegalArgumentException se) {
  ex.addSuppressed(se);
  throw ex;
origin: apache/sis

  method = DefaultOperationMethod.redimension(method, sourceDimensions, targetDimensions);
} catch (NoSuchIdentifierException | IllegalArgumentException se) {
  ex.addSuppressed(se);
  throw ex;
java.langIllegalArgumentExceptionaddSuppressed

Popular methods of IllegalArgumentException

  • <init>
    Constructs a new exception with the specified cause and a detail message of (cause==null ? null : c
  • getMessage
  • printStackTrace
  • initCause
  • toString
  • getLocalizedMessage
  • getStackTrace
  • setStackTrace
  • getCause
  • fillInStackTrace
  • getSuppressed
  • getSuppressed

Popular in Java

  • Start an intent from android
  • compareTo (BigDecimal)
  • getResourceAsStream (ClassLoader)
  • findViewById (Activity)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Path (java.nio.file)
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Collectors (java.util.stream)
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top plugins for Android Studio
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