/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.objectmodel.DeleteException
 *  com.l7tech.objectmodel.Entity
 *  com.l7tech.objectmodel.EntityHeader
 *  com.l7tech.objectmodel.EntityManager
 *  com.l7tech.objectmodel.EntityManager$UniqueType
 *  com.l7tech.objectmodel.FindException
 *  com.l7tech.objectmodel.Goid
 *  com.l7tech.objectmodel.NamedEntity
 *  com.l7tech.objectmodel.PersistentEntity
 *  com.l7tech.objectmodel.SaveException
 *  com.l7tech.objectmodel.UpdateException
 *  com.l7tech.policy.GenericEntity
 *  com.l7tech.policy.GenericEntityHeader
 *  com.l7tech.policy.InvalidGenericEntityException
 *  com.l7tech.util.Charsets
 *  com.l7tech.util.ClassFilter
 *  com.l7tech.util.ClassFilterBuilder
 *  com.l7tech.util.ExceptionUtils
 *  com.l7tech.util.SafeXMLDecoder
 *  com.l7tech.util.SafeXMLDecoderBuilder
 *  jakarta.persistence.TypedQuery
 *  jakarta.persistence.criteria.CriteriaBuilder
 *  jakarta.persistence.criteria.Path
 *  jakarta.persistence.criteria.Predicate
 *  jakarta.persistence.criteria.Root
 *  org.hibernate.FlushMode
 *  org.hibernate.HibernateException
 *  org.hibernate.Session
 *  org.hibernate.query.Query
 *  org.jetbrains.annotations.NotNull
 *  org.jetbrains.annotations.Nullable
 *  org.springframework.orm.hibernate5.HibernateCallback
 *  org.springframework.transaction.annotation.Propagation
 *  org.springframework.transaction.annotation.Transactional
 */
package com.l7tech.server.entity;

import com.l7tech.objectmodel.DeleteException;
import com.l7tech.objectmodel.Entity;
import com.l7tech.objectmodel.EntityHeader;
import com.l7tech.objectmodel.EntityManager;
import com.l7tech.objectmodel.FindException;
import com.l7tech.objectmodel.Goid;
import com.l7tech.objectmodel.NamedEntity;
import com.l7tech.objectmodel.PersistentEntity;
import com.l7tech.objectmodel.SaveException;
import com.l7tech.objectmodel.UpdateException;
import com.l7tech.policy.GenericEntity;
import com.l7tech.policy.GenericEntityHeader;
import com.l7tech.policy.InvalidGenericEntityException;
import com.l7tech.server.HibernateEntityManager;
import com.l7tech.server.entity.GenericEntityManager;
import com.l7tech.server.entity.GenericEntityMetadata;
import com.l7tech.server.entity.GenericEntityUtils;
import com.l7tech.server.entity.a;
import com.l7tech.server.entity.b;
import com.l7tech.server.entity.e;
import com.l7tech.server.entity.f;
import com.l7tech.server.entity.g;
import com.l7tech.server.entity.h;
import com.l7tech.server.entity.i;
import com.l7tech.server.entity.j;
import com.l7tech.server.entity.k;
import com.l7tech.util.Charsets;
import com.l7tech.util.ClassFilter;
import com.l7tech.util.ClassFilterBuilder;
import com.l7tech.util.ExceptionUtils;
import com.l7tech.util.SafeXMLDecoder;
import com.l7tech.util.SafeXMLDecoderBuilder;
import jakarta.persistence.TypedQuery;
import jakarta.persistence.criteria.CriteriaBuilder;
import jakarta.persistence.criteria.Path;
import jakarta.persistence.criteria.Predicate;
import jakarta.persistence.criteria.Root;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.logging.Logger;
import org.hibernate.FlushMode;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.query.Query;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.springframework.orm.hibernate5.HibernateCallback;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/*
 * Exception performing whole class analysis ignored.
 */
