Example usage for java.lang IllegalArgumentException getSuppressed

List of usage examples for java.lang IllegalArgumentException getSuppressed

Introduction

In this page you can find the example usage for java.lang IllegalArgumentException getSuppressed.

Prototype

public final synchronized Throwable[] getSuppressed() 

Source Link

Document

Returns an array containing all of the exceptions that were suppressed, typically by the try -with-resources statement, in order to deliver this exception.

Usage

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 {/*from   www  .j  a v a 2 s .c o m*/
            BeanUtils.setProperty(config, name, value);
        } catch (ReflectiveOperationException cause) {
            errors.addSuppressed(cause);
        }
    }
    if (errors.getSuppressed().length > 0) {
        throw errors;
    }
    return config;
}