package com.google.firebase.components;

import java.util.Collections;
import java.util.Iterator;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

/* JADX INFO: loaded from: classes2.dex */
public final class n implements gb.a {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public volatile Set f24034a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public volatile Set f24035b;

    /* JADX WARN: Code restructure failed: missing block: B:20:0x003a, code lost:
    
        r0 = move-exception;
     */
    /* JADX WARN: Code restructure failed: missing block: B:25:0x003f, code lost:
    
        throw r0;
     */
    @Override // gb.a
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object get() {
        if (this.f24035b == null) {
            synchronized (this) {
                try {
                    if (this.f24035b == null) {
                        this.f24035b = Collections.newSetFromMap(new ConcurrentHashMap());
                        synchronized (this) {
                            Iterator it = this.f24034a.iterator();
                            while (it.hasNext()) {
                                this.f24035b.add(((gb.a) it.next()).get());
                            }
                            this.f24034a = null;
                        }
                    }
                } finally {
                }
            }
        }
        return Collections.unmodifiableSet(this.f24035b);
    }
}
