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

import com.l7tech.gateway.common.cluster.ClusterProperty;
import com.l7tech.server.cluster.ClusterPropertyManagerImpl;
import com.l7tech.server.util.ReadOnlyHibernateCallback;
import java.sql.SQLException;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.query.Query;

class w
extends ReadOnlyHibernateCallback<Object> {
    final String val$key;
    final boolean val$describe;
    final ClusterPropertyManagerImpl this$0;
    private static final String a = w.a(110, w.a("&}\u0011\u000f"));

    w(ClusterPropertyManagerImpl clusterPropertyManagerImpl, String string, boolean bl2) {
        this.this$0 = clusterPropertyManagerImpl;
        this.val$key = string;
        this.val$describe = bl2;
    }

    @Override
    public Object doInHibernateReadOnly(Session session) throws HibernateException, SQLException {
        ClusterProperty clusterProperty;
        Query query = session.createQuery(this.this$0.n);
        query.setParameter(a, (Object)this.val$key);
        ClusterProperty clusterProperty2 = (ClusterProperty)query.uniqueResult();
        try {
            clusterProperty = this.val$describe ? this.this$0.b(clusterProperty2) : clusterProperty2;
        }
        catch (HibernateException hibernateException) {
            throw w.a(hibernateException);
        }
        return clusterProperty;
    }

    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] ^ 0x7D);
        }
        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 -> 38;
                    case 1 -> 114;
                    case 2 -> 18;
                    case 3 -> 4;
                    case 4 -> 41;
                    case 5 -> 116;
                    default -> 125;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

