/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.objectmodel.Goid
 *  org.hibernate.HibernateException
 *  org.hibernate.Session
 *  org.hibernate.query.Query
 *  org.hibernate.type.BinaryType
 *  org.hibernate.type.Type
 *  org.springframework.orm.hibernate5.HibernateCallback
 */
package com.l7tech.server.identity;

import com.l7tech.objectmodel.Goid;
import com.l7tech.server.identity.PersistentGroupManagerImpl;
import java.util.Iterator;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.query.Query;
import org.hibernate.type.BinaryType;
import org.hibernate.type.Type;
import org.springframework.orm.hibernate5.HibernateCallback;

class l
implements HibernateCallback<Void> {
    final Goid val$ipoid;
    private static final String a = l.a(81, l.a("\u0013O\u0000N:k<\u0011t\u000b"));

    /*
     * Ignored method signature, as it can't be verified against descriptor
     */
    l(PersistentGroupManagerImpl persistentGroupManagerImpl, Goid goid) {
        this.val$ipoid = goid;
    }

    public Void doInHibernate(Session session) throws HibernateException {
        Query query = session.createQuery(PersistentGroupManagerImpl.o);
        query.setParameter(a, (Object)this.val$ipoid.getBytes(), (Type)new BinaryType());
        Iterator iterator = query.iterate();
        try {
            while (iterator.hasNext()) {
                session.delete(iterator.next());
            }
        }
        catch (HibernateException hibernateException) {
            throw l.a(hibernateException);
        }
        return null;
    }

    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] ^ 8);
        }
        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 -> 50;
                    case 1 -> 108;
                    case 2 -> 62;
                    case 3 -> 105;
                    case 4 -> 2;
                    case 5 -> 94;
                    default -> 8;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

