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

io.cucumber.core.resource.ClassLoaders Maven / Gradle / Ivy

There is a newer version: 7.20.1
Show newest version
package io.cucumber.core.resource;

import static io.cucumber.core.exception.UnrecoverableExceptions.rethrowIfUnrecoverable;

public final class ClassLoaders {

    private ClassLoaders() {

    }

    public static ClassLoader getDefaultClassLoader() {
        try {
            ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
            if (contextClassLoader != null) {
                return contextClassLoader;
            }
        } catch (Throwable t) {
            rethrowIfUnrecoverable(t);
        }
        return ClassLoader.getSystemClassLoader();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy