List of usage examples for java.lang IllegalArgumentException addSuppressed
public final synchronized void addSuppressed(Throwable exception)
From source file:fi.jumi.core.api.StackTraceTest.java
@Test public void creating_a_StackTrace_is_idempotent() { IllegalArgumentException original = new IllegalArgumentException("original message", new NullPointerException("cause message")); original.addSuppressed(new IOException("suppressed 1")); StackTrace st1 = StackTrace.from(original); StackTrace st2 = StackTrace.from(st1); assertThat(st2.getExceptionClass(), is(st1.getExceptionClass())); assertTrue(EqualsBuilder.reflectionEquals(st1, st2)); }
From source file:org.nuxeo.runtime.jtajca.NuxeoConnectionManagerFactory.java
public static NuxeoConnectionManagerConfiguration getConfig(Reference ref) { NuxeoConnectionManagerConfiguration config = new NuxeoConnectionManagerConfiguration(); IllegalArgumentException errors = new IllegalArgumentException("wrong naming config"); for (RefAddr addr : Collections.list(ref.getAll())) { String name = addr.getType(); String value = (String) addr.getContent(); try {// w w w .j a va 2s . co m BeanUtils.setProperty(config, name, value); } catch (ReflectiveOperationException cause) { errors.addSuppressed(cause); } } if (errors.getSuppressed().length > 0) { throw errors; } return config; }