@Transactional(propagation=Propagation.REQUIRED, rollbackFor={Throwable.class})
public class GenericEntityManagerImpl
extends HibernateEntityManager<GenericEntity, GenericEntityHeader>
implements GenericEntityManager {
    private static final Logger m;
    public static final String F_CLASSNAME;
    private final String n;
    private final String o;
    private final ConcurrentMap<String, e<?>> p;
    private static final String[] q;

    public GenericEntityManagerImpl() {
        String string = this.getTableName();
        String string2 = this.getImpClass().getName();
        String string3 = this.getTableName();
        String string4 = this.getTableName();
        String string5 = this.getTableName();
        String[] stringArray = q;
        this.n = stringArray[9] + string5 + stringArray[22] + string4 + stringArray[5] + string3 + stringArray[23] + string2 + stringArray[26] + string + stringArray[68];
        String string6 = this.getTableName();
        String string7 = this.getTableName();
        String string8 = this.getImpClass().getName();
        String string9 = this.getTableName();
        String string10 = this.getTableName();
        this.o = stringArray[55] + string10 + stringArray[13] + string9 + stringArray[65] + string8 + stringArray[0] + string7 + stringArray[58] + string6 + stringArray[17];
        this.p = new ConcurrentHashMap();
    }

    @Transactional(readOnly=true)
    public Class<? extends Entity> getImpClass() {
        return GenericEntity.class;
    }

    @Override
    @Transactional(readOnly=true)
    protected EntityManager.UniqueType getUniqueType() {
        return EntityManager.UniqueType.OTHER;
    }

    @Override
    public <ET extends GenericEntity> void registerClass(@NotNull Class<ET> clazz) throws IllegalArgumentException {
        try {
            if (clazz == null) {
                GenericEntityManagerImpl.b(0);
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw GenericEntityManagerImpl.a(illegalArgumentException);
        }
        this.registerClass(clazz, null);
    }

    @Override
    public <ET extends GenericEntity> void registerClass(@NotNull Class<ET> clazz, @Nullable GenericEntityMetadata genericEntityMetadata) throws IllegalArgumentException {
        try {
            if (clazz == null) {
                GenericEntityManagerImpl.b(1);
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw GenericEntityManagerImpl.a(illegalArgumentException);
        }
        try {
            if (!GenericEntity.class.isAssignableFrom(clazz)) {
                throw new IllegalArgumentException(q[40] + clazz.getName());
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw GenericEntityManagerImpl.a(illegalArgumentException);
        }
        try {
            if (clazz == GenericEntity.class) {
                throw new IllegalArgumentException(q[62] + clazz.getName());
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw GenericEntityManagerImpl.a(illegalArgumentException);
        }
        String string = clazz.getName();
        e<ET> e10 = this.p.putIfAbsent(string, new e<ET>(clazz, genericEntityMetadata));
        try {
            if (null != e10) {
                throw new IllegalArgumentException(q[53] + clazz.getName());
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw GenericEntityManagerImpl.a(illegalArgumentException);
        }
    }

    @Override
    public boolean unRegisterClass(String string) {
        boolean bl2;
        e e10 = (e)this.p.remove(string);
        try {
            bl2 = e10 != null;
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw GenericEntityManagerImpl.a(illegalArgumentException);
        }
        return bl2;
    }

    @Override
    @Transactional(readOnly=true)
    public boolean isRegistered(String string) {
        return this.p.containsKey(string);
    }

    @Override
    @Transactional(readOnly=true)
    public <ET extends GenericEntity> EntityManager<ET, GenericEntityHeader> getEntityManager(@NotNull Class<ET> clazz) {
        try {
            if (clazz == null) {
                GenericEntityManagerImpl.b(2);
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw GenericEntityManagerImpl.a(illegalArgumentException);
        }
        GenericEntityManager genericEntityManager = (GenericEntityManager)this.applicationContext.getBean(q[7], GenericEntityManager.class);
        return new b(this, genericEntityManager, clazz);
    }

    @Override
    @Transactional(readOnly=true)
    public <ET extends GenericEntity> Collection<ET> findAll(@NotNull Class<ET> clazz) throws FindException {
        try {
            if (clazz == null) {
                GenericEntityManagerImpl.b(3);
            }
        }
        catch (HibernateException hibernateException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)hibernateException));
        }
        e<ET> e10 = this.a(clazz);
        try {
            return (Collection)this.getHibernateTemplate().execute((HibernateCallback)new f(this, clazz, e10));
        }
        catch (HibernateException hibernateException) {
            throw new FindException(q[56] + clazz.getName(), (Throwable)hibernateException);
        }
    }

    @NotNull
    private <ET extends GenericEntity> e<ET> a(Class<ET> clazz) throws FindException {
        e e10;
        e e11 = (e)this.p.get(clazz.getName());
        try {
            if (e11 == null) {
                throw new FindException(GenericEntityManagerImpl.c(clazz));
            }
        }
        catch (FindException findException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)findException));
        }
        try {
            if (!e11.a().equals(clazz)) {
                throw new FindException(q[47] + String.valueOf(clazz));
            }
        }
        catch (FindException findException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)findException));
        }
        try {
            e10 = e11;
            if (e10 == null) {
                GenericEntityManagerImpl.b(4);
            }
        }
        catch (FindException findException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)findException));
        }
        return e10;
    }

    @Override
    @Transactional(readOnly=true)
    public Collection<GenericEntityHeader> findAllHeaders(@NotNull Class<? extends GenericEntity> clazz) throws FindException {
        try {
            if (clazz == null) {
                GenericEntityManagerImpl.b(5);
            }
        }
        catch (HibernateException hibernateException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)hibernateException));
        }
        try {
            if (this.p.get(clazz.getName()) == null) {
                throw new FindException(q[29] + clazz.getName() + q[54]);
            }
        }
        catch (HibernateException hibernateException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)hibernateException));
        }
        try {
            return (Collection)this.getHibernateTemplate().execute((HibernateCallback)new g(this, clazz));
        }
        catch (HibernateException hibernateException) {
            throw new FindException(q[44] + clazz.getName(), (Throwable)hibernateException);
        }
    }

    @Override
    @Transactional(readOnly=true)
    public Collection<GenericEntityHeader> findAllHeaders(@NotNull Class<? extends GenericEntity> clazz, int n2, int n3) throws FindException {
        try {
            if (clazz == null) {
                GenericEntityManagerImpl.b(6);
            }
        }
        catch (HibernateException hibernateException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)hibernateException));
        }
        try {
            if (this.p.get(clazz.getName()) == null) {
                throw new FindException(q[42] + clazz.getName() + q[34]);
            }
        }
        catch (HibernateException hibernateException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)hibernateException));
        }
        try {
            return (Collection)this.getHibernateTemplate().execute((HibernateCallback)new h(this, clazz, n2, n3));
        }
        catch (HibernateException hibernateException) {
            throw new FindException(q[44] + clazz.getName(), (Throwable)hibernateException);
        }
    }

    @Override
    public <ET extends GenericEntity> Goid save(@NotNull Class<ET> clazz, ET ET) throws SaveException {
        try {
            if (clazz == null) {
                GenericEntityManagerImpl.b(7);
            }
        }
        catch (SaveException saveException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)saveException));
        }
        GenericEntity genericEntity = this.a(clazz, ET);
        return this.save(genericEntity);
    }

    @Override
    public <ET extends GenericEntity> void save(@NotNull Goid goid, @NotNull Class<ET> clazz, ET ET) throws SaveException {
        try {
            if (goid == null) {
                GenericEntityManagerImpl.b(8);
            }
        }
        catch (SaveException saveException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)saveException));
        }
        try {
            if (clazz == null) {
                GenericEntityManagerImpl.b(9);
            }
        }
        catch (SaveException saveException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)saveException));
        }
        GenericEntity genericEntity = this.a(clazz, ET);
        this.save(goid, genericEntity);
    }

    private <ET extends GenericEntity> GenericEntity a(Class<ET> clazz, ET ET) throws SaveException {
        try {
            if (!this.b(clazz)) {
                throw new SaveException(GenericEntityManagerImpl.c(clazz));
            }
        }
        catch (SaveException saveException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)saveException));
        }
        try {
            if (!clazz.getName().equals(ET.getEntityClassName())) {
                throw new SaveException(q[21] + clazz.getName() + q[69] + ET.getEntityClassName());
            }
        }
        catch (SaveException saveException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)saveException));
        }
        GenericEntityUtils.regenerateValueXml(ET);
        GenericEntity genericEntity = new GenericEntity();
        GenericEntity.copyBaseFields(ET, (GenericEntity)genericEntity);
        return genericEntity;
    }

    @Override
    @Transactional(readOnly=true)
    public <ET extends GenericEntity> Integer getVersion(@NotNull Class<ET> clazz, Goid goid) throws FindException {
        try {
            if (clazz == null) {
                GenericEntityManagerImpl.b(10);
            }
        }
        catch (Exception exception) {
            throw GenericEntityManagerImpl.a(exception);
        }
        try {
            if (!this.b(clazz)) {
                throw new FindException(GenericEntityManagerImpl.c(clazz));
            }
        }
        catch (Exception exception) {
            throw GenericEntityManagerImpl.a(exception);
        }
        try {
            return (Integer)this.getHibernateTemplate().execute((HibernateCallback)new i(this, goid, clazz));
        }
        catch (Exception exception) {
            throw new FindException(exception.toString(), (Throwable)exception);
        }
    }

    private <ET extends GenericEntity> boolean b(Class<ET> clazz) {
        boolean bl2;
        try {
            bl2 = this.p.get(clazz.getName()) != null;
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw GenericEntityManagerImpl.a(illegalArgumentException);
        }
        return bl2;
    }

    /*
     * Loose catch block
     */
    @Override
    @Transactional(readOnly=true)
    public <ET extends GenericEntity> Map<Goid, Integer> findVersionMap(@NotNull Class<ET> clazz) throws FindException {
        Session session;
        HashMap<Goid, Integer> hashMap;
        block28: {
            FlushMode flushMode;
            block26: {
                try {
                    if (clazz == null) {
                        GenericEntityManagerImpl.b(11);
                    }
                }
                catch (Exception exception) {
                    throw GenericEntityManagerImpl.a(exception);
                }
                try {
                    if (!this.b(clazz)) {
                        throw new FindException(GenericEntityManagerImpl.c(clazz));
                    }
                }
                catch (Exception exception) {
                    throw GenericEntityManagerImpl.a(exception);
                }
                hashMap = new HashMap<Goid, Integer>();
                try {
                    if (!PersistentEntity.class.isAssignableFrom(this.getImpClass())) {
                        throw new FindException(q[16]);
                    }
                }
                catch (Exception exception) {
                    throw GenericEntityManagerImpl.a(exception);
                }
                session = null;
                flushMode = null;
                session = GenericEntityManagerImpl.useCurrentOrOpenNewSession(this.getSessionFactory());
                flushMode = session.getHibernateFlushMode();
                session.setHibernateFlushMode(FlushMode.MANUAL);
                Query query = session.createQuery(this.n);
                String[] stringArray = q;
                query.setParameter(stringArray[67], (Object)clazz.getName());
                List list = query.list();
                if (list.size() <= 0) break block26;
                for (Object e10 : list) {
                    Object[] objectArray;
                    block27: {
                        objectArray = (Object[])e10;
                        if (!(objectArray[0] instanceof Goid)) break block27;
                        try {
                            block30: {
                                if (!(objectArray[1] instanceof Integer)) break block27;
                                break block30;
                                catch (Exception exception) {
                                    throw GenericEntityManagerImpl.a(exception);
                                }
                            }
                            hashMap.put((Goid)objectArray[0], (Integer)objectArray[1]);
                            continue;
                        }
                        catch (Exception exception) {
                            throw GenericEntityManagerImpl.a(exception);
                        }
                    }
                    stringArray = q;
                    throw new FindException(stringArray[64] + String.valueOf(objectArray[0]) + stringArray[48] + String.valueOf(objectArray[1]) + stringArray[39]);
                }
            }
            if (session == null) break block28;
            try {
                block31: {
                    if (flushMode == null) break block28;
                    break block31;
                    catch (Exception exception) {
                        throw GenericEntityManagerImpl.a(exception);
                    }
                }
                session.setHibernateFlushMode(flushMode);
                break block28;
            }
            catch (Exception exception) {
                throw GenericEntityManagerImpl.a(exception);
            }
            catch (Exception exception) {
                try {
                    throw new FindException(q[70] + ExceptionUtils.getMessage((Throwable)exception), (Throwable)exception);
                }
                catch (Throwable throwable) {
                    block29: {
                        try {
                            try {
                                if (session == null || flushMode == null) break block29;
                            }
                            catch (Exception exception2) {
                                throw GenericEntityManagerImpl.a(exception2);
                            }
                            session.setHibernateFlushMode(flushMode);
                        }
                        catch (Exception exception3) {
                            throw GenericEntityManagerImpl.a(exception3);
                        }
                    }
                    GenericEntityManagerImpl.closeNewSession(session);
                    throw throwable;
                }
            }
        }
        GenericEntityManagerImpl.closeNewSession(session);
        return hashMap;
    }

    @Override
    public <ET extends GenericEntity> void delete(@NotNull Class<ET> clazz, ET ET) throws DeleteException {
        try {
            if (clazz == null) {
                GenericEntityManagerImpl.b(12);
            }
        }
        catch (DeleteException deleteException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)deleteException));
        }
        try {
            if (!this.b(clazz)) {
                throw new DeleteException(GenericEntityManagerImpl.c(clazz));
            }
        }
        catch (DeleteException deleteException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)deleteException));
        }
        try {
            if (!clazz.getName().equals(ET.getEntityClassName())) {
                throw new DeleteException(q[71] + clazz.getName() + q[74] + ET.getEntityClassName());
            }
        }
        catch (DeleteException deleteException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)deleteException));
        }
        this.delete(ET);
    }

    private static <ET extends GenericEntity> String c(Class<ET> clazz) {
        String[] stringArray = q;
        return stringArray[42] + clazz.getName() + stringArray[34];
    }

    @Override
    @Transactional(readOnly=true)
    protected GenericEntity checkAndCache(GenericEntity object) throws FindException {
        String string = object.getEntityClassName();
        e e10 = (e)this.p.get(string);
        try {
            if (e10 == null) {
                throw new FindException(q[42] + string + q[34]);
            }
        }
        catch (FindException findException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)findException));
        }
        object = this.a((GenericEntity)object, e10);
        return super.checkAndCache(object);
    }

    @Override
    @Transactional(readOnly=true)
    public <ET extends GenericEntity> ET getCachedEntity(@NotNull Class<ET> clazz, Goid goid, int n2) throws FindException {
        Object object;
        try {
            if (clazz == null) {
                GenericEntityManagerImpl.b(13);
            }
        }
        catch (FindException findException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)findException));
        }
        e<ET> e10 = this.a(clazz);
        GenericEntity genericEntity = (GenericEntity)super.getCachedEntity(goid, n2);
        try {
            if (genericEntity == null) {
                return null;
            }
        }
        catch (FindException findException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)findException));
        }
        try {
            object = clazz.isInstance(genericEntity) ? (GenericEntity)clazz.cast(genericEntity) : this.a(genericEntity, e10);
        }
        catch (FindException findException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)findException));
        }
        return (ET)object;
    }

    @Override
    @Transactional(readOnly=true)
    public <ET extends GenericEntity> ET findByUniqueName(@NotNull Class<ET> clazz, String string) throws FindException {
        Object object;
        try {
            if (clazz == null) {
                GenericEntityManagerImpl.b(14);
            }
        }
        catch (FindException findException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)findException));
        }
        e<ET> e10 = this.a(clazz);
        GenericEntity genericEntity = this.a(clazz.getName(), string);
        try {
            if (genericEntity == null) {
                return null;
            }
        }
        catch (FindException findException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)findException));
        }
        try {
            object = clazz.isInstance(genericEntity) ? (GenericEntity)clazz.cast(genericEntity) : this.a(genericEntity, e10);
        }
        catch (FindException findException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)findException));
        }
        return (ET)object;
    }

    @Override
    public GenericEntity findByUniqueName(@NotNull String string, String string2) throws FindException {
        try {
            if (string == null) {
                GenericEntityManagerImpl.b(15);
            }
        }
        catch (FindException findException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)findException));
        }
        try {
            if (!this.isRegistered(string)) {
                throw new FindException(q[42] + string + q[34]);
            }
        }
        catch (FindException findException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)findException));
        }
        return this.a(string, string2);
    }

    private GenericEntity a(@NotNull String string, String string2) throws FindException {
        try {
            if (string == null) {
                GenericEntityManagerImpl.b(16);
            }
        }
        catch (HibernateException hibernateException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)hibernateException));
        }
        try {
            if (string2 == null) {
                throw new NullPointerException();
            }
        }
        catch (HibernateException hibernateException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)hibernateException));
        }
        try {
            if (!NamedEntity.class.isAssignableFrom(this.getImpClass())) {
                throw new IllegalArgumentException(q[50]);
            }
        }
        catch (HibernateException hibernateException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)hibernateException));
        }
        try {
            return (GenericEntity)this.getHibernateTemplate().execute((HibernateCallback)new j(this, string2, string));
        }
        catch (HibernateException hibernateException) {
            throw new FindException(q[2], (Throwable)hibernateException);
        }
    }

    @Override
    public <ET extends GenericEntity> void delete(@NotNull Class<ET> clazz, Goid goid) throws DeleteException, FindException {
        block8: {
            try {
                if (clazz == null) {
                    GenericEntityManagerImpl.b(17);
                }
            }
            catch (DeleteException deleteException) {
                throw GenericEntityManagerImpl.a((Exception)((Object)deleteException));
            }
            try {
                if (!this.b(clazz)) {
                    throw new DeleteException(GenericEntityManagerImpl.c(clazz));
                }
            }
            catch (DeleteException deleteException) {
                throw GenericEntityManagerImpl.a((Exception)((Object)deleteException));
            }
            GenericEntity genericEntity = (GenericEntity)this.findByPrimaryKey(goid);
            try {
                if (genericEntity == null || clazz.getName().equals(genericEntity.getEntityClassName())) break block8;
            }
            catch (DeleteException deleteException) {
                throw GenericEntityManagerImpl.a((Exception)((Object)deleteException));
            }
            String string = genericEntity.getEntityClassName();
            String string2 = clazz.getName();
            String string3 = goid.toString();
            String[] stringArray = q;
            throw new DeleteException(stringArray[30] + string3 + stringArray[49] + string2 + stringArray[4] + string);
        }
        this.delete(goid);
    }

    @Override
    public <ET extends GenericEntity> void update(@NotNull Class<ET> clazz, ET ET) throws UpdateException {
        Goid goid;
        block10: {
            try {
                if (clazz == null) {
                    GenericEntityManagerImpl.b(18);
                }
            }
            catch (FindException findException) {
                throw GenericEntityManagerImpl.a((Exception)((Object)findException));
            }
            try {
                if (!this.b(clazz)) {
                    throw new UpdateException(GenericEntityManagerImpl.c(clazz));
                }
            }
            catch (FindException findException) {
                throw GenericEntityManagerImpl.a((Exception)((Object)findException));
            }
            try {
                goid = ET.getGoid();
                GenericEntity genericEntity = (GenericEntity)this.findByPrimaryKey(goid);
                try {
                    if (genericEntity == null || clazz.getName().equals(genericEntity.getEntityClassName())) break block10;
                }
                catch (FindException findException) {
                    throw GenericEntityManagerImpl.a((Exception)((Object)findException));
                }
                String string = genericEntity.getEntityClassName();
                String string2 = clazz.getName();
                String string3 = goid.toString();
                String[] stringArray = q;
                throw new UpdateException(stringArray[73] + string3 + stringArray[24] + string2 + stringArray[77] + string);
            }
            catch (FindException findException) {
                throw new UpdateException(q[37] + ExceptionUtils.getMessage((Throwable)findException), (Throwable)findException);
            }
        }
        GenericEntityUtils.regenerateValueXml(ET);
        goid = new GenericEntity();
        GenericEntity.copyBaseFields(ET, (GenericEntity)goid);
        this.update(goid);
    }

    @Override
    @Transactional(readOnly=true)
    public <ET extends GenericEntity> ET findByHeader(@NotNull Class<ET> clazz, EntityHeader entityHeader) throws FindException {
        try {
            if (clazz == null) {
                GenericEntityManagerImpl.b(19);
            }
        }
        catch (FindException findException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)findException));
        }
        e<ET> e10 = this.a(clazz);
        GenericEntity genericEntity = (GenericEntity)this.findByHeader(entityHeader);
        try {
            if (genericEntity == null) {
                return null;
            }
        }
        catch (FindException findException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)findException));
        }
        try {
            if (!clazz.getName().equals(genericEntity.getEntityClassName())) {
                return null;
            }
        }
        catch (FindException findException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)findException));
        }
        return this.a(genericEntity, e10);
    }

    @Override
    @Transactional(readOnly=true)
    public <ET extends GenericEntity> List<ET> findPagedMatching(@NotNull Class<ET> clazz, int n2, int n3, String string, Boolean bl2, Map<String, List<Object>> map) throws FindException {
        try {
            if (clazz == null) {
                GenericEntityManagerImpl.b(20);
            }
        }
        catch (Exception exception) {
            throw GenericEntityManagerImpl.a(exception);
        }
        e<ET> e10 = this.a(clazz);
        try {
            return (List)this.getHibernateTemplate().execute((HibernateCallback)new k(this, clazz, map, string, bl2, n2, n3, e10));
        }
        catch (Exception exception) {
            throw new FindException(q[1] + clazz.getName(), (Throwable)exception);
        }
    }

    @Override
    @Transactional(readOnly=true)
    public <ET extends GenericEntity> ET findByGenericClassAndPrimaryKey(@NotNull Class<ET> clazz, Goid goid) throws FindException {
        try {
            if (clazz == null) {
                GenericEntityManagerImpl.b(21);
            }
        }
        catch (FindException findException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)findException));
        }
        e<ET> e10 = this.a(clazz);
        GenericEntity genericEntity = (GenericEntity)this.findByPrimaryKey(goid);
        try {
            if (genericEntity == null) {
                return null;
            }
        }
        catch (FindException findException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)findException));
        }
        try {
            if (!clazz.getName().equals(genericEntity.getEntityClassName())) {
                return null;
            }
        }
        catch (FindException findException) {
            throw GenericEntityManagerImpl.a((Exception)((Object)findException));
        }
        return this.a(genericEntity, e10);
    }

    @Override
    protected GenericEntityHeader newHeader(GenericEntity genericEntity) {
        return new GenericEntityHeader(genericEntity);
    }

    @Override
    public <ET extends GenericEntity> ET asConcreteEntity(@NotNull GenericEntity genericEntity) throws InvalidGenericEntityException {
        try {
            if (genericEntity == null) {
                GenericEntityManagerImpl.b(22);
            }
        }
        catch (ClassCastException classCastException) {
            throw GenericEntityManagerImpl.a(classCastException);
        }
        e e10 = (e)this.p.get(genericEntity.getEntityClassName());
        try {
            if (e10 == null) {
                throw new InvalidGenericEntityException(q[20] + genericEntity.getEntityClassName());
            }
        }
        catch (ClassCastException classCastException) {
            throw GenericEntityManagerImpl.a(classCastException);
        }
        try {
            return this.a(genericEntity, e10);
        }
        catch (ClassCastException classCastException) {
            throw new InvalidGenericEntityException(q[76], (Throwable)classCastException);
        }
    }

    /*
     * Enabled aggressive block sorting
     * Enabled unnecessary exception pruning
     * Enabled aggressive exception aggregation
     */
    <ET extends GenericEntity> ET a(GenericEntity genericEntity, e<ET> e10) throws InvalidGenericEntityException {
        String string2;
        String string;
        GenericEntityMetadata genericEntityMetadata;
        Class<ET> clazz;
        block17: {
            clazz = e10.a();
            genericEntityMetadata = e10.b();
            string = genericEntity.getEntityClassName();
            try {
                if (!clazz.getName().equals(string)) {
                    throw new InvalidGenericEntityException(q[15] + string + q[25] + clazz.getName());
                }
            }
            catch (Exception exception) {
                throw GenericEntityManagerImpl.a(exception);
            }
            string2 = genericEntity.getValueXml();
            try {
                if (string2 != null && string2.length() >= 1) break block17;
            }
            catch (Exception exception) {
                throw GenericEntityManagerImpl.a(exception);
            }
            try {
                GenericEntity genericEntity2 = (GenericEntity)clazz.newInstance();
                GenericEntity.copyBaseFields((GenericEntity)genericEntity, (GenericEntity)genericEntity2);
                return (ET)genericEntity2;
            }
            catch (Exception exception) {
                String[] stringArray = q;
                throw new InvalidGenericEntityException(stringArray[41] + clazz.getName() + stringArray[66] + ExceptionUtils.getMessage((Throwable)exception), (Throwable)exception);
            }
        }
        ClassFilterBuilder classFilterBuilder = this.a(clazz, genericEntityMetadata);
        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(string2.getBytes(Charsets.UTF8));
        try {
            SafeXMLDecoder safeXMLDecoder;
            block18: {
                GenericEntity genericEntity4;
                safeXMLDecoder = new SafeXMLDecoderBuilder(classFilterBuilder, (InputStream)byteArrayInputStream).setClassLoader(clazz.getClassLoader()).build();
                try {
                    Object object = safeXMLDecoder.readObject();
                    if (!clazz.isInstance(object)) break block18;
                    GenericEntity genericEntity3 = (GenericEntity)clazz.cast(object);
                    GenericEntity.copyBaseFields((GenericEntity)genericEntity, (GenericEntity)genericEntity3);
                    genericEntity4 = genericEntity3;
                }
                catch (Throwable throwable) {
                    if (safeXMLDecoder == null) throw throwable;
                    try {
                        safeXMLDecoder.close();
                        throw throwable;
                    }
                    catch (Throwable throwable2) {
                        throwable.addSuppressed(throwable2);
                    }
                    throw throwable;
                }
                try {
                    if (safeXMLDecoder == null) return (ET)genericEntity4;
                    safeXMLDecoder.close();
                    return (ET)genericEntity4;
                }
                catch (Exception exception) {
                    throw GenericEntityManagerImpl.a(exception);
                }
            }
            try {
                if (safeXMLDecoder == null) throw new InvalidGenericEntityException(q[59] + string);
                safeXMLDecoder.close();
                throw new InvalidGenericEntityException(q[59] + string);
            }
            catch (Exception exception) {
                throw GenericEntityManagerImpl.a(exception);
            }
        }
        catch (ArrayIndexOutOfBoundsException arrayIndexOutOfBoundsException) {
            String[] stringArray = q;
            throw new InvalidGenericEntityException(stringArray[6], (Throwable)arrayIndexOutOfBoundsException);
        }
    }

    private <ET extends GenericEntity> ClassFilterBuilder a(Class<ET> clazz, GenericEntityMetadata genericEntityMetadata) {
        a a10 = new a(this, clazz.getClassLoader(), Arrays.asList(q[61], clazz.getPackage().getName() + "."));
        ClassFilterBuilder classFilterBuilder = new ClassFilterBuilder().allowDefaults().addClassFilter((ClassFilter)a10);
        if (genericEntityMetadata != null) {
            Set<String> set = genericEntityMetadata.a();
            try {
                if (set != null) {
                    classFilterBuilder.addClasses(false, set.toArray(new String[set.size()]));
                }
            }
            catch (IllegalArgumentException illegalArgumentException) {
                throw GenericEntityManagerImpl.a(illegalArgumentException);
            }
            Set<String> set2 = genericEntityMetadata.b();
            try {
                if (set2 != null) {
                    classFilterBuilder.addConstructors(set2.toArray(new String[set2.size()]));
                }
            }
            catch (IllegalArgumentException illegalArgumentException) {
                throw GenericEntityManagerImpl.a(illegalArgumentException);
            }
            Set<String> set3 = genericEntityMetadata.c();
            try {
                if (set3 != null) {
                    classFilterBuilder.addMethods(set3.toArray(new String[set3.size()]));
                }
            }
            catch (IllegalArgumentException illegalArgumentException) {
                throw GenericEntityManagerImpl.a(illegalArgumentException);
            }
            List<ClassFilter> list = genericEntityMetadata.d();
            if (list != null) {
                for (ClassFilter classFilter : list) {
                    classFilterBuilder.addClassFilter(classFilter);
                }
            }
        }
        return classFilterBuilder;
    }

    @Override
    protected Collection<Map<String, Object>> getUniqueConstraints(GenericEntity genericEntity) {
        HashMap<String, String> hashMap = new HashMap<String, String>();
        String[] stringArray = q;
        hashMap.put(stringArray[57], genericEntity.getName());
        hashMap.put(stringArray[45], genericEntity.getEntityClassName());
        return Arrays.asList(hashMap);
    }

    static /* synthetic */ Predicate access$000(GenericEntityManagerImpl genericEntityManagerImpl, Predicate predicate, CriteriaBuilder criteriaBuilder, Root root) {
        return genericEntityManagerImpl.addFindByNamePredicate(predicate, criteriaBuilder, root);
    }

    static /* synthetic */ PersistentEntity access$100(GenericEntityManagerImpl genericEntityManagerImpl, TypedQuery typedQuery) {
        return genericEntityManagerImpl.getSingleResult(typedQuery);
    }

    static /* synthetic */ Predicate access$200(GenericEntityManagerImpl genericEntityManagerImpl, Predicate predicate, CriteriaBuilder criteriaBuilder, Root root) {
        return genericEntityManagerImpl.addFindAllPredicate(predicate, criteriaBuilder, root);
    }

    static /* synthetic */ Path access$300(Root root, String string, boolean bl2) {
        return GenericEntityManagerImpl.expandNestedAttribute(root, string, bl2);
    }

    static /* synthetic */ Path access$400(Root root, String string, boolean bl2) {
        return GenericEntityManagerImpl.expandNestedAttribute(root, string, bl2);
    }

    static /* synthetic */ Path access$500(Root root, String string, boolean bl2) {
        return GenericEntityManagerImpl.expandNestedAttribute(root, string, bl2);
    }

    static /* synthetic */ Path access$600(Root root, String string, boolean bl2) {
        return GenericEntityManagerImpl.expandNestedAttribute(root, string, bl2);
    }

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[79];
                var3_1 = 0;
                var2_2 = "ef}l$s\u0010'\u0006^@E\u0012X\u00171\u0011S@\u0018R\u0010\"T[L\u0004_SeT[]\u001fBY B\u0015F\u0010\u0016D<AP\t\u001b\u0006^@E\u0012X\u00171\u0011S@\u0018R\u00100_\\X\u0003S\u0010 _A@\u0002O\u0010$BvF\u0018UB EPl\u0018BY1H\u001aeSPJ\u0017CC \u0011\\]V_CePV]\u0003W\\)H\u0015HV\u000ekGP[\u0005__+\u0011s{9{\u0010$\u0016EGL\u0017[\u0010!^PZVX_1\u0011VF\u0018BQ,_\u0015H\u0018O\u0010 _A@\u0002_U6\u0014\"T[L\u0004_S\u0000_A@\u0002O}$_TN\u0013D\u0012!^s@\u0018Rr<d[@\u0007CU\u000bPXL\u0007\u0016tyl5b\u0010\f\"TAj\u001aWC6x[O\u0019\f#X[M4Ox PQL\u0004\u0007#X[M7Z\\\u000ekGP[\u0005__+\u0011s{9{\u0010\u001f#X[M4Ow _P[\u001fUs)PFZ7XT\u0015C\\D\u0017DI\u000eTL(\"T[L\u0004_SeT[]\u001fBIeXF\t\u0018YDe^S\t\u0013N@ RAL\u0012\u0016S)PFZV\u0018\u0006P[\u000e\u0002\u0016V,_Q\t\u0018Y^ht[]\u001fBY B\u0014#kT[]\u001fBI\u0006]TZ\u0005xQ(T\u0015\u0014V\fU+E\\]\u000fu\\$BFg\u0017[U1&^X\u0006\u001a\u0001D R]\u0006\u0005SB3TG\u0006\u0013XD,EL\u00061S^ C\\J3XD,ELd\u0017XQ\"TG`\u001bF\\*\u0005\u007fZ]8C\\)\u0011XL\u0002^_!\u0011\u0010ZX\u0013Ce\\@Z\u0002\u0016^*E\u0015[\u0013BE7_\u0015G\u0003Z\\/\u0006P[\t\u0018YDeW\\G\u0012\u0016W _P[\u001fU\u0010 _A@\u0002O\u0010(P[H\u0011SBeWZ[VU\\$BF\u0013V;\u0002T[L\u0004_SeT[]\u001fBIeRYH\u0005E\u0010&P[G\u0019B\u0010'T\u0015Z\u0017@U!\u0011B@\u0002^\u0010&]TZ\u0005\u0016_1YP[VBX$_\u0015\u0007kVZ@\u0012\u001a\u0010\nex{\t5zq\u0016b\u0015\u0018eRTG\u0018YDeSP\t\u0003FT$EPMVWCeP\u0015\u0016\u007f\u0011TJ\u0002CQ)\u0011VE\u0017EC+PXLV_Ce\u0007ef}l$s\u0010\u0010#X[M4Oe+XD\\\u0013xQ(T\u00046PCL\u001e\u000b^\u0015N\u0013XU7XV\t\u0013XD,EL\t\u0015ZQ6B\u0015G\u0017[U!\u0011\u0019\u0002T[L\u0004_SeT[]\u001fBIeF\\]\u001e\u0016W*XQ\t\u0010\"TAl\u0018BY1HxH\u0018WW C>\u0004CR\\\u001bS^1\u0011SF\u0004\u0016p\u000b^Ag\u0003Z\\eAT[\u0017[U1TG\tQ\u0013Cb\u0011ZOV\u0013Ck\u0014F\t\u001bCC1\u0011[F\u0002\u0016R \u0011[\\\u001aZ\u0006!TYL\u0002S\u000eeXF\t\u0004SW,BAL\u0004ST1&^X\u0006\u001a\u0001D R]\u0006\u0005SB3TG\u0006\u0013XD,EL\u00061S^ C\\J3XD,ELd\u0017XQ\"TG`\u001bF\\\r\"T[L\u0004_S\u0000_A@\u0002O!\u0010_TK\u001aS\u00101^\u0015\\\u0006RQ1T\u0015N\u0013XU7XV\t\u0013XD,EL\u0013V\u0011#X[M&WW UxH\u0002UX,_R\feWGF\u001b\u0016A0TGPWI\u0016APJ\u001fPY U\u0015L\u0018BY1H\u0015J\u001aWC6\u0011\\ZVX_1\u0011TZ\u0005_W+PWE\u0013\u0016D*\u0011rL\u0018SB,RpG\u0002_D<\u001d\u0015L\u0018BY1H\u0015J\u001aWC6\u000b\u0015\u0016\u0010_TK\u001aS\u00101^\u0015@\u0018ED$_A@\u0017BUe\u001e\u000b^\u0015N\u0013XU7XV\t\u0013XD,EL\t\u0015ZQ6B\u0015G\u0017[U!\u0011\u00060AQH\u0002S+\u0006^@E\u0012X\u00171\u0011S@\u0018R\u0010$]Y\t\u0011S^ C\\JVS^1XA@\u0013E\u0010*W\u0015]\u000fFUe\u000f _A@\u0002Os)PFZ8W] \u000e#X[M7Z\\\rTTM\u0013DC0\u0006]TZ\u0005\u0016T*TF\t\u0018YDe\\T]\u0015^\u0010#^G\t\u0011S^ C\\JVS^1XAPVYVeELY\u0013\u0016\u0005eP[MV\u0018eRTG\u0018YDeSP\t\u0012S\\ EPMVWCeP\u0015.\u0011Y\\ZV{Q+PRL\u0004\u0011CeT[]\u001fBY B\u0015H\u0004S\u0010+^A\t8W] UpG\u0002_D,TF\b\r7TR@\u0005BU7rYH\u0005E\u000b _A@\u0002Os)PFZ@\u0016APJ\u001fPY U\u0015L\u0018BY1H\u0015J\u001aWC6_TD\u0013\u0016Y6\u0011TE\u0004SQ!H\u0015[\u0013QY6EP[\u0013R\u001ceT[]\u001fBIeRYH\u0005E\ne\u000eeXF\t\u0004SW,BAL\u0004ST\u0007\u0016tyl5b\u0010+\u0006^@E\u0012X\u00171\u0011S@\u0018R\u0010$]Y\t\u0011S^ C\\JVS^1XA@\u0013E\u0010*W\u0015]\u000fFUe\u0004+PXL\u0014kVZ@\u0012\u0016\re\u000bRF\u001fR\u0010e\u0011tg2\u00169\u0002T[L\u0004_SeT[]\u001fBIeixeVED7TTDVRY!\u0011[F\u0002\u0016S*_AH\u001fX\u0010$_\u0015@\u0018ED$_VLVYVe\n\"TA\u007f\u0013DC,^[\u000b&^X\u0007\u001a\u0001D R]\u0007{\u0016APJ\u001fPY U\u0015L\u0018BY1H\u0015J\u001aWC6\u0011\\ZVqU+TG@\u0015s^1XAPV_D6TYOM\u0016S*_V[\u0013BUeT[]\u001fBIeRYH\u0005E\u00106YZ\\\u001aR\u0010'T\u0015HVEE'RYH\u0005E\u0010*W\u0015n\u0013XU7XVl\u0018BY1H\u0019\t\u0013XD,EL\t\u0015ZQ6B\u000f\t\u000f\"TAj\u0017UX UpG\u0002_D<\u0016\u0002^A\t\u0003XU=APJ\u0002STeW\\L\u001aRCe\nex{\t5zq\u0016b\u0015\u0002\u007f\u0011\u000f _A@\u0002Os)PFZ8W] #kT[]\u001fBI\u0006]TZ\u0005xQ(T\u0015\u0014V\fU+E\\]\u000fu\\$BFg\u0017[U\u0017\u007f\u0011TJ\u0002CQ)\u0011VE\u0017ECe_TD\u0013\u0016Y6\u0011\u001c\u0010_TK\u001aS\u00101^\u0015O\u001fXTeGP[\u0005__+\u0011XH\u0006\f\u0010=\u0002T[L\u0004_SeT[]\u001fBIeRYH\u0005E\u0010&P[G\u0019B\u0010'T\u0015M\u0013ZU1TQ\t\u0001_D-\u0011VE\u0017ECe^AA\u0013D\u00101YTGV\u0002,U\u0019\u0002T[L\u0004_SeT[]\u001fBIeF\\]\u001e\u0016W*XQ\t\u0017\u007f\u0011TJ\u0002CQ)\u0011VE\u0017ECe_TD\u0013\u0016Y6\u0011\u000e#X[M SB6XZG;W@2\u0003^@G\u0012\u0016S*_V[\u0013BUeVPG\u0013DY&\u0011W\\\u0002\u0016S)PFZVBI5T\u0015@\u0005\u0016Y+RZ[\u0004SS1";
                var4_3 = "ef}l$s\u0010'\u0006^@E\u0012X\u00171\u0011S@\u0018R\u0010\"T[L\u0004_SeT[]\u001fBY B\u0015F\u0010\u0016D<AP\t\u001b\u0006^@E\u0012X\u00171\u0011S@\u0018R\u00100_\\X\u0003S\u0010 _A@\u0002O\u0010$BvF\u0018UB EPl\u0018BY1H\u001aeSPJ\u0017CC \u0011\\]V_CePV]\u0003W\\)H\u0015HV\u000ekGP[\u0005__+\u0011s{9{\u0010$\u0016EGL\u0017[\u0010!^PZVX_1\u0011VF\u0018BQ,_\u0015H\u0018O\u0010 _A@\u0002_U6\u0014\"T[L\u0004_S\u0000_A@\u0002O}$_TN\u0013D\u0012!^s@\u0018Rr<d[@\u0007CU\u000bPXL\u0007\u0016tyl5b\u0010\f\"TAj\u001aWC6x[O\u0019\f#X[M4Ox PQL\u0004\u0007#X[M7Z\\\u000ekGP[\u0005__+\u0011s{9{\u0010\u001f#X[M4Ow _P[\u001fUs)PFZ7XT\u0015C\\D\u0017DI\u000eTL(\"T[L\u0004_SeT[]\u001fBIeXF\t\u0018YDe^S\t\u0013N@ RAL\u0012\u0016S)PFZV\u0018\u0006P[\u000e\u0002\u0016V,_Q\t\u0018Y^ht[]\u001fBY B\u0014#kT[]\u001fBI\u0006]TZ\u0005xQ(T\u0015\u0014V\fU+E\\]\u000fu\\$BFg\u0017[U1&^X\u0006\u001a\u0001D R]\u0006\u0005SB3TG\u0006\u0013XD,EL\u00061S^ C\\J3XD,ELd\u0017XQ\"TG`\u001bF\\*\u0005\u007fZ]8C\\)\u0011XL\u0002^_!\u0011\u0010ZX\u0013Ce\\@Z\u0002\u0016^*E\u0015[\u0013BE7_\u0015G\u0003Z\\/\u0006P[\t\u0018YDeW\\G\u0012\u0016W _P[\u001fU\u0010 _A@\u0002O\u0010(P[H\u0011SBeWZ[VU\\$BF\u0013V;\u0002T[L\u0004_SeT[]\u001fBIeRYH\u0005E\u0010&P[G\u0019B\u0010'T\u0015Z\u0017@U!\u0011B@\u0002^\u0010&]TZ\u0005\u0016_1YP[VBX$_\u0015\u0007kVZ@\u0012\u001a\u0010\nex{\t5zq\u0016b\u0015\u0018eRTG\u0018YDeSP\t\u0003FT$EPMVWCeP\u0015\u0016\u007f\u0011TJ\u0002CQ)\u0011VE\u0017EC+PXLV_Ce\u0007ef}l$s\u0010\u0010#X[M4Oe+XD\\\u0013xQ(T\u00046PCL\u001e\u000b^\u0015N\u0013XU7XV\t\u0013XD,EL\t\u0015ZQ6B\u0015G\u0017[U!\u0011\u0019\u0002T[L\u0004_SeT[]\u001fBIeF\\]\u001e\u0016W*XQ\t\u0010\"TAl\u0018BY1HxH\u0018WW C>\u0004CR\\\u001bS^1\u0011SF\u0004\u0016p\u000b^Ag\u0003Z\\eAT[\u0017[U1TG\tQ\u0013Cb\u0011ZOV\u0013Ck\u0014F\t\u001bCC1\u0011[F\u0002\u0016R \u0011[\\\u001aZ\u0006!TYL\u0002S\u000eeXF\t\u0004SW,BAL\u0004ST1&^X\u0006\u001a\u0001D R]\u0006\u0005SB3TG\u0006\u0013XD,EL\u00061S^ C\\J3XD,ELd\u0017XQ\"TG`\u001bF\\\r\"T[L\u0004_S\u0000_A@\u0002O!\u0010_TK\u001aS\u00101^\u0015\\\u0006RQ1T\u0015N\u0013XU7XV\t\u0013XD,EL\u0013V\u0011#X[M&WW UxH\u0002UX,_R\feWGF\u001b\u0016A0TGPWI\u0016APJ\u001fPY U\u0015L\u0018BY1H\u0015J\u001aWC6\u0011\\ZVX_1\u0011TZ\u0005_W+PWE\u0013\u0016D*\u0011rL\u0018SB,RpG\u0002_D<\u001d\u0015L\u0018BY1H\u0015J\u001aWC6\u000b\u0015\u0016\u0010_TK\u001aS\u00101^\u0015@\u0018ED$_A@\u0017BUe\u001e\u000b^\u0015N\u0013XU7XV\t\u0013XD,EL\t\u0015ZQ6B\u0015G\u0017[U!\u0011\u00060AQH\u0002S+\u0006^@E\u0012X\u00171\u0011S@\u0018R\u0010$]Y\t\u0011S^ C\\JVS^1XA@\u0013E\u0010*W\u0015]\u000fFUe\u000f _A@\u0002Os)PFZ8W] \u000e#X[M7Z\\\rTTM\u0013DC0\u0006]TZ\u0005\u0016T*TF\t\u0018YDe\\T]\u0015^\u0010#^G\t\u0011S^ C\\JVS^1XAPVYVeELY\u0013\u0016\u0005eP[MV\u0018eRTG\u0018YDeSP\t\u0012S\\ EPMVWCeP\u0015.\u0011Y\\ZV{Q+PRL\u0004\u0011CeT[]\u001fBY B\u0015H\u0004S\u0010+^A\t8W] UpG\u0002_D,TF\b\r7TR@\u0005BU7rYH\u0005E\u000b _A@\u0002Os)PFZ@\u0016APJ\u001fPY U\u0015L\u0018BY1H\u0015J\u001aWC6_TD\u0013\u0016Y6\u0011TE\u0004SQ!H\u0015[\u0013QY6EP[\u0013R\u001ceT[]\u001fBIeRYH\u0005E\ne\u000eeXF\t\u0004SW,BAL\u0004ST\u0007\u0016tyl5b\u0010+\u0006^@E\u0012X\u00171\u0011S@\u0018R\u0010$]Y\t\u0011S^ C\\JVS^1XA@\u0013E\u0010*W\u0015]\u000fFUe\u0004+PXL\u0014kVZ@\u0012\u0016\re\u000bRF\u001fR\u0010e\u0011tg2\u00169\u0002T[L\u0004_SeT[]\u001fBIeixeVED7TTDVRY!\u0011[F\u0002\u0016S*_AH\u001fX\u0010$_\u0015@\u0018ED$_VLVYVe\n\"TA\u007f\u0013DC,^[\u000b&^X\u0007\u001a\u0001D R]\u0007{\u0016APJ\u001fPY U\u0015L\u0018BY1H\u0015J\u001aWC6\u0011\\ZVqU+TG@\u0015s^1XAPV_D6TYOM\u0016S*_V[\u0013BUeT[]\u001fBIeRYH\u0005E\u00106YZ\\\u001aR\u0010'T\u0015HVEE'RYH\u0005E\u0010*W\u0015n\u0013XU7XVl\u0018BY1H\u0019\t\u0013XD,EL\t\u0015ZQ6B\u000f\t\u000f\"TAj\u0017UX UpG\u0002_D<\u0016\u0002^A\t\u0003XU=APJ\u0002STeW\\L\u001aRCe\nex{\t5zq\u0016b\u0015\u0002\u007f\u0011\u000f _A@\u0002Os)PFZ8W] #kT[]\u001fBI\u0006]TZ\u0005xQ(T\u0015\u0014V\fU+E\\]\u000fu\\$BFg\u0017[U\u0017\u007f\u0011TJ\u0002CQ)\u0011VE\u0017ECe_TD\u0013\u0016Y6\u0011\u001c\u0010_TK\u001aS\u00101^\u0015O\u001fXTeGP[\u0005__+\u0011XH\u0006\f\u0010=\u0002T[L\u0004_SeT[]\u001fBIeRYH\u0005E\u0010&P[G\u0019B\u0010'T\u0015M\u0013ZU1TQ\t\u0001_D-\u0011VE\u0017ECe^AA\u0013D\u00101YTGV\u0002,U\u0019\u0002T[L\u0004_SeT[]\u001fBIeF\\]\u001e\u0016W*XQ\t\u0017\u007f\u0011TJ\u0002CQ)\u0011VE\u0017ECe_TD\u0013\u0016Y6\u0011\u000e#X[M SB6XZG;W@2\u0003^@G\u0012\u0016S*_V[\u0013BUeVPG\u0013DY&\u0011W\\\u0002\u0016S)PFZVBI5T\u0015@\u0005\u0016Y+RZ[\u0004SS1".length();
                var1_4 = 7;
                var0_5 = -1;
