/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.identity.Group
 *  com.l7tech.identity.GroupMembership
 *  com.l7tech.identity.Identity
 *  com.l7tech.identity.PersistentGroup
 *  com.l7tech.identity.PersistentUser
 *  com.l7tech.identity.User
 *  com.l7tech.identity.fed.VirtualGroup
 *  com.l7tech.objectmodel.DeleteException
 *  com.l7tech.objectmodel.DuplicateObjectException
 *  com.l7tech.objectmodel.EntityHeader
 *  com.l7tech.objectmodel.EntityManager$UniqueType
 *  com.l7tech.objectmodel.EntityType
 *  com.l7tech.objectmodel.FindException
 *  com.l7tech.objectmodel.Goid
 *  com.l7tech.objectmodel.IdentityHeader
 *  com.l7tech.objectmodel.ObjectModelException
 *  com.l7tech.objectmodel.ObjectNotFoundException
 *  com.l7tech.objectmodel.SaveException
 *  com.l7tech.objectmodel.StaleUpdateException
 *  com.l7tech.objectmodel.UpdateException
 *  com.l7tech.objectmodel.imp.PersistentEntityUtil
 *  com.l7tech.util.ExceptionUtils
 *  jakarta.persistence.criteria.CriteriaBuilder
 *  jakarta.persistence.criteria.Predicate
 *  jakarta.persistence.criteria.Root
 *  org.hibernate.HibernateException
 *  org.jetbrains.annotations.Nullable
 *  org.springframework.dao.DataAccessException
 *  org.springframework.orm.hibernate5.HibernateCallback
 */
package com.l7tech.server.identity;

import com.l7tech.identity.Group;
import com.l7tech.identity.GroupMembership;
import com.l7tech.identity.Identity;
import com.l7tech.identity.PersistentGroup;
import com.l7tech.identity.PersistentUser;
import com.l7tech.identity.User;
import com.l7tech.identity.fed.VirtualGroup;
import com.l7tech.objectmodel.DeleteException;
import com.l7tech.objectmodel.DuplicateObjectException;
import com.l7tech.objectmodel.EntityHeader;
import com.l7tech.objectmodel.EntityManager;
import com.l7tech.objectmodel.EntityType;
import com.l7tech.objectmodel.FindException;
import com.l7tech.objectmodel.Goid;
import com.l7tech.objectmodel.IdentityHeader;
import com.l7tech.objectmodel.ObjectModelException;
import com.l7tech.objectmodel.ObjectNotFoundException;
import com.l7tech.objectmodel.SaveException;
import com.l7tech.objectmodel.StaleUpdateException;
import com.l7tech.objectmodel.UpdateException;
import com.l7tech.objectmodel.imp.PersistentEntityUtil;
import com.l7tech.server.HibernateEntityManager;
import com.l7tech.server.identity.PersistentGroupManager;
import com.l7tech.server.identity.PersistentIdentityProvider;
import com.l7tech.server.identity.PersistentUserManager;
import com.l7tech.server.identity.k;
import com.l7tech.server.identity.l;
import com.l7tech.server.identity.m;
import com.l7tech.server.identity.q;
import com.l7tech.server.identity.r;
import com.l7tech.server.identity.s;
import com.l7tech.server.identity.t;
import com.l7tech.util.ExceptionUtils;
import jakarta.persistence.criteria.CriteriaBuilder;
import jakarta.persistence.criteria.Predicate;
import jakarta.persistence.criteria.Root;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.hibernate.HibernateException;
import org.jetbrains.annotations.Nullable;
import org.springframework.dao.DataAccessException;
import org.springframework.orm.hibernate5.HibernateCallback;

