// Path: honeybadger-java/src/main/java/io/honeybadger/reporter/config/ConfigContext.java
// public interface ConfigContext {
//     /** @return name of environment */
//     String getEnvironment();
// 
//     /** @return Honeybadger URL to use */
//     URI getHoneybadgerUrl();
// 
//     /** @return Honeybadger API key to use */
//     String getApiKey();
// 
//     /** @return Set of system properties to not include */
//     Set<String> getExcludedSysProps();
// 
//     /** @return Set of parameters to not include */
//     Set<String> getExcludedParams();
// 
//     /** @return Set of exception classes to ignore */
//     Set<String> getExcludedClasses();
// 
//     /** @return String that maps a package to an application */
//     String getApplicationPackage();
// 
//     /** @return Honeybadger Read API key */
//     String getHoneybadgerReadApiKey();
// 
//     /** @return Do we display the feedback form? */
//     Boolean isFeedbackFormDisplayed();
// 
//     /** @return The path to the feedback form template */
//     String getFeedbackFormPath();
// 
//     /** @return Host of proxy server to send traffic through */
//     String getHttpProxyHost();
// 
//     /** @return Port of proxy server to send traffic through */
//     Integer getHttpProxyPort();
// 
//     /** @return Optional configuration parameter to adjust number of attempts to retry sending an error
//      * report in the event of a network timeout or other transmission exception. Defaults to 3. */
//     Integer getMaximumErrorReportingRetries();
// 
//     /** @return Timeout for socket connection within HTTP client */
//     Integer getSocketTimeout();
// 
//     /** @return Timeout for initial connect within HTTP client */
//     Integer getConnectTimeout();
// }


import com.fasterxml.jackson.annotation.JsonInclude;
import io.honeybadger.reporter.config.ConfigContext;
import java.io.Serializable;
import java.util.LinkedList;
package io.honeybadger.reporter.dto;



/**
 * An ordered collection of chained exceptions.
 * @author <a href="https://github.com/dekobon">Elijah Zupancic</a>
 * @since 1.0.9
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
@SuppressWarnings("JdkObsolete") // Reason: subtle interface change if we change LinkedList to ArrayList
public class Causes extends LinkedList<Cause> implements Serializable {
    private static final long serialVersionUID = -5359764114506595006L;

    private static final int MAX_CAUSES = 100;

    public Causes(final ConfigContext config, final Throwable rootError) {
        if (rootError == null) {
            throw new IllegalArgumentException("Error can't be null");
        }
        addCauses(config, rootError);
    }

    void addCauses(final ConfigContext config, final Throwable rootError) {
        if (rootError.getCause() == null) return;

        Throwable lastCause = null;
        Throwable nextCause = rootError.getCause();

        int iterations = 0;

        do {
            addFirst(new Cause(config, nextCause));
            ++iterations;
// Path: honeybadger-java/src/main/java/io/honeybadger/reporter/config/ConfigContext.java
// public interface ConfigContext {
//     /** @return name of environment */
//     String getEnvironment();
// 
//     /** @return Honeybadger URL to use */
//     URI getHoneybadgerUrl();
// 
//     /** @return Honeybadger API key to use */
//     String getApiKey();
// 
//     /** @return Set of system properties to not include */
//     Set<String> getExcludedSysProps();
// 
//     /** @return Set of parameters to not include */
//     Set<String> getExcludedParams();
// 
//     /** @return Set of exception classes to ignore */
//     Set<String> getExcludedClasses();
// 
//     /** @return String that maps a package to an application */
//     String getApplicationPackage();
// 
//     /** @return Honeybadger Read API key */
//     String getHoneybadgerReadApiKey();
// 
//     /** @return Do we display the feedback form? */
//     Boolean isFeedbackFormDisplayed();
// 
//     /** @return The path to the feedback form template */
//     String getFeedbackFormPath();
// 
//     /** @return Host of proxy server to send traffic through */
//     String getHttpProxyHost();
// 
//     /** @return Port of proxy server to send traffic through */
//     Integer getHttpProxyPort();
// 
//     /** @return Optional configuration parameter to adjust number of attempts to retry sending an error
//      * report in the event of a network timeout or other transmission exception. Defaults to 3. */
//     Integer getMaximumErrorReportingRetries();
// 
//     /** @return Timeout for socket connection within HTTP client */
//     Integer getSocketTimeout();
// 
//     /** @return Timeout for initial connect within HTTP client */
//     Integer getConnectTimeout();
// }


// Path: honeybadger-java/src/main/java/io/honeybadger/reporter/dto/Causes.java
import com.fasterxml.jackson.annotation.JsonInclude;
import io.honeybadger.reporter.config.ConfigContext;
import java.io.Serializable;
import java.util.LinkedList;

package io.honeybadger.reporter.dto;



/**
 * An ordered collection of chained exceptions.
 * @author <a href="https://github.com/dekobon">Elijah Zupancic</a>
 * @since 1.0.9
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
@SuppressWarnings("JdkObsolete") // Reason: subtle interface change if we change LinkedList to ArrayList
public class Causes extends LinkedList<Cause> implements Serializable {
    private static final long serialVersionUID = -5359764114506595006L;

    private static final int MAX_CAUSES = 100;

    public Causes(final ConfigContext config, final Throwable rootError) {
        if (rootError == null) {
            throw new IllegalArgumentException("Error can't be null");
        }
        addCauses(config, rootError);
    }

    void addCauses(final ConfigContext config, final Throwable rootError) {
        if (rootError.getCause() == null) return;

        Throwable lastCause = null;
        Throwable nextCause = rootError.getCause();

        int iterations = 0;

        do {
            addFirst(new Cause(config, nextCause));
            ++iterations;
            lastCause = nextCause;