/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.solutionkit.SolutionKit
 *  com.l7tech.objectmodel.Goid
 *  org.hibernate.HibernateException
 *  org.hibernate.Session
 *  org.hibernate.query.Query
 */
package com.l7tech.server.solutionkit;

import com.l7tech.gateway.common.solutionkit.SolutionKit;
import com.l7tech.objectmodel.Goid;
import com.l7tech.server.solutionkit.SolutionKitManagerImpl;
import com.l7tech.server.util.ReadOnlyHibernateCallback;
import java.sql.SQLException;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.query.Query;

class m
extends ReadOnlyHibernateCallback<Collection<SolutionKit>> {
    final Goid val$parentGoid;
    final SolutionKitManagerImpl this$0;
    private static final String a = m.a(48, m.a("<$;)>\u0007r#,-"));

    m(SolutionKitManagerImpl solutionKitManagerImpl, Goid goid) {
        this.this$0 = solutionKitManagerImpl;
        this.val$parentGoid = goid;
    }

    @Override
    protected Collection<SolutionKit> doInHibernateReadOnly(Session session) throws HibernateException, SQLException {
        List list;
        Query query = session.createQuery(this.this$0.s);
        query.setParameter(a, (Object)this.val$parentGoid);
        List list2 = query.list();
        try {
            list = list2 == null ? Collections.emptyList() : list2;
        }
        catch (HibernateException hibernateException) {
            throw m.a(hibernateException);
        }
        return list;
    }

    private static HibernateException a(HibernateException hibernateException) {
        return hibernateException;
    }

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

    /*
     * Handled impossible loop by duplicating code
     * Enabled aggressive block sorting
     */
    private static String a(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 -> 124;
                    case 1 -> 117;
                    case 2 -> 121;
                    case 3 -> 124;
                    case 4 -> 96;
                    case 5 -> 67;
                    default -> 5;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

