Sunbit v2.4.4版本的 MD5 值为:a5021e5e2a58eb1d6741b432fe7533c4

以下内容为反编译后的 d.java 源代码,内容仅作参考


package q.j;

import d.b.f.u.x;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.concurrent.LinkedBlockingQueue;
import org.slf4j.impl.StaticLoggerBinder;
import q.j.i.h;
import q.j.i.k;
import q.j.i.l;
import q.j.i.m;
public final class d {
    static final String f22805a = "http://www.slf4j.org/codes.html";
    static final String b = "http://www.slf4j.org/codes.html#StaticLoggerBinder";
    static final String c = "http://www.slf4j.org/codes.html#multiple_bindings";
    static final String f22806d = "http://www.slf4j.org/codes.html#null_LF";
    static final String f22807e = "http://www.slf4j.org/codes.html#version_mismatch";
    static final String f22808f = "http://www.slf4j.org/codes.html#substituteLogger";
    static final String f22809g = "http://www.slf4j.org/codes.html#loggerNameMismatch";
    static final String f22810h = "http://www.slf4j.org/codes.html#replay";
    static final String f22811i = "http://www.slf4j.org/codes.html#unsuccessfulInit";
    static final String f22812j = "org.slf4j.LoggerFactory in failed state. Original exception was thrown EARLIER. See also http://www.slf4j.org/codes.html#unsuccessfulInit";
    static final int f22813k = 0;
    static final int f22814l = 1;
    static final int f22815m = 2;
    static final int f22816n = 3;
    static final int f22817o = 4;
    static volatile int f22818p = 0;
    static final String t = "java.vendor.url";
    static final l f22819q = new l();
    static final h f22820r = new h();
    static final String f22821s = "slf4j.detectLoggerNameMismatch";
    static boolean u = m.b(f22821s);
    private static final String[] v = {"1.6", "1.7"};
    private static String w = "org/slf4j/impl/StaticLoggerBinder.class";

    private d() {
    }

    private static final void a() {
        Set<URL> set = null;
        try {
            if (!f()) {
                set = c();
                c(set);
            }
            StaticLoggerBinder.getSingleton();
            f22818p = 3;
            b(set);
            d();
            h();
            f22819q.a();
        } catch (Exception e2) {
            a(e2);
            throw new IllegalStateException("Unexpected initialization failure", e2);
        } catch (NoClassDefFoundError e3) {
            if (b(e3.getMessage())) {
                f22818p = 4;
                m.a("Failed to load class \"org.slf4j.impl.StaticLoggerBinder\".");
                m.a("Defaulting to no-operation (NOP) logger implementation");
                m.a("See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.");
                return;
            }
            a(e3);
            throw e3;
        } catch (NoSuchMethodError e4) {
            String message = e4.getMessage();
            if (message != null && message.contains("org.slf4j.impl.StaticLoggerBinder.getSingleton()")) {
                f22818p = 2;
                m.a("slf4j-api 1.6.x (or later) is incompatible with this binding.");
                m.a("Your binding is version 1.5.5 or earlier.");
                m.a("Upgrade your binding to version 1.6.x.");
            }
            throw e4;
        }
    }

    private static boolean b(String str) {
        if (str == null) {
            return false;
        }
        return str.contains("org/slf4j/impl/StaticLoggerBinder") || str.contains("org.slf4j.impl.StaticLoggerBinder");
    }

    static Set<URL> c() {
        Enumeration<URL> resources;
        LinkedHashSet linkedHashSet = new LinkedHashSet();
        try {
            ClassLoader classLoader = d.class.getClassLoader();
            if (classLoader == null) {
                resources = ClassLoader.getSystemResources(w);
            } else {
                resources = classLoader.getResources(w);
            }
            while (resources.hasMoreElements()) {
                linkedHashSet.add(resources.nextElement());
            }
        } catch (IOException e2) {
            m.a("Error getting resources from path", e2);
        }
        return linkedHashSet;
    }

    private static void d() {
        synchronized (f22819q) {
            f22819q.e();
            for (k kVar : f22819q.d()) {
                kVar.a(a(kVar.getName()));
            }
        }
    }

    public static a e() {
        if (f22818p == 0) {
            synchronized (d.class) {
                if (f22818p == 0) {
                    f22818p = 1;
                    g();
                }
            }
        }
        int i2 = f22818p;
        if (i2 != 1) {
            if (i2 != 2) {
                if (i2 != 3) {
                    if (i2 == 4) {
                        return f22820r;
                    }
                    throw new IllegalStateException("Unreachable code");
                }
                return StaticLoggerBinder.getSingleton().getLoggerFactory();
            }
            throw new IllegalStateException(f22812j);
        }
        return f22819q;
    }

    private static boolean f() {
        String c2 = m.c("java.vendor.url");
        if (c2 == null) {
            return false;
        }
        return c2.toLowerCase().contains("android");
    }

    private static final void g() {
        a();
        if (f22818p == 3) {
            j();
        }
    }

    private static void h() {
        LinkedBlockingQueue<q.j.h.e> b2 = f22819q.b();
        int size = b2.size();
        ArrayList<q.j.h.e> arrayList = new ArrayList(128);
        int i2 = 0;
        while (b2.drainTo(arrayList, 128) != 0) {
            for (q.j.h.e eVar : arrayList) {
                a(eVar);
                int i3 = i2 + 1;
                if (i2 == 0) {
                    a(eVar, size);
                }
                i2 = i3;
            }
            arrayList.clear();
        }
    }

    static void i() {
        f22818p = 0;
    }

    private static final void j() {
        try {
            String str = StaticLoggerBinder.REQUESTED_API_VERSION;
            boolean z = false;
            for (String str2 : v) {
                if (str.startsWith(str2)) {
                    z = true;
                }
            }
            if (z) {
                return;
            }
            m.a("The requested version " + str + " by your slf4j binding is not compatible with " + Arrays.asList(v).toString());
            m.a("See http://www.slf4j.org/codes.html#version_mismatch for further details.");
        } catch (NoSuchFieldError unused) {
        } catch (Throwable th) {
            m.a("Unexpected problem occured during version sanity check", th);
        }
    }

    private static void b() {
        m.a("The following set of substitute loggers may have been accessed");
        m.a("during the initialization phase. Logging calls during this");
        m.a("phase were not honored. However, subsequent logging calls to these");
        m.a("loggers will work as normally expected.");
        m.a("See also http://www.slf4j.org/codes.html#substituteLogger");
    }

    private static void b(Set<URL> set) {
        if (set == null || !a(set)) {
            return;
        }
        m.a("Actual binding is of type [" + StaticLoggerBinder.getSingleton().getLoggerFactoryClassStr() + x.G);
    }

    private static void c(Set<URL> set) {
        if (a(set)) {
            m.a("Class path contains multiple SLF4J bindings.");
            Iterator<URL> it = set.iterator();
            while (it.hasNext()) {
                m.a("Found binding in [" + it.next() + x.G);
            }
            m.a("See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.");
        }
    }

    static void a(Throwable th) {
        f22818p = 2;
        m.a("Failed to instantiate SLF4J LoggerFactory", th);
    }

    private static void a(q.j.h.e eVar, int i2) {
        if (eVar.h().g()) {
            a(i2);
        } else if (eVar.h().h()) {
        } else {
            b();
        }
    }

    private static void a(q.j.h.e eVar) {
        if (eVar == null) {
            return;
        }
        k h2 = eVar.h();
        String name = h2.getName();
        if (!h2.i()) {
            if (h2.h()) {
                return;
            }
            if (h2.g()) {
                h2.a(eVar);
                return;
            } else {
                m.a(name);
                return;
            }
        }
        throw new IllegalStateException("Delegate logger cannot be null at this state.");
    }

    private static void a(int i2) {
        m.a("A number (" + i2 + ") of logging calls during the initialization phase have been intercepted and are");
        m.a("now being replayed. These are subject to the filtering rules of the underlying logging system.");
        m.a("See also http://www.slf4j.org/codes.html#replay");
    }

    private static boolean a(Set<URL> set) {
        return set.size() > 1;
    }

    public static c a(String str) {
        return e().a(str);
    }

    public static c a(Class<?> cls) {
        Class<?> a2;
        c a3 = a(cls.getName());
        if (u && (a2 = m.a()) != null && a(cls, a2)) {
            m.a(String.format("Detected logger name mismatch. Given name: \"%s\"; computed name: \"%s\".", a3.getName(), a2.getName()));
            m.a("See http://www.slf4j.org/codes.html#loggerNameMismatch for an explanation");
        }
        return a3;
    }

    private static boolean a(Class<?> cls, Class<?> cls2) {
        return !cls2.isAssignableFrom(cls);
    }
}