package kotlin.reflect.jvm.internal.impl.load.java;

import defpackage.cr4;
import defpackage.kp6;
import defpackage.pq6;
import defpackage.vx8;
import java.util.Iterator;
import kotlin.reflect.jvm.internal.impl.descriptors.CallableMemberDescriptor;
import kotlin.reflect.jvm.internal.impl.descriptors.DescriptorVisibility;
import kotlin.reflect.jvm.internal.impl.descriptors.FunctionDescriptor;
import kotlin.reflect.jvm.internal.impl.descriptors.Visibility;
import kotlin.reflect.jvm.internal.impl.descriptors.annotations.AnnotationDescriptor;
import kotlin.reflect.jvm.internal.impl.load.java.descriptors.JavaMethodDescriptor;
import kotlin.reflect.jvm.internal.impl.load.java.lazy.LazyJavaAnnotations;
import kotlin.reflect.jvm.internal.impl.load.java.lazy.LazyJavaResolverContext;
import kotlin.reflect.jvm.internal.impl.load.java.structure.JavaWildcardType;
import kotlin.reflect.jvm.internal.impl.name.FqName;

/* JADX INFO: loaded from: classes3.dex */
@vx8
public final class UtilsKt {
    @pq6
    public static final AnnotationDescriptor extractNullabilityAnnotationOnBoundedWildcard(@kp6 LazyJavaResolverContext lazyJavaResolverContext, @kp6 JavaWildcardType javaWildcardType) {
        AnnotationDescriptor next;
        cr4.g(lazyJavaResolverContext, "c");
        cr4.g(javaWildcardType, "wildcardType");
        if (javaWildcardType.getBound() == null) {
            throw new IllegalArgumentException("Nullability annotations on unbounded wildcards aren't supported");
        }
        Iterator<AnnotationDescriptor> it = new LazyJavaAnnotations(lazyJavaResolverContext, javaWildcardType, false, 4, null).iterator();
        loop0: while (true) {
            if (!it.hasNext()) {
                next = null;
                break;
            }
            next = it.next();
            AnnotationDescriptor annotationDescriptor = next;
            for (FqName fqName : JavaNullabilityAnnotationSettingsKt.getRXJAVA3_ANNOTATIONS()) {
                if (cr4.b(annotationDescriptor.getFqName(), fqName)) {
                    break loop0;
                }
            }
        }
        return next;
    }

    public static final boolean hasErasedValueParameters(@kp6 CallableMemberDescriptor callableMemberDescriptor) {
        cr4.g(callableMemberDescriptor, "memberDescriptor");
        return (callableMemberDescriptor instanceof FunctionDescriptor) && cr4.b(callableMemberDescriptor.getUserData(JavaMethodDescriptor.HAS_ERASED_VALUE_PARAMETERS), Boolean.TRUE);
    }

    public static final boolean isJspecifyEnabledInStrictMode(@kp6 JavaTypeEnhancementState javaTypeEnhancementState) {
        cr4.g(javaTypeEnhancementState, "javaTypeEnhancementState");
        return javaTypeEnhancementState.getGetReportLevelForAnnotation().invoke(JavaNullabilityAnnotationSettingsKt.getJSPECIFY_ANNOTATIONS_PACKAGE()) == ReportLevel.STRICT;
    }

    @kp6
    public static final DescriptorVisibility toDescriptorVisibility(@kp6 Visibility visibility) {
        cr4.g(visibility, "<this>");
        DescriptorVisibility descriptorVisibility = JavaDescriptorVisibilities.toDescriptorVisibility(visibility);
        cr4.f(descriptorVisibility, "toDescriptorVisibility(...)");
        return descriptorVisibility;
    }
}
