package p421.p422.p423.p424;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.TreeSet;
import java.util.UUID;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import net.engio.mbassy.bus.config.ConfigurationError;
import p138.p176.p177.p242.p246.p251.C4303;
import p421.p422.p423.p424.C6710;
import p421.p422.p423.p424.p425.InterfaceC6717;
import p421.p422.p423.p424.p426.C6719;
import p421.p422.p423.p424.p426.InterfaceC6720;
import p421.p422.p423.p424.p427.InterfaceC6722;
import p421.p422.p423.p431.C6756;
import p421.p422.p423.p431.C6758;
import p421.p422.p423.p432.C6765;
import p421.p422.p423.p432.C6768;
import p421.p422.p423.p432.C6769;
import p421.p422.p423.p432.C6770;

/* JADX INFO: renamed from: ޏ.֏.֏.֏.֏, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public abstract class AbstractC6707<T> implements InterfaceC6717<T> {

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final List<InterfaceC6722> f19471;

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final C6710.C6711 f19472;

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public final C6769 f19473;

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public final C6708 f19474;

    public AbstractC6707(C6719 c6719) {
        ArrayList arrayList = new ArrayList();
        this.f19471 = arrayList;
        arrayList.addAll(Collections.unmodifiableCollection(c6719.f19488));
        if (this.f19471.isEmpty()) {
            this.f19471.add(new InterfaceC6722.C6723());
            System.out.println("INFO: No error handler has been configured to handle exceptions during publication.\nPublication error handlers can be added by IBusConfiguration.addPublicationErrorHandler()\nFalling back to console logger.");
        }
        C6708 c6708 = new C6708(this);
        c6708.f19476.put("bus.handlers.error", Collections.unmodifiableCollection(c6719.f19488));
        c6708.f19476.put("bus.id", c6719.f19487.containsKey("bus.id") ? c6719.f19487.get("bus.id") : UUID.randomUUID().toString());
        this.f19474 = c6708;
        InterfaceC6720.C6721 c6721 = (InterfaceC6720.C6721) ((InterfaceC6720) c6719.f19487.get(InterfaceC6720.C6721.class));
        if (c6721 == null) {
            throw new ConfigurationError("The expected feature " + InterfaceC6720.C6721.class + " was missing. Use addFeature() in IBusConfiguration to add features.");
        }
        C6770 c6770 = c6721.f19492;
        C6758 c6758 = c6721.f19490;
        C6768 c6768 = c6721.f19491;
        C6708 c67082 = this.f19474;
        if (c6770 == null) {
            throw null;
        }
        this.f19473 = new C6769(c6758, c6768, c67082);
        this.f19472 = c6721.f19489;
    }

    public String toString() {
        return getClass().getSimpleName() + "(" + this.f19474.m9909("bus.id") + ")";
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public Collection<C6765> m9908(Class cls) {
        boolean z;
        C6769 c6769 = this.f19473;
        if (c6769 == null) {
            throw null;
        }
        TreeSet treeSet = new TreeSet(C6765.f19548);
        ReentrantReadWriteLock.ReadLock lock = c6769.f19562.readLock();
        try {
            lock.lock();
            ArrayList<C6765> arrayList = c6769.f19558.get(cls);
            if (arrayList != null) {
                treeSet.addAll(arrayList);
            }
            ArrayList arrayList2 = new ArrayList();
            C4303.m7091(cls, (Collection<Class>) arrayList2);
            Class superclass = cls;
            while (!superclass.equals(Object.class) && !superclass.isInterface()) {
                arrayList2.add(superclass.getSuperclass());
                superclass = superclass.getSuperclass();
                C4303.m7091(superclass, (Collection<Class>) arrayList2);
            }
            int size = arrayList2.size();
            Class[] clsArr = new Class[size];
            arrayList2.toArray(clsArr);
            for (int i = 0; i < size; i++) {
                ArrayList<C6765> arrayList3 = c6769.f19558.get(clsArr[i]);
                if (arrayList3 != null) {
                    int size2 = arrayList3.size();
                    for (int i2 = 0; i2 < size2; i2++) {
                        C6765 c6765 = arrayList3.get(i2);
                        C6756 c6756 = c6765.f19552.f19554;
                        for (Class cls2 : c6756.f19535) {
                            if (!cls2.equals(cls) && (!cls2.isAssignableFrom(cls) || !c6756.f19536)) {
                            }
                            z = true;
                            break;
                        }
                        z = false;
                        if (z) {
                            treeSet.add(c6765);
                        }
                    }
                }
            }
            return treeSet;
        } finally {
            lock.unlock();
        }
    }
}