public abstract class PersistentGroupManagerImpl<UT extends PersistentUser, GT extends PersistentGroup, UMT extends PersistentUserManager<UT>, GMT extends PersistentGroupManager<UT, GT>>
extends HibernateEntityManager<GT, IdentityHeader>
implements PersistentGroupManager<UT, GT> {
    private final String m;
    private final String n;
    private static final String o;
    private final String p;
    private final String q;
    private String r;
    protected PersistentIdentityProvider<UT, GT, UMT, GMT> identityProvider;
    private final Logger s;
    private static final String[] w;

    protected PersistentGroupManagerImpl() {
        String[] stringArray = w;
        this.m = stringArray[34] + this.getImpClass().getName() + stringArray[14];
        this.n = stringArray[23] + this.getMembershipClass().getName() + stringArray[9];
        this.p = stringArray[4] + this.getImpClass().getName() + stringArray[1] + this.getMembershipClass().getName() + stringArray[12];
        this.q = stringArray[35] + this.getMembershipClass().getName() + stringArray[8];
        this.s = Logger.getLogger(this.getClass().getName());
    }

    public synchronized void setIdentityProvider(PersistentIdentityProvider<UT, GT, UMT, GMT> persistentIdentityProvider) {
        try {
            if (this.identityProvider != null) {
                throw new IllegalStateException(w[17]);
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw PersistentGroupManagerImpl.a(illegalStateException);
        }
        this.identityProvider = persistentIdentityProvider;
    }

    private synchronized String a() {
        if (this.r == null) {
            String[] stringArray = w;
            StringBuilder stringBuilder = new StringBuilder(stringArray[19]);
            stringBuilder.append(((PersistentUserManager)this.identityProvider.getUserManager()).getImpClass().getName()).append(stringArray[18]);
            stringBuilder.append(stringArray[31]).append(this.getMembershipClass().getName());
            stringBuilder.append(stringArray[20]);
            stringBuilder.append(stringArray[22]);
            this.r = stringBuilder.toString();
        }
        return this.r;
    }

    public GT findByName(String string) throws FindException {
        PersistentGroup persistentGroup = (PersistentGroup)super.findByUniqueName(string);
        try {
            if (persistentGroup != null) {
                persistentGroup.setProviderId(this.identityProvider.getConfig().getGoid());
            }
        }
        catch (FindException findException) {
            throw PersistentGroupManagerImpl.a((Exception)((Object)findException));
        }
        return (GT)persistentGroup;
    }

    public GT findByPrimaryKey(String string) throws FindException {
        try {
            if (string == null) {
                this.s.fine(w[15]);
                return null;
            }
        }
        catch (FindException findException) {
            throw PersistentGroupManagerImpl.a((Exception)((Object)findException));
        }
        try {
            PersistentGroup persistentGroup = (PersistentGroup)this.findByPrimaryKey(this.getImpClass(), Goid.parseGoid((String)string));
            if (persistentGroup == null) {
                return null;
            }
            persistentGroup.setProviderId(this.getProviderGoid());
            return (GT)persistentGroup;
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw new FindException(w[26] + string, (Throwable)illegalArgumentException);
        }
    }

    public Collection<IdentityHeader> search(String string) throws FindException {
        try {
            return (Collection)this.getHibernateTemplate().execute((HibernateCallback)new q(this, string));
        }
        catch (HibernateException hibernateException) {
            String[] stringArray = w;
            String string2 = stringArray[2] + this.getInterfaceClass().getName() + stringArray[5];
            this.s.log(Level.SEVERE, string2, hibernateException);
            throw new FindException(string2, (Throwable)hibernateException);
        }
    }

    @Override
    protected IdentityHeader newHeader(GT GT) {
        return new IdentityHeader(this.getProviderGoid(), GT.getGoid(), EntityType.GROUP, GT.getName(), GT.getDescription(), null, GT.getVersion());
    }

    protected Goid getProviderGoid() {
        return this.identityProvider.getConfig().getGoid();
    }

    @Override
    public void delete(Goid goid) throws DeleteException, FindException {
        this.findAndDelete(goid);
    }

    @Override
    public void delete(GT GT) throws DeleteException {
        try {
            GT GT2 = this.cast((Group)GT);
            this.preDelete(GT2);
            Set<IdentityHeader> set = this.getUserHeaders(GT2);
            for (IdentityHeader identityHeader : set) {
                PersistentUser persistentUser = (PersistentUser)((PersistentUserManager)this.identityProvider.getUserManager()).headerToUser(identityHeader);
                this.deleteMembership(GT2, persistentUser);
            }
            this.getHibernateTemplate().delete(GT2);
            this.postDelete(GT2);
        }
        catch (ObjectModelException objectModelException) {
            throw new DeleteException(objectModelException.getMessage(), (Throwable)objectModelException);
        }
        catch (HibernateException hibernateException) {
            throw new DeleteException(hibernateException.toString(), (Throwable)hibernateException);
        }
    }

    protected abstract Class getMembershipClass();

    protected void preSave(GT GT) throws SaveException {
    }

    protected void preDelete(GT GT) throws DeleteException {
    }

    protected void postDelete(GT GT) throws DeleteException {
    }

    protected void preUpdate(GT GT) throws FindException, UpdateException {
    }

    protected void postUpdate(GT GT) throws UpdateException {
    }

    protected abstract GT cast(Group var1);

    @Override
    public void delete(String string) throws DeleteException, ObjectNotFoundException {
        String[] stringArray = w;
        String string2 = stringArray[27];
        try {
            GT GT = this.findByPrimaryKey(string);
            try {
                if (GT == null) {
                    throw new ObjectNotFoundException(stringArray[24]);
                }
            }
            catch (FindException findException) {
                throw PersistentGroupManagerImpl.a((Exception)((Object)findException));
            }
            this.delete(GT);
        }
        catch (FindException findException) {
            this.s.log(Level.WARNING, findException.getMessage(), findException);
            throw new ObjectNotFoundException(w[24], (Throwable)findException);
        }
    }

    public void deleteAll(Goid goid) throws DeleteException, ObjectNotFoundException {
        try {
            this.getHibernateTemplate().execute((HibernateCallback)new k(this, goid));
        }
        catch (Exception exception) {
            this.s.log(Level.SEVERE, exception.getMessage(), exception);
            throw new DeleteException(exception.getMessage(), (Throwable)exception);
        }
        this.postDelete(null);
    }

    public void deleteAllVirtual(Goid goid) throws DeleteException, ObjectNotFoundException {
        try {
            this.getHibernateTemplate().execute((HibernateCallback)new l(this, goid));
        }
        catch (Exception exception) {
            this.s.log(Level.SEVERE, exception.getMessage(), exception);
            throw new DeleteException(exception.getMessage(), (Throwable)exception);
        }
    }

    public String saveGroup(GT GT) throws SaveException {
        return this.save(GT, null);
    }

    public String save(GT GT, Set<IdentityHeader> set) throws SaveException {
        return this.save(null, GT, set);
    }

    /*
     * Enabled aggressive block sorting
     * Enabled unnecessary exception pruning
     * Enabled aggressive exception aggregation
     */
    public String save(@Nullable Goid goid, GT GT, Set<IdentityHeader> set) throws SaveException {
        try {
            String string;
            block23: {
                Group group;
                block22: {
                    try {
                        group = (Group)this.findByUniqueName(GT.getName());
                    }
                    catch (FindException findException) {
                        group = null;
                    }
                    try {
                        if (group != null || goid == null) break block22;
                    }
                    catch (FindException findException) {
                        throw PersistentGroupManagerImpl.a((Exception)((Object)findException));
                    }
                    try {
                        group = (Group)this.findByPrimaryKey(goid);
                    }
                    catch (FindException findException) {
                        group = null;
                    }
                }
                try {
                    if (group != null) {
                        throw new DuplicateObjectException(w[0] + GT.getName() + "'");
                    }
                }
                catch (FindException findException) {
                    throw PersistentGroupManagerImpl.a((Exception)((Object)findException));
                }
                GT GT2 = this.cast((Group)GT);
                GT2.setProviderId(this.identityProvider.getConfig().getGoid());
                this.preSave(GT2);
                if (goid != null) {
                    boolean bl2 = PersistentEntityUtil.preserveId(GT2);
                    try {
                        if (!bl2) {
                            throw new SaveException(w[25] + GT2.getClass().getSimpleName());
                        }
                    }
                    catch (FindException findException) {
                        throw PersistentGroupManagerImpl.a((Exception)((Object)findException));
                    }
                    GT2.setGoid(goid);
                }
                string = this.getHibernateTemplate().save(GT2).toString();
                try {
                    if (goid == null || goid.toString().equals(string)) break block23;
                }
                catch (FindException findException) {
                    throw PersistentGroupManagerImpl.a((Exception)((Object)findException));
                }
                String string2 = GT2.getClass().getSimpleName();
                String string3 = string;
                String string4 = String.valueOf(goid);
                String[] stringArray = w;
                throw new SaveException(stringArray[33] + string4 + stringArray[21] + string3 + stringArray[11] + string2);
            }
            try {
                if (set == null) return string;
                try {
                    this.setUserHeaders(string, set);
                    return string;
                }
                catch (FindException findException) {
                    this.s.log(Level.SEVERE, findException.getMessage());
                    throw new SaveException(findException.getMessage(), (Throwable)findException);
                }
                catch (UpdateException updateException) {
                    this.s.log(Level.SEVERE, updateException.getMessage());
                    throw new SaveException(updateException.getMessage(), (Throwable)updateException);
                }
            }
            catch (DataAccessException dataAccessException) {
                throw PersistentGroupManagerImpl.a((Exception)((Object)dataAccessException));
            }
        }
        catch (DataAccessException dataAccessException) {
            throw new SaveException(dataAccessException.toString(), (Throwable)dataAccessException);
        }
    }

    @Override
    public void update(GT GT) throws UpdateException {
        this.update(GT, null);
    }

    public void update(GT GT, Set<IdentityHeader> set) throws UpdateException {
        GT GT2 = this.cast((Group)GT);
        try {
            this.preUpdate(GT2);
            GT GT3 = this.findByPrimaryKey(GT.getId());
            try {
                if (GT3 == null) {
                    throw new FindException(w[32] + GT.getName());
                }
            }
            catch (FindException findException) {
                throw PersistentGroupManagerImpl.a((Exception)((Object)findException));
            }
            if (GT3.getVersion() != GT2.getVersion()) {
                String[] stringArray = w;
                String string = stringArray[30];
                this.s.info(string);
                throw new StaleUpdateException(string);
            }
            try {
                if (!GT.getProviderId().equals((Object)this.identityProvider.getConfig().getGoid())) {
                    throw new IllegalArgumentException(w[6]);
                }
            }
            catch (FindException findException) {
                throw PersistentGroupManagerImpl.a((Exception)((Object)findException));
            }
            this.setUserHeaders(GT.getId(), set);
            GT3.copyFrom(GT2);
            this.getHibernateTemplate().update(GT3);
            this.postUpdate(GT3);
        }
        catch (FindException findException) {
            throw new UpdateException(w[16], (Throwable)findException);
        }
        catch (DataAccessException dataAccessException) {
            throw new UpdateException(dataAccessException.toString(), (Throwable)dataAccessException);
        }
    }

    public boolean isMember(User user, GT GT) throws FindException {
        try {
            if (!this.checkProvider(user)) {
                return false;
            }
        }
        catch (Exception exception) {
            throw PersistentGroupManagerImpl.a(exception);
        }
        try {
            return (Boolean)this.getHibernateTemplate().execute((HibernateCallback)new r(this, user, (PersistentGroup)GT));
        }
        catch (Exception exception) {
            throw new FindException(exception.getMessage(), (Throwable)exception);
        }
    }

    protected boolean checkProvider(User user) {
        String string = null;
        Level level = null;
        if (Goid.isDefault((Goid)user.getProviderId())) {
            String[] stringArray = w;
            string = stringArray[7];
            level = Level.WARNING;
        } else if (!user.getProviderId().equals((Object)this.identityProvider.getConfig().getGoid())) {
            string = w[3];
            level = Level.FINE;
        }
        try {
            if (string != null) {
                this.s.log(level, string);
                return false;
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw PersistentGroupManagerImpl.a(illegalStateException);
        }
        return true;
    }

    public void addUsers(GT GT, Set<UT> set) throws FindException, UpdateException {
        GT GT2 = this.cast((Group)GT);
        try {
            for (PersistentUser persistentUser : set) {
                this.getHibernateTemplate().save((Object)this.newMembership((PersistentGroup)GT2, persistentUser));
            }
        }
        catch (Exception exception) {
            throw new FindException(exception.getMessage(), (Throwable)exception);
        }
    }

    public void removeUsers(GT GT, Set<UT> set) throws FindException, UpdateException {
        GT GT2 = this.cast((Group)GT);
        try {
            for (PersistentUser persistentUser : set) {
                this.deleteMembership(GT2, persistentUser);
            }
        }
        catch (HibernateException hibernateException) {
            throw new FindException(hibernateException.getMessage(), (Throwable)hibernateException);
        }
        try {
            this.postDelete(null);
        }
        catch (DeleteException deleteException) {
            throw new UpdateException(ExceptionUtils.getMessage((Throwable)deleteException), (Throwable)deleteException);
        }
    }

    @Override
    public void deleteMembership(GT GT, UT UT) throws HibernateException {
        this.getHibernateTemplate().execute((HibernateCallback)new m(this, (PersistentUser)UT, (PersistentGroup)GT));
    }

    protected abstract Predicate addMembershipPredicate(Predicate var1, CriteriaBuilder var2, Root<GroupMembership> var3, Group var4, Identity var5);

    public void addUser(UT UT, Set<GT> set) throws FindException, UpdateException {
        Object UT2 = ((PersistentUserManager)this.identityProvider.getUserManager()).cast((User)UT);
        try {
            for (PersistentGroup persistentGroup : set) {
                this.getHibernateTemplate().save((Object)this.newMembership(persistentGroup, (PersistentUser)UT2));
            }
        }
        catch (Exception exception) {
            throw new FindException(exception.getMessage(), (Throwable)exception);
        }
    }

    public void removeUser(UT UT, Set<GT> set) throws FindException, UpdateException {
        Object UT2 = ((PersistentUserManager)this.identityProvider.getUserManager()).cast((User)UT);
        try {
            for (PersistentGroup persistentGroup : set) {
                this.deleteMembership(persistentGroup, UT2);
            }
        }
        catch (HibernateException hibernateException) {
            throw new FindException(hibernateException.getMessage(), (Throwable)hibernateException);
        }
        try {
            this.postDelete(null);
        }
        catch (DeleteException deleteException) {
            throw new UpdateException(ExceptionUtils.getMessage((Throwable)deleteException), (Throwable)deleteException);
        }
    }

    public void addUser(UT UT, GT GT) throws FindException, UpdateException {
        Object UT2 = ((PersistentUserManager)this.identityProvider.getUserManager()).cast((User)UT);
        GT GT2 = this.cast((Group)GT);
        try {
            this.getHibernateTemplate().save((Object)this.newMembership((PersistentGroup)GT2, (PersistentUser)UT2));
        }
        catch (HibernateException hibernateException) {
            throw new FindException(hibernateException.getMessage(), (Throwable)hibernateException);
        }
    }

    public void removeUser(UT UT, GT GT) throws FindException, UpdateException {
        Object UT2 = ((PersistentUserManager)this.identityProvider.getUserManager()).cast((User)UT);
        GT GT2 = this.cast((Group)GT);
        try {
            this.deleteMembership(GT2, UT2);
        }
        catch (HibernateException hibernateException) {
            throw new FindException(hibernateException.getMessage(), (Throwable)hibernateException);
        }
        try {
            this.postDelete(null);
        }
        catch (DeleteException deleteException) {
            throw new UpdateException(ExceptionUtils.getMessage((Throwable)deleteException), (Throwable)deleteException);
        }
    }

    public Set<IdentityHeader> getGroupHeaders(UT UT) throws FindException {
        return this.getGroupHeaders(UT.getId());
    }

    public Set<IdentityHeader> getGroupHeaders(String string) throws FindException {
        try {
            return this.a(string);
        }
        catch (HibernateException hibernateException) {
            throw new FindException(hibernateException.toString(), (Throwable)hibernateException);
        }
    }

    public Set<IdentityHeader> getGroupHeadersForNestedGroup(String string) throws FindException {
        return Collections.emptySet();
    }

    public void setGroupHeaders(UT UT, Set<IdentityHeader> set) throws FindException, UpdateException {
        this.setGroupHeaders(UT.getId(), set);
    }

    public void setGroupHeaders(String string, Set<IdentityHeader> set) throws FindException, UpdateException {
        try {
            if (set == null) {
                return;
            }
        }
        catch (HibernateException hibernateException) {
            throw PersistentGroupManagerImpl.a((Exception)((Object)hibernateException));
        }
        try {
            GT GT;
            Set<String> set2 = this.a(set);
            Set<String> set3 = this.a(this.a(string));
            PersistentUser persistentUser = (PersistentUser)((PersistentUserManager)this.identityProvider.getUserManager()).findByPrimaryKey(string);
            for (String string2 : set2) {
                if (set3.contains(string2)) continue;
                GT = this.cast((Group)this.findByPrimaryKey(string2));
                GroupMembership groupMembership = this.newMembership((PersistentGroup)GT, persistentUser);
                this.getHibernateTemplate().save((Object)groupMembership);
            }
            for (String string2 : set3) {
                if (set2.contains(string2)) continue;
                GT = this.findByPrimaryKey(string2);
                this.deleteMembership(GT, persistentUser);
            }
        }
        catch (HibernateException hibernateException) {
            throw new UpdateException(hibernateException.toString(), (Throwable)hibernateException);
        }
    }

    public Set<IdentityHeader> getUserHeaders(GT GT) throws FindException {
        return this.getUserHeaders(GT.getId());
    }

    public Set<IdentityHeader> getUserHeaders(String string) throws FindException {
        try {
            return this.a(Goid.parseGoid((String)string));
        }
        catch (HibernateException hibernateException) {
            throw new FindException(hibernateException.toString(), (Throwable)hibernateException);
        }
    }

    private Set<IdentityHeader> a(Goid goid) throws HibernateException {
        return (Set)this.getHibernateTemplate().execute((HibernateCallback)new s(this, goid));
    }

    private Set<IdentityHeader> a(String string) throws HibernateException {
        return (Set)this.getHibernateTemplate().execute((HibernateCallback)new t(this, string));
    }

    public void setUserHeaders(GT GT, Set<IdentityHeader> set) throws FindException, UpdateException {
        this.setUserHeaders(GT.getId(), set);
    }

    private Set<String> a(Set<IdentityHeader> set) {
        HashSet<String> hashSet = new HashSet<String>();
        for (EntityHeader entityHeader : set) {
            hashSet.add(entityHeader.getStrId());
        }
        return hashSet;
    }

    public void setUserHeaders(String string, Set<IdentityHeader> set) throws FindException, UpdateException {
        try {
            if (set == null) {
                return;
            }
        }
        catch (HibernateException hibernateException) {
            throw PersistentGroupManagerImpl.a((Exception)((Object)hibernateException));
        }
        try {
            PersistentUser persistentUser;
            Set<String> set2 = this.a(set);
            Set<String> set3 = this.a(this.a(Goid.parseGoid((String)string)));
            GT GT = this.findByPrimaryKey(string);
            PersistentUserManager persistentUserManager = (PersistentUserManager)this.identityProvider.getUserManager();
            for (String string2 : set2) {
                if (set3.contains(string2)) continue;
                persistentUser = (PersistentUser)persistentUserManager.findByPrimaryKey(string2);
                this.getHibernateTemplate().save((Object)this.newMembership((PersistentGroup)GT, persistentUser));
            }
            for (String string2 : set3) {
                if (set2.contains(string2)) continue;
                persistentUser = (PersistentUser)persistentUserManager.findByPrimaryKey(string2);
                this.deleteMembership(GT, persistentUser);
            }
        }
        catch (HibernateException hibernateException) {
            throw new UpdateException(hibernateException.toString(), (Throwable)hibernateException);
        }
    }

    @Override
    protected Collection<Map<String, Object>> getUniqueConstraints(GT GT) {
        HashMap<String, Object> hashMap = new HashMap<String, Object>();
        String[] stringArray = w;
        hashMap.put(stringArray[28], GT.getProviderId());
        hashMap.put(stringArray[13], GT.getName());
        return Arrays.asList(hashMap);
    }

    @Override
    protected EntityManager.UniqueType getUniqueType() {
        return EntityManager.UniqueType.OTHER;
    }

    @Override
    public EntityType getEntityType() {
        return EntityType.GROUP;
    }

    static /* synthetic */ Predicate access$000(PersistentGroupManagerImpl persistentGroupManagerImpl, Predicate predicate, CriteriaBuilder criteriaBuilder, Root root) {
        return persistentGroupManagerImpl.addFindAllPredicate(predicate, criteriaBuilder, root);
    }

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[36];
                var3_1 = 0;
                var2_2 = "LD\r\u0015[\u0012pwY\u0014F\u0018\u0014lvC\u0010F\u0019\u0010\"kM\u0012\u0003\u001fU`}O\u0005\u0013\b\u0010\"yBD\u0003\u0003\u001cqlE\n\u0001[\u0012pwY\u0014F\u001a\u0019p}M\u0000\u001f[\u0000q}_D\u0012\u0013\u0010\"vM\t\u0003[R\u000f4\f\t\u0003\u0016Ukv\f\u0007\n\u001a\u0006q8\u001a]^\u0016\t\tUupE\b\u0003[\u0006gy^\u0007\u000e\u0012\u001be8J\u000b\u0014[7M_\u0001\u0014[\u0002ck\f\u0005\u0013\u000f\u001dgvX\r\u0005\u001a\u0001g|\f\u0006\u001f[\u0014\"|E\u0002\u0000\u001e\u0007gvXD\u000f\u001f\u0010llE\u0010\u001f[\u0005pwZ\r\u0002\u001e\u0007\u001dkI\b\u0003\u0018\u0001\"\u007f^\u0014F\u001d\u0007mu\f\u0003\u0014\u000bUkv\f\u0007\n\u001a\u0006q8\u000b8E\n\u0015\u000f\u0014l{I\u0017H.[M\nA\u000fUwhH\u0005\u0012\u001eUc8k\u0016\t\u000e\u0005\"~^\u000b\u000b[\u0014\"|E\u0002\u0000\u001e\u0007gvXD\u0016\t\u001atqH\u0001\u00146M_\u0001\u0014[\u0002ck\f\u0005\u0013\u000f\u001dgvX\r\u0005\u001a\u0001g|\f\u0006\u001f[\u0014l8Y\n\r\u0015\u001auv\f\r\u0002\u001e\u001bvqX\u001dF\u000b\u0007mnE\u0000\u0003\tX8[\f\u0003\t\u0010\"uI\t\u0004\u001e\u0007qpE\u0014H\u0016\u0010ozI\u00163\b\u0010pQHD[[Oo}A\u0006\u0003\t q}^-\u0002[\u0014l|\f\t\u0003\u0016\u0017gj_\f\u000f\u000b[vpE\u0017!\t\u001awhe\u0000FFU8lD\r\u0015<\u0007mm\\-\u000298{,#)0\"uI\tH\u000f\u001dkkk\u0016\t\u000e\u0005RjC\u0012\u000f\u001f\u0010p_C\r\u0002[H\"\"X\f\u000f\b2pwY\u00146\t\u001atqH\u0001\u0014<\u001ak|\"8{,#)0\"nKJ\u0016\t\u001atqH\u0001\u00142\u0011\"%\f^\u0016\t\u001atqH\u0001\u00142\u0011\n6\f!\b\u000f\u001cva\u0016DF8[\f\u0003\t\u0010\"uI\tH\u000f\u001dkkk\u0016\t\u000e\u0005K|\fYF\u001c\u0007r6K\u000b\u000f\u001fUcvHD\u000b\u001e\u0018,uI\t\u0004\u001e\u0007WkI\u0016/\u001fU?8\u0016\t\u0003\u0016\u0017gjy\u0017\u0003\t<f\u0004vM\t\u0003#8{,#)0\"\u007f^\u0014H\u000b\u0007mnE\u0000\u0003\t<f8\u0011D\\\u000b\u0007mnE\u0000\u0003\t<f&~E\n\u00029\fRjE\t\u0007\t\fI}UD\u0005\u001a\u0019n}HD\u0011\u0012\u0001j8B\u0011\n\u0017UcjKJ2M\\\u0000\u0007\u000f\u0010\"{M\b\n\u001e\u0011\"wBD\u0001\t\u001awh\f\u0010\u000e\u001a\u0001\"|C\u0001\u0015[\u001bml\f\u0005\n\t\u0010c|UD\u0003\u0003\u001cql\u001fqH\u0001\b\u000f\u001cva|\u0016\t\r\u001cf}^D\u000f\bUct^\u0001\u0007\u001f\f\"kI\u0010\u00024\f\u001dkI\b\u0003\u0018\u0001\"m_\u0016F\u001d\u0007mu\f\u0011\u0015\tUkv\f\u0007\n\u001a\u0006q8*8[\f\u0003\t\u0010\"uI\t\u0004\u001e\u0007qpE\u0014H\u0016\u0010ozI\u00163\b\u0010pQHD[[\u0000qj\u0002\u0003\t\u0012\u0011\"\u00068Y\u0017\u0003\u001fU)yB\u0000F\u0016\u0010ozI\u0016\u0015\u0013\u001cr6X\f\u000f\b2pwY\u0014/\u001fU?8\u0016\u0010\u000e\u0012\u0006EjC\u0011\u00162\u0011\u0012^~++[\u0018gu\f-([6NY\u007f7F![C\u0011\n\u001f\u001b%l\f\u0002\u000f\u0015\u0011\"\u007f^\u000b\u0013\u000bUvw\f\u0006\u0003[\u0011gtI\u0010\u0003\u001f[[M\n\b\u0014\u0001\"kM\u0012\u0003[\u0014l8I\n\u0012\u0012\u0001{8[\r\u0012\u0013Uc8_\u0014\u0003\u0018\u001cdqOD/?[\"OM\u0017F\u000e\u001bcz@\u0001F\u000f\u001a\"h^\u0001\u0015\u001e\u0007t}\f\u0010\u000e\u001eUgvX\r\u0012\u0002UK\\\f\u0002\t\tUgvX\r\u0012\u0002O\" [M\nA\u000fUdqB\u0000F\u001c\u0007mm\\\u0017F\f\u001cvp\f\u0006\u0007\u001fUK\\_^F![C\u0011\n\u001f\u001b%l\f\u0002\u000f\u0015\u0011\"\u007f^\u000b\u0013\u000bUvw\f\u0006\u0003[\u0011gtI\u0010\u0003\u001f\nh^\u000b\u0010\u0012\u0011gje\u0000\u0011^~++[\u0003e8e*F89CK\u007fD\u0010nI\u0016\u0015\u0012\u001al8A\r\u0015\u0016\u0014v{D\u0014uI\t\u0004\u001e\u0007qpE\u0014F\u0012\u001b\"{@\u0005\u0015\bU([C\u0011\n\u001f\u001b%l\f\u0002\u000f\u0015\u0011\"w^\r\u0001\u0012\u001bct\f\u0012\u0003\t\u0006kwBD\t\u001dUEjC\u0011\u0016[]]^\u0016\t\tUqyZ\r\b\u001cUgvX\r\u0012\u0002UuqX\fF\u001aUqhI\u0007\u000f\u001d\u001ca8e H[!j}\f\u0017\u0007\r\u0010\"uI\u0010\u000e\u0014\u0011\"kM\u0012\u0003\u001fUuqX\fF\u001aUfqJ\u0002\u0003\t\u0010ll\f\r\u0002UUG`\\\u0001\u0005\u000f\u0010f\"\f";
                var4_3 = "LD\r\u0015[\u0012pwY\u0014F\u0018\u0014lvC\u0010F\u0019\u0010\"kM\u0012\u0003\u001fU`}O\u0005\u0013\b\u0010\"yBD\u0003\u0003\u001cqlE\n\u0001[\u0012pwY\u0014F\u001a\u0019p}M\u0000\u001f[\u0000q}_D\u0012\u0013\u0010\"vM\t\u0003[R\u000f4\f\t\u0003\u0016Ukv\f\u0007\n\u001a\u0006q8\u001a]^\u0016\t\tUupE\b\u0003[\u0006gy^\u0007\u000e\u0012\u001be8J\u000b\u0014[7M_\u0001\u0014[\u0002ck\f\u0005\u0013\u000f\u001dgvX\r\u0005\u001a\u0001g|\f\u0006\u001f[\u0014\"|E\u0002\u0000\u001e\u0007gvXD\u000f\u001f\u0010llE\u0010\u001f[\u0005pwZ\r\u0002\u001e\u0007\u001dkI\b\u0003\u0018\u0001\"\u007f^\u0014F\u001d\u0007mu\f\u0003\u0014\u000bUkv\f\u0007\n\u001a\u0006q8\u000b8E\n\u0015\u000f\u0014l{I\u0017H.[M\nA\u000fUwhH\u0005\u0012\u001eUc8k\u0016\t\u000e\u0005\"~^\u000b\u000b[\u0014\"|E\u0002\u0000\u001e\u0007gvXD\u0016\t\u001atqH\u0001\u00146M_\u0001\u0014[\u0002ck\f\u0005\u0013\u000f\u001dgvX\r\u0005\u001a\u0001g|\f\u0006\u001f[\u0014l8Y\n\r\u0015\u001auv\f\r\u0002\u001e\u001bvqX\u001dF\u000b\u0007mnE\u0000\u0003\tX8[\f\u0003\t\u0010\"uI\t\u0004\u001e\u0007qpE\u0014H\u0016\u0010ozI\u00163\b\u0010pQHD[[Oo}A\u0006\u0003\t q}^-\u0002[\u0014l|\f\t\u0003\u0016\u0017gj_\f\u000f\u000b[vpE\u0017!\t\u001awhe\u0000FFU8lD\r\u0015<\u0007mm\\-\u000298{,#)0\"uI\tH\u000f\u001dkkk\u0016\t\u000e\u0005RjC\u0012\u000f\u001f\u0010p_C\r\u0002[H\"\"X\f\u000f\b2pwY\u00146\t\u001atqH\u0001\u0014<\u001ak|\"8{,#)0\"nKJ\u0016\t\u001atqH\u0001\u00142\u0011\"%\f^\u0016\t\u001atqH\u0001\u00142\u0011\n6\f!\b\u000f\u001cva\u0016DF8[\f\u0003\t\u0010\"uI\tH\u000f\u001dkkk\u0016\t\u000e\u0005K|\fYF\u001c\u0007r6K\u000b\u000f\u001fUcvHD\u000b\u001e\u0018,uI\t\u0004\u001e\u0007WkI\u0016/\u001fU?8\u0016\t\u0003\u0016\u0017gjy\u0017\u0003\t<f\u0004vM\t\u0003#8{,#)0\"\u007f^\u0014H\u000b\u0007mnE\u0000\u0003\t<f8\u0011D\\\u000b\u0007mnE\u0000\u0003\t<f&~E\n\u00029\fRjE\t\u0007\t\fI}UD\u0005\u001a\u0019n}HD\u0011\u0012\u0001j8B\u0011\n\u0017UcjKJ2M\\\u0000\u0007\u000f\u0010\"{M\b\n\u001e\u0011\"wBD\u0001\t\u001awh\f\u0010\u000e\u001a\u0001\"|C\u0001\u0015[\u001bml\f\u0005\n\t\u0010c|UD\u0003\u0003\u001cql\u001fqH\u0001\b\u000f\u001cva|\u0016\t\r\u001cf}^D\u000f\bUct^\u0001\u0007\u001f\f\"kI\u0010\u00024\f\u001dkI\b\u0003\u0018\u0001\"m_\u0016F\u001d\u0007mu\f\u0011\u0015\tUkv\f\u0007\n\u001a\u0006q8*8[\f\u0003\t\u0010\"uI\t\u0004\u001e\u0007qpE\u0014H\u0016\u0010ozI\u00163\b\u0010pQHD[[\u0000qj\u0002\u0003\t\u0012\u0011\"\u00068Y\u0017\u0003\u001fU)yB\u0000F\u0016\u0010ozI\u0016\u0015\u0013\u001cr6X\f\u000f\b2pwY\u0014/\u001fU?8\u0016\u0010\u000e\u0012\u0006EjC\u0011\u00162\u0011\u0012^~++[\u0018gu\f-([6NY\u007f7F![C\u0011\n\u001f\u001b%l\f\u0002\u000f\u0015\u0011\"\u007f^\u000b\u0013\u000bUvw\f\u0006\u0003[\u0011gtI\u0010\u0003\u001f[[M\n\b\u0014\u0001\"kM\u0012\u0003[\u0014l8I\n\u0012\u0012\u0001{8[\r\u0012\u0013Uc8_\u0014\u0003\u0018\u001cdqOD/?[\"OM\u0017F\u000e\u001bcz@\u0001F\u000f\u001a\"h^\u0001\u0015\u001e\u0007t}\f\u0010\u000e\u001eUgvX\r\u0012\u0002UK\\\f\u0002\t\tUgvX\r\u0012\u0002O\" [M\nA\u000fUdqB\u0000F\u001c\u0007mm\\\u0017F\f\u001cvp\f\u0006\u0007\u001fUK\\_^F![C\u0011\n\u001f\u001b%l\f\u0002\u000f\u0015\u0011\"\u007f^\u000b\u0013\u000bUvw\f\u0006\u0003[\u0011gtI\u0010\u0003\u001f\nh^\u000b\u0010\u0012\u0011gje\u0000\u0011^~++[\u0003e8e*F89CK\u007fD\u0010nI\u0016\u0015\u0012\u001al8A\r\u0015\u0016\u0014v{D\u0014uI\t\u0004\u001e\u0007qpE\u0014F\u0012\u001b\"{@\u0005\u0015\bU([C\u0011\n\u001f\u001b%l\f\u0002\u000f\u0015\u0011\"w^\r\u0001\u0012\u001bct\f\u0012\u0003\t\u0006kwBD\t\u001dUEjC\u0011\u0016[]]^\u0016\t\tUqyZ\r\b\u001cUgvX\r\u0012\u0002UuqX\fF\u001aUqhI\u0007\u000f\u001d\u001ca8e H[!j}\f\u0017\u0007\r\u0010\"uI\u0010\u000e\u0014\u0011\"kM\u0012\u0003\u001fUuqX\fF\u001aUfqJ\u0002\u0003\t\u0010ll\f\r\u0002UUG`\\\u0001\u0005\u000f\u0010f\"\f".length();
                var1_4 = 76;
                var0_5 = -1;
lbl7:
                // 2 sources

                while (true) {
                    v0 = 95;
                    v1 = ++var0_5;
                    v2 = var2_2.substring(v1, v1 + var1_4);
                    v3 = -1;
                    break block9;
                    break;
                }
lbl13:
                // 1 sources

                while (true) {
                    var5[var3_1++] = PersistentGroupManagerImpl.b(v0, PersistentGroupManagerImpl.b(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "%\u0005PP i\u000b\u0013wVS M5\"\u0004L=\u0019\u0005%pp c\u001c\u000e5zosf\u0010\u0013wvs m\u0015\u0002$l=";
                    var4_3 = "%\u0005PP i\u000b\u0013wVS M5\"\u0004L=\u0019\u0005%pp c\u001c\u000e5zosf\u0010\u0013wvs m\u0015\u0002$l=".length();
                    var1_4 = 18;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 36;
                        v4 = ++var0_5;
                        v2 = var2_2.substring(v4, v4 + var1_4);
                        v3 = 0;
                        break block9;
                        break;
                    }
                    break;
                }
lbl28:
                // 1 sources

                while (true) {
                    var5[var3_1++] = PersistentGroupManagerImpl.b(v0, PersistentGroupManagerImpl.b(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    break block10;
                    break;
                }
            }
            switch (v3) {
                default: {
                    ** continue;
                }
                ** case 0:
lbl39:
                // 1 sources

                ** continue;
            }
        }
        PersistentGroupManagerImpl.w = var5;
        var0_6 = PersistentGroupManagerImpl.w;
        PersistentGroupManagerImpl.o = var0_6[29] + VirtualGroup.class.getName() + var0_6[10];
    }

    private static Exception a(Exception exception) {
        return exception;
    }

    private static char[] b(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x5D);
        }
        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 -> 71;
                    case 1 -> 115;
                    case 2 -> 59;
                    case 3 -> 57;
                    case 4 -> 36;
                    case 5 -> 42;
                    default -> 93;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

