/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.service.ServiceDocument
 *  com.l7tech.objectmodel.FindException
 *  com.l7tech.objectmodel.Goid
 *  com.l7tech.wsdl.Wsdl
 */
package com.l7tech.server.service.resolution;

import com.l7tech.gateway.common.service.ServiceDocument;
import com.l7tech.objectmodel.FindException;
import com.l7tech.objectmodel.Goid;
import com.l7tech.server.service.resolution.SoapOperationResolver;
import com.l7tech.server.service.resolution.k;
import com.l7tech.wsdl.Wsdl;
import java.util.Collection;
import java.util.Collections;

class l
extends k {
    private Collection<ServiceDocument> f;
    final Goid val$serviceGoid;
    final SoapOperationResolver this$0;
    private static final String[] h;

    l(SoapOperationResolver soapOperationResolver, Wsdl wsdl, Goid goid) {
        this.this$0 = soapOperationResolver;
        this.val$serviceGoid = goid;
        super(wsdl);
    }

    @Override
    public String resolveSchema(String string) {
        String string2 = null;
        for (ServiceDocument serviceDocument : this.a()) {
            if (!string.equals(serviceDocument.getUri()) || !h[0].equalsIgnoreCase(serviceDocument.getContentType())) continue;
            string2 = serviceDocument.getContents();
        }
        return string2;
    }

    private Collection<ServiceDocument> a() {
        if (this.f == null) {
            try {
                this.f = this.this$0.c.findByServiceIdAndType(this.val$serviceGoid, h[1]);
            }
            catch (FindException findException) {
                this.f = Collections.emptyList();
            }
        }
        return this.f;
    }

    /*
     * Enabled aggressive block sorting
     */
    static {
        String[] stringArray = new String[2];
        int n2 = 0;
        String string = "x*zzbR$`\u000b[\u001cFB`c\u0004\\\u0000PZ";
        int n3 = "x*zzbR$`\u000b[\u001cFB`c\u0004\\\u0000PZ".length();
        int n4 = 8;
        int n5 = -1;
        while (true) {
            int n6 = ++n5;
            stringArray[n2++] = l.b(50, l.b(string.substring(n6, n6 + n4)));
            if ((n5 += n4) >= n3) {
                h = stringArray;
                return;
            }
            n4 = string.charAt(n5);
        }
    }

    private static char[] b(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x7B);
        }
        return cArray;
    }

    /*
     * Handled impossible loop by duplicating code
     * Enabled aggressive block sorting
     */
    private static String b(int n2, char[] cArray) {
        char[] cArray2;
        block11: {
            int n3;
            int n4;
            int n5;
            block10: {
                n5 = n2;
                cArray2 = cArray;
                n4 = cArray.length;
                n3 = 0;
                if (!true) break block10;
                n4 = n4;
                if (n4 <= n3) break block11;
            }
            do {
                n5 = n5;
                cArray2 = cArray2;
                int n6 = n3;
                cArray2[n6] = (char)(cArray2[n6] ^ (n5 ^ (switch (n3 % 7) {
                    case 0 -> 62;
                    case 1 -> 125;
                    case 2 -> 48;
                    case 3 -> 60;
                    case 4 -> 127;
                    case 5 -> 24;
                    default -> 123;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

