All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jsoup.helper.ValidationException Maven / Gradle / Ivy

Go to download

SDK for dev_appserver (local development) with some of the dependencies shaded (repackaged)

There is a newer version: 2.0.31
Show newest version
package org.jsoup.helper;

import java.util.ArrayList;
import java.util.List;

/**
 Validation exceptions, as thrown by the methods in {@link Validate}.
 */
public class ValidationException extends IllegalArgumentException {

    public static final String Validator = Validate.class.getName();

    public ValidationException(String msg) {
        super(msg);
    }

    @Override
    public synchronized Throwable fillInStackTrace() {
        // Filters out the Validate class from the stacktrace, to more clearly point at the root-cause.

        super.fillInStackTrace();

        StackTraceElement[] stackTrace = getStackTrace();
        List filteredTrace = new ArrayList<>();
        for (StackTraceElement trace : stackTrace) {
            if (trace.getClassName().equals(Validator)) continue;
            filteredTrace.add(trace);
        }

        setStackTrace(filteredTrace.toArray(new StackTraceElement[0]));

        return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy