74 lines
2.6 KiB
Java
74 lines
2.6 KiB
Java
package o;
|
|
|
|
import java.util.Iterator;
|
|
import java.util.ServiceConfigurationError;
|
|
import java.util.ServiceLoader;
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
|
|
/* renamed from: o.gub, reason: case insensitive filesystem */
|
|
/* loaded from: classes.dex */
|
|
public abstract class AbstractC15575gub {
|
|
public static final AbstractC15575gub DO_NOTHING = new RVV();
|
|
private static final AtomicBoolean INITIALIZED = new AtomicBoolean(false);
|
|
private static final AtomicReference<AbstractC15575gub> INITIALIZER = new AtomicReference<>();
|
|
|
|
protected abstract void initializeProviders();
|
|
|
|
public static void setInitializer(AbstractC15575gub abstractC15575gub) {
|
|
if (INITIALIZED.get()) {
|
|
throw new IllegalStateException("Already initialized");
|
|
}
|
|
AtomicReference<AbstractC15575gub> atomicReference = INITIALIZER;
|
|
while (!atomicReference.compareAndSet(null, abstractC15575gub)) {
|
|
if (atomicReference.get() != null) {
|
|
throw new IllegalStateException("Initializer was already set, possibly with a default during initialization");
|
|
}
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static void initialize() {
|
|
if (INITIALIZED.getAndSet(true)) {
|
|
throw new IllegalStateException("Already initialized");
|
|
}
|
|
AtomicReference<AbstractC15575gub> atomicReference = INITIALIZER;
|
|
LWm lWm = new LWm();
|
|
while (!atomicReference.compareAndSet(null, lWm) && atomicReference.get() == null) {
|
|
}
|
|
atomicReference.get().initializeProviders();
|
|
}
|
|
|
|
/* renamed from: o.gub$RVV */
|
|
/* loaded from: classes.dex */
|
|
static class RVV extends AbstractC15575gub {
|
|
@Override // o.AbstractC15575gub
|
|
protected final void initializeProviders() {
|
|
}
|
|
|
|
RVV() {
|
|
}
|
|
}
|
|
|
|
/* renamed from: o.gub$LWm */
|
|
/* loaded from: classes6.dex */
|
|
static class LWm extends AbstractC15575gub {
|
|
LWm() {
|
|
}
|
|
|
|
@Override // o.AbstractC15575gub
|
|
protected final void initializeProviders() {
|
|
Iterator it = ServiceLoader.load(AbstractC15576guc.class, AbstractC15576guc.class.getClassLoader()).iterator();
|
|
while (it.hasNext()) {
|
|
try {
|
|
AbstractC15576guc.registerProvider((AbstractC15576guc) it.next());
|
|
} catch (ServiceConfigurationError e) {
|
|
if (!(e.getCause() instanceof SecurityException)) {
|
|
throw e;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|