lbl7:
                // 2 sources

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

                while (true) {
                    var5[var3_1++] = GenericEntityManagerImpl.b(v0, GenericEntityManagerImpl.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "Btwm0dd\u00076{zqxdBwqz$p{\u000eo2oq\u000f\u0007xfg%hT\u000ewa}?pz\u0007";
                    var4_3 = "Btwm0dd\u00076{zqxdBwqz$p{\u000eo2oq\u000f\u0007xfg%hT\u000ewa}?pz\u0007".length();
                    var1_4 = 26;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 38;
                        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++] = GenericEntityManagerImpl.b(v0, GenericEntityManagerImpl.a(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;
            }
        }
        GenericEntityManagerImpl.q = var5;
        GenericEntityManagerImpl.F_CLASSNAME = GenericEntityManagerImpl.q[67];
        GenericEntityManagerImpl.m = Logger.getLogger(GenericEntityManagerImpl.class.getName());
    }

    /*
     * Exception decompiling
     */
    private static /* synthetic */ void b(int var0) {
        /*
         * This method has failed to decompile.  When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file.
         * 
         * org.benf.cfr.reader.util.ConfusedCFRException: Tried to end blocks [0[TRYBLOCK]], but top level block is 6[SWITCH]
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.processEndingBlocks(Op04StructuredStatement.java:435)
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.buildNestedBlocks(Op04StructuredStatement.java:484)
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op03SimpleStatement.createInitialStructuredBlock(Op03SimpleStatement.java:736)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:850)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:278)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:201)
         *     at org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:94)
         *     at org.benf.cfr.reader.entities.Method.analyse(Method.java:531)
         *     at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1050)
         *     at org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:942)
         *     at org.benf.cfr.reader.Driver.doJarVersionTypes(Driver.java:257)
         *     at org.benf.cfr.reader.Driver.doJar(Driver.java:139)
         *     at org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:76)
         *     at org.benf.cfr.reader.Main.main(Main.java:54)
         */
        throw new IllegalStateException("Decompilation failed");
    }

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

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x31);
        }
        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 -> 68;
                    case 1 -> 48;
                    case 2 -> 52;
                    case 3 -> 40;
                    case 4 -> 119;
                    case 5 -> 55;
                    default -> 49;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

