/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.objectmodel.DeleteException
 *  com.l7tech.objectmodel.DuplicateObjectException
 *  com.l7tech.objectmodel.Entity
 *  com.l7tech.objectmodel.EntityHeader
 *  com.l7tech.objectmodel.EntityHeaderSet
 *  com.l7tech.objectmodel.EntityManager
 *  com.l7tech.objectmodel.EntityManager$UniqueType
 *  com.l7tech.objectmodel.EntityType
 *  com.l7tech.objectmodel.FindException
 *  com.l7tech.objectmodel.Goid
 *  com.l7tech.objectmodel.GoidRange
 *  com.l7tech.objectmodel.NamedEntity
 *  com.l7tech.objectmodel.PersistentEntity
 *  com.l7tech.objectmodel.SaveException
 *  com.l7tech.objectmodel.SecurityZone
 *  com.l7tech.objectmodel.StaleUpdateException
 *  com.l7tech.objectmodel.UpdateException
 *  com.l7tech.objectmodel.ZoneableEntity
 *  com.l7tech.objectmodel.ZoneableEntityHeader
 *  com.l7tech.objectmodel.imp.PersistentEntityUtil
 *  com.l7tech.util.ConfigFactory
 *  com.l7tech.util.ExceptionUtils
 *  com.l7tech.util.Functions
 *  com.l7tech.util.Functions$Binary
 *  com.l7tech.util.Functions$BinaryThrows
 *  com.l7tech.util.Functions$Ternary
 *  com.l7tech.util.Functions$Unary
 *  com.l7tech.util.Functions$UnaryThrows
 *  jakarta.persistence.NoResultException
 *  jakarta.persistence.Table
 *  jakarta.persistence.TypedQuery
 *  jakarta.persistence.criteria.CriteriaBuilder
 *  jakarta.persistence.criteria.CriteriaQuery
 *  jakarta.persistence.criteria.Expression
 *  jakarta.persistence.criteria.Path
 *  jakarta.persistence.criteria.Predicate
 *  jakarta.persistence.criteria.Root
 *  jakarta.persistence.criteria.Selection
 *  org.apache.commons.lang3.StringUtils
 *  org.hibernate.Criteria
 *  org.hibernate.FlushMode
 *  org.hibernate.HibernateException
 *  org.hibernate.ObjectDeletedException
 *  org.hibernate.ObjectNotFoundException
 *  org.hibernate.Session
 *  org.hibernate.SessionFactory
 *  org.hibernate.query.Query
 *  org.jetbrains.annotations.Contract
 *  org.jetbrains.annotations.NotNull
 *  org.jetbrains.annotations.Nullable
 *  org.springframework.beans.BeansException
 *  org.springframework.context.ApplicationContext
 *  org.springframework.context.ApplicationContextAware
 *  org.springframework.context.ApplicationEvent
 *  org.springframework.dao.DataAccessException
 *  org.springframework.orm.hibernate5.HibernateCallback
 *  org.springframework.orm.hibernate5.SessionFactoryUtils
 *  org.springframework.orm.hibernate5.support.HibernateDaoSupport
 *  org.springframework.transaction.PlatformTransactionManager
 *  org.springframework.transaction.annotation.Propagation
 *  org.springframework.transaction.annotation.Transactional
 *  org.springframework.transaction.support.TransactionCallback
 *  org.springframework.transaction.support.TransactionTemplate
 */
package com.l7tech.server;

import com.l7tech.objectmodel.DeleteException;
import com.l7tech.objectmodel.DuplicateObjectException;
import com.l7tech.objectmodel.Entity;
import com.l7tech.objectmodel.EntityHeader;
import com.l7tech.objectmodel.EntityHeaderSet;
import com.l7tech.objectmodel.EntityManager;
import com.l7tech.objectmodel.EntityType;
import com.l7tech.objectmodel.FindException;
import com.l7tech.objectmodel.Goid;
import com.l7tech.objectmodel.GoidRange;
import com.l7tech.objectmodel.NamedEntity;
import com.l7tech.objectmodel.PersistentEntity;
import com.l7tech.objectmodel.SaveException;
import com.l7tech.objectmodel.SecurityZone;
import com.l7tech.objectmodel.StaleUpdateException;
import com.l7tech.objectmodel.UpdateException;
import com.l7tech.objectmodel.ZoneableEntity;
import com.l7tech.objectmodel.ZoneableEntityHeader;
import com.l7tech.objectmodel.imp.PersistentEntityUtil;
import com.l7tech.server.ac;
import com.l7tech.server.ad;
import com.l7tech.server.ae;
import com.l7tech.server.af;
import com.l7tech.server.ag;
import com.l7tech.server.aj;
import com.l7tech.server.am;
import com.l7tech.server.an;
import com.l7tech.server.ao;
import com.l7tech.server.bk;
import com.l7tech.server.bl;
import com.l7tech.server.bm;
import com.l7tech.server.bn;
import com.l7tech.server.bo;
import com.l7tech.server.bp;
import com.l7tech.server.bq;
import com.l7tech.server.br;
import com.l7tech.server.bs;
import com.l7tech.server.bt;
import com.l7tech.server.bu;
import com.l7tech.server.bv;
import com.l7tech.server.bw;
import com.l7tech.server.bx;
import com.l7tech.server.by;
import com.l7tech.server.event.RoleAwareEntityDeletionEvent;
import com.l7tech.util.ConfigFactory;
import com.l7tech.util.ExceptionUtils;
import com.l7tech.util.Functions;
import jakarta.persistence.NoResultException;
import jakarta.persistence.Table;
import jakarta.persistence.TypedQuery;
import jakarta.persistence.criteria.CriteriaBuilder;
import jakarta.persistence.criteria.CriteriaQuery;
import jakarta.persistence.criteria.Expression;
import jakarta.persistence.criteria.Path;
import jakarta.persistence.criteria.Predicate;
import jakarta.persistence.criteria.Root;
import jakarta.persistence.criteria.Selection;
import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.Criteria;
import org.hibernate.FlushMode;
import org.hibernate.HibernateException;
import org.hibernate.ObjectDeletedException;
import org.hibernate.ObjectNotFoundException;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.query.Query;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.ApplicationEvent;
import org.springframework.dao.DataAccessException;
import org.springframework.orm.hibernate5.HibernateCallback;
import org.springframework.orm.hibernate5.SessionFactoryUtils;
import org.springframework.orm.hibernate5.support.HibernateDaoSupport;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionCallback;
import org.springframework.transaction.support.TransactionTemplate;

/*
 * Exception performing whole class analysis ignored.
 */
@Transactional(propagation=Propagation.REQUIRED, rollbackFor={Throwable.class})
public abstract class HibernateEntityManager<ET extends PersistentEntity, HT extends EntityHeader>
extends HibernateDaoSupport
implements EntityManager<ET, HT>,
ApplicationContextAware {
    public static final String EMPTY_STRING = "";
    public static final String F_GOID;
    public static final String F_NAME;
    public static final String F_VERSION;
    public static final Object NULL;
    public static final Object NOTNULL;
    private final String a;
    private final String b;
    private final String c;
    private final String d;
    protected PlatformTransactionManager transactionManager;
    protected ApplicationContext applicationContext;
    private final Logger e;
    private static final boolean f;
    private ReadWriteLock g;
    private Map<Goid, WeakReference<ao<ET>>> h;
    private Map<String, WeakReference<ao<ET>>> i;
    private String j;
    private EntityType k;
    static final /* synthetic */ boolean l;
    private static final String[] S;

    public HibernateEntityManager() {
        String string = this.getImpClass().getName();
        String string2 = this.getTableName();
        String string3 = this.getTableName();
        String string4 = this.getTableName();
        String[] stringArray = S;
        this.a = stringArray[34] + string4 + stringArray[37] + string3 + stringArray[61] + string2 + stringArray[22] + string;
        String string5 = this.getTableName();
        String string6 = this.getImpClass().getName();
        String string7 = this.getTableName();
        String string8 = this.getTableName();
        this.b = stringArray[49] + string8 + stringArray[50] + string7 + stringArray[58] + string6 + stringArray[59] + string5 + stringArray[25];
        String string9 = this.getTableName();
        String string10 = this.getImpClass().getName();
        String string11 = this.getTableName();
        this.c = stringArray[14] + string11 + stringArray[58] + string10 + stringArray[0] + string9 + stringArray[2];
        String string12 = this.getTableName();
        String string13 = this.getImpClass().getName();
        String string14 = this.getTableName();
        this.d = stringArray[43] + string14 + stringArray[58] + string13 + stringArray[0] + string12 + stringArray[2];
        this.e = Logger.getLogger(((Object)((Object)this)).getClass().getName());
        this.g = new ReentrantReadWriteLock();
        this.h = new HashMap<Goid, WeakReference<ao<ET>>>();
        this.i = new HashMap<String, WeakReference<ao<ET>>>();
    }

    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        this.applicationContext = applicationContext;
    }

    @Transactional(readOnly=true)
    public ET findByPrimaryKey(Goid goid) throws FindException {
        try {
            return (ET)((PersistentEntity)this.getHibernateTemplate().execute((HibernateCallback)new bk(this, goid)));
        }
        catch (Exception exception) {
            throw new FindException(exception.toString(), (Throwable)exception);
        }
    }

    @Transactional(readOnly=true)
    protected ET findByUniqueKey(String string, long l2) throws FindException {
        try {
            if (string == null) {
                throw new NullPointerException();
            }
        }
        catch (FindException findException) {
            throw HibernateEntityManager.c((Exception)((Object)findException));
        }
        try {
            if (string.trim().isEmpty()) {
                throw new IllegalArgumentException(S[78]);
            }
        }
        catch (FindException findException) {
            throw HibernateEntityManager.c((Exception)((Object)findException));
        }
        return this.findUnique(Collections.singletonMap(string, l2));
    }

    @Transactional(readOnly=true)
    protected ET findByUniqueKey(String string, Goid goid) throws FindException {
        try {
            if (string == null) {
                throw new NullPointerException();
            }
        }
        catch (FindException findException) {
            throw HibernateEntityManager.c((Exception)((Object)findException));
        }
        try {
            if (string.trim().isEmpty()) {
                throw new IllegalArgumentException(S[28]);
            }
        }
        catch (FindException findException) {
            throw HibernateEntityManager.c((Exception)((Object)findException));
        }
        return this.findUnique(Collections.singletonMap(string, goid));
    }

    protected final ET findUnique(Map<String, Object> map) throws FindException {
        try {
            return (ET)((PersistentEntity)this.getHibernateTemplate().execute((HibernateCallback)new br(this, map)));
        }
        catch (HibernateException hibernateException) {
            throw new FindException(S[4], (Throwable)hibernateException);
        }
    }

    @NotNull
    private TypedQuery<ET> a(@NotNull Session session, @NotNull Collection<Map<String, Object>> collection, @Nullable Functions.Ternary<Predicate, CriteriaBuilder, Root<ET>, Predicate> ternary) {
        Query query;
        try {
            if (session == null) {
                HibernateEntityManager.a(0);
            }
        }
        catch (NullPointerException nullPointerException) {
            throw HibernateEntityManager.c(nullPointerException);
        }
        try {
            if (collection == null) {
                HibernateEntityManager.a(1);
            }
        }
        catch (NullPointerException nullPointerException) {
            throw HibernateEntityManager.c(nullPointerException);
        }
        CriteriaBuilder criteriaBuilder = session.getCriteriaBuilder();
        CriteriaQuery criteriaQuery = criteriaBuilder.createQuery(this.getImpClass());
        Root root = criteriaQuery.from(this.getImpClass());
        Predicate predicate = this.asPredicate(criteriaBuilder, root, collection);
        if (ternary != null) {
            predicate = (Predicate)ternary.call((Object)criteriaBuilder, (Object)root, (Object)predicate);
        }
        try {
            criteriaQuery.select((Selection)root).where((Expression)predicate);
            query = session.createQuery(criteriaQuery);
            if (query == null) {
                HibernateEntityManager.a(2);
            }
        }
        catch (NullPointerException nullPointerException) {
            throw HibernateEntityManager.c(nullPointerException);
        }
        return query;
    }

    @Transactional(readOnly=true)
    public ET findByHeader(EntityHeader entityHeader) throws FindException {
        return this.findByPrimaryKey(entityHeader.getGoid());
    }

    /*
     * Loose catch block
     */
    protected int findCount(Class clazz, Functions.BinaryThrows<Predicate, CriteriaBuilder, Root<ET>, FindException> binaryThrows) throws FindException {
        Class clazz2;
        try {
            clazz2 = clazz == null ? this.getImpClass() : clazz;
        }
        catch (Exception exception) {
            throw HibernateEntityManager.c(exception);
        }
        Class clazz3 = clazz2;
        try {
            block8: {
                if (!f) break block8;
                try {
                    block9: {
                        if (binaryThrows != null) break block8;
                        break block9;
                        catch (Exception exception) {
                            throw HibernateEntityManager.c(exception);
                        }
                    }
                    if (!clazz3.equals(this.getImpClass())) break block8;
                }
                catch (Exception exception) {
                    throw HibernateEntityManager.c(exception);
                }
                return this.doReadOnlyWork(new aj(this));
            }
            return (Integer)this.getHibernateTemplate().execute((HibernateCallback)new bv(this, binaryThrows));
        }
        catch (Exception exception) {
            throw new FindException(S[16], (Throwable)exception);
        }
    }

    protected List<ET> findPage(Class clazz, String string, boolean bl2, int n2, int n3, Functions.BinaryThrows<Predicate, CriteriaBuilder, Root<ET>, FindException> binaryThrows) throws FindException {
        try {
            return (List)this.getHibernateTemplate().execute((HibernateCallback)new bw(this, clazz, binaryThrows, string, bl2, n2, n3));
        }
        catch (Exception exception) {
            throw new FindException(S[84], (Throwable)exception);
        }
    }

    public List<ET> findPagedMatching(int n2, int n3, String string, Boolean bl2, Map<String, List<Object>> map) throws FindException {
        try {
            return (List)this.getHibernateTemplate().execute((HibernateCallback)new bx(this, map, string, bl2, n2, n3));
        }
        catch (Exception exception) {
            throw new FindException(S[3], (Throwable)exception);
        }
    }

    protected final List<ET> findMatching(@NotNull Collection<Map<String, Object>> collection) throws FindException {
        try {
            if (collection == null) {
                HibernateEntityManager.a(3);
            }
        }
        catch (FindException findException) {
            throw HibernateEntityManager.c((Exception)((Object)findException));
        }
        return this.findMatching(collection, null);
    }

    protected final List<ET> findMatching(@NotNull Collection<Map<String, Object>> collection, @Nullable Functions.Ternary<Predicate, CriteriaBuilder, Root<ET>, Predicate> ternary) throws FindException {
        try {
            if (collection == null) {
                HibernateEntityManager.a(4);
            }
        }
        catch (Exception exception) {
            throw HibernateEntityManager.c(exception);
        }
        try {
            return (List)this.getHibernateTemplate().execute((HibernateCallback)new by(this, collection, ternary));
        }
        catch (Exception exception) {
            throw new FindException(S[79], (Throwable)exception);
        }
    }

    protected final <V> Predicate asPredicate(CriteriaBuilder criteriaBuilder, Root<ET> root, Collection<Map<String, V>> collection) {
        return (Predicate)Functions.reduce(collection, (Object)criteriaBuilder.disjunction(), (Functions.Binary)new am(this, criteriaBuilder, root));
    }

    protected final <V> Predicate asPredicate(CriteriaBuilder criteriaBuilder, Root<ET> root, Map<String, V> map) {
        return (Predicate)Functions.reduce(map.entrySet(), (Object)criteriaBuilder.conjunction(), (Functions.Binary)new an(this, criteriaBuilder, root));
    }

    protected static Path expandNestedAttribute(@NotNull Root root, @Nullable String string, boolean bl2) {
        try {
            if (root == null) {
                HibernateEntityManager.a(5);
            }
        }
        catch (NullPointerException nullPointerException) {
            throw HibernateEntityManager.c(nullPointerException);
        }
        Root root2 = root;
        if (StringUtils.isNotEmpty((CharSequence)string)) {
            String[] stringArray = S;
            for (String string2 : string.split(stringArray[31])) {
                block7: {
                    try {
                        if (!bl2 || !S[32].equals(string2)) break block7;
                    }
                    catch (NullPointerException nullPointerException) {
                        throw HibernateEntityManager.c(nullPointerException);
                    }
                    root2 = root2.get(S[55]);
                    continue;
                }
                root2 = root2.get(string2);
            }
        }
        return root2;
    }

    static Path a(@NotNull Root root, @Nullable String string) {
        try {
            if (root == null) {
                HibernateEntityManager.a(6);
            }
        }
        catch (NullPointerException nullPointerException) {
            throw HibernateEntityManager.c(nullPointerException);
        }
        return HibernateEntityManager.expandNestedAttribute(root, string, false);
    }

    protected List<HT> findMatchingHeaders(Collection<Map<String, Object>> collection) throws FindException {
        return Functions.map(this.findMatching(collection), (Functions.Unary)new ac(this));
    }

    /*
     * Exception decompiling
     */
    protected Collection<Map<String, Object>> getUniqueConstraints(ET var1_1) {
        /*
         * 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 1[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:1055)
         *     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");
    }

    /*
     * Loose catch block
     */
    public Goid save(ET ET) throws SaveException {
        block15: {
            String string;
            Object[] objectArray;
            String string2;
            Level level;
            Logger logger;
            block17: {
                block16: {
                    if (!this.e.isLoggable(Level.FINE)) break block15;
                    try {
                        block18: {
                            logger = this.e;
                            level = Level.FINE;
                            string2 = S[65];
                            Object[] objectArray2 = new Object[2];
                            objectArray2[0] = this.getImpClass().getSimpleName();
                            Object[] objectArray3 = objectArray2;
                            objectArray = objectArray2;
                            int n2 = 1;
                            if (ET != null) break block16;
                            break block18;
                            catch (FindException findException) {
                                throw HibernateEntityManager.c((Exception)((Object)findException));
                            }
                        }
                        string = null;
                        break block17;
                    }
                    catch (FindException findException) {
                        throw HibernateEntityManager.c((Exception)((Object)findException));
                    }
                }
                string = ET.toString();
            }
            objectArray3[n2] = string;
            logger.log(level, string2, objectArray);
        }
        try {
            Object object;
            if (this.getUniqueType() != EntityManager.UniqueType.NONE) {
                List<ET> list;
                object = this.getUniqueConstraints(ET);
                try {
                    list = this.findMatching((Collection<Map<String, Object>>)object);
                }
                catch (FindException findException) {
                    String[] stringArray = S;
                    throw new SaveException(stringArray[63], (Throwable)findException);
                }
                try {
                    if (!list.isEmpty()) {
                        throw new DuplicateObjectException(this.describeAttributes((Collection<Map<String, Object>>)object));
                    }
                }
                catch (FindException findException) {
                    throw HibernateEntityManager.c((Exception)((Object)findException));
                }
            }
            object = this.getHibernateTemplate().save(ET);
            try {
                if (!(object instanceof Goid)) {
                    throw new SaveException(S[76] + object.getClass().getName() + S[26]);
                }
            }
            catch (FindException findException) {
                throw HibernateEntityManager.c((Exception)((Object)findException));
            }
            return (Goid)object;
        }
        catch (RuntimeException runtimeException) {
            throw new SaveException(S[69] + ET.getClass().getSimpleName(), (Throwable)runtimeException);
        }
    }

    /*
     * Loose catch block
     */
    public void save(@NotNull Goid goid, @NotNull ET ET) throws SaveException {
        block24: {
            String string;
            Object[] objectArray;
            String string2;
            Level level;
            Logger logger;
            block26: {
                block25: {
                    try {
                        if (goid == null) {
                            HibernateEntityManager.a(7);
                        }
                    }
                    catch (FindException findException) {
                        throw HibernateEntityManager.c((Exception)((Object)findException));
                    }
                    try {
                        if (ET == null) {
                            HibernateEntityManager.a(8);
                        }
                    }
                    catch (FindException findException) {
                        throw HibernateEntityManager.c((Exception)((Object)findException));
                    }
                    if (!this.e.isLoggable(Level.FINE)) break block24;
                    try {
                        block28: {
                            logger = this.e;
                            level = Level.FINE;
                            string2 = S[54];
                            Object[] objectArray2 = new Object[3];
                            objectArray2[0] = this.getImpClass().getSimpleName();
                            Object[] objectArray3 = objectArray2;
                            objectArray = objectArray2;
                            int n2 = 1;
                            if (ET != null) break block25;
                            break block28;
                            catch (FindException findException) {
                                throw HibernateEntityManager.c((Exception)((Object)findException));
                            }
                        }
                        string = null;
                        break block26;
                    }
                    catch (FindException findException) {
                        throw HibernateEntityManager.c((Exception)((Object)findException));
                    }
                }
                string = ET.toString();
            }
            objectArray3[n2] = string;
            objectArray[2] = goid.toString();
            logger.log(level, string2, objectArray);
        }
        try {
            if (GoidRange.RESERVED_RANGE.isInRange(goid)) {
                throw new SaveException(S[19] + String.valueOf(goid));
            }
        }
        catch (FindException findException) {
            throw HibernateEntityManager.c((Exception)((Object)findException));
        }
        try {
            try {
                ET ET2 = this.findByPrimaryKey(goid);
                try {
                    if (ET2 != null) {
                        throw new DuplicateObjectException(S[42] + String.valueOf(goid));
                    }
                }
                catch (FindException findException) {
                    throw HibernateEntityManager.c((Exception)((Object)findException));
                }
            }
            catch (FindException findException) {
                // empty catch block
            }
            boolean bl2 = PersistentEntityUtil.preserveId(ET);
            try {
                if (!bl2) {
                    throw new SaveException(S[36] + ET.getClass().getSimpleName());
                }
            }
            catch (FindException findException) {
                throw HibernateEntityManager.c((Exception)((Object)findException));
            }
            ET.setGoid(goid);
            Goid goid2 = this.save(ET);
            if (!goid.equals((Object)goid2)) {
                String string = ET.getClass().getSimpleName();
                String string3 = String.valueOf(goid2);
                String string4 = String.valueOf(goid);
                String[] stringArray = S;
                throw new SaveException(stringArray[66] + string4 + stringArray[7] + string3 + stringArray[77] + string);
            }
        }
        catch (RuntimeException runtimeException) {
            throw new SaveException(S[48] + ET.getClass().getSimpleName(), (Throwable)runtimeException);
        }
    }

    protected String describeAttributes(Collection<Map<String, Object>> collection) {
        StringBuilder stringBuilder = new StringBuilder();
        for (Map<String, Object> map : collection) {
            String[] stringArray;
            try {
                if (map.size() == 0) {
                    continue;
                }
            }
            catch (NullPointerException nullPointerException) {
                throw HibernateEntityManager.c(nullPointerException);
            }
            stringBuilder.append("(");
            for (String string : map.keySet()) {
                stringArray = S;
                stringBuilder.append(string).append(stringArray[51]);
            }
            stringBuilder.delete(stringBuilder.length() - 2, stringBuilder.length());
            stringArray = S;
            stringBuilder.append(stringArray[35]);
        }
        try {
            if (stringBuilder.length() == 0) {
                throw new IllegalStateException(S[27]);
            }
        }
        catch (NullPointerException nullPointerException) {
            throw HibernateEntityManager.c(nullPointerException);
        }
        stringBuilder.append(S[53]);
        return stringBuilder.toString();
    }

    /*
     * Loose catch block
     */
    public void update(ET ET) throws UpdateException {
        try {
            block15: {
                Collection<Map<String, Object>> collection;
                if (this.getUniqueType() != EntityManager.UniqueType.NONE) {
                    List<ET> list;
                    collection = this.getUniqueConstraints(ET);
                    try {
                        list = this.findMatching(collection);
                    }
                    catch (FindException findException) {
                        String[] stringArray = S;
                        throw new UpdateException(stringArray[75]);
                    }
                    if (!list.isEmpty()) {
                        for (PersistentEntity persistentEntity : list) {
                            try {
                                if (ET.getId().equals(persistentEntity.getId()) && ET.getClass().equals(persistentEntity.getClass())) continue;
                            }
                            catch (FindException findException) {
                                throw HibernateEntityManager.c((Exception)((Object)findException));
                            }
                            String string = this.describeAttributes(collection);
                            throw new UpdateException(string, (Throwable)new DuplicateObjectException(string));
                        }
                    }
                }
                try {
                    collection = this.findByPrimaryKey(ET.getGoid());
                    if (collection == null) break block15;
                    try {
                        block16: {
                            if (collection.getVersion() == ET.getVersion()) break block15;
                            break block16;
                            catch (FindException findException) {
                                throw HibernateEntityManager.c((Exception)((Object)findException));
                            }
                        }
                        throw new StaleUpdateException(S[74] + String.valueOf(ET.getGoid()) + S[9]);
                    }
                    catch (FindException findException) {
                        throw HibernateEntityManager.c((Exception)((Object)findException));
                    }
                }
                catch (FindException findException) {
                    String[] stringArray = S;
                    throw new UpdateException(stringArray[62]);
                }
            }
            this.getHibernateTemplate().merge(ET);
        }
        catch (RuntimeException runtimeException) {
            throw new UpdateException(S[24] + ET.getClass().getSimpleName(), (Throwable)runtimeException);
        }
    }

    @Transactional(readOnly=true)
    public Integer getVersion(Goid goid) throws FindException {
        try {
            return (Integer)this.getHibernateTemplate().execute((HibernateCallback)new bl(this, goid));
        }
        catch (Exception exception) {
            throw new FindException(exception.toString(), (Throwable)exception);
        }
    }

    /*
     * Loose catch block
     */
    @Transactional(readOnly=true)
    public Map<Goid, Integer> findVersionMap() throws FindException {
        Session session;
        HashMap<Goid, Integer> hashMap;
        block22: {
            FlushMode flushMode;
            block20: {
                hashMap = new HashMap<Goid, Integer>();
                try {
                    if (!PersistentEntity.class.isAssignableFrom(this.getImpClass())) {
                        throw new FindException(S[1]);
                    }
                }
                catch (Exception exception) {
                    throw HibernateEntityManager.c(exception);
                }
                session = null;
                flushMode = null;
                session = HibernateEntityManager.useCurrentOrOpenNewSession(this.getSessionFactory());
                flushMode = session.getHibernateFlushMode();
                session.setHibernateFlushMode(FlushMode.MANUAL);
                Query query = session.createQuery(this.a);
                List list = query.list();
                if (list.size() <= 0) break block20;
                for (Object e10 : list) {
                    Object[] objectArray;
                    block21: {
                        objectArray = (Object[])e10;
                        if (!(objectArray[0] instanceof Goid)) break block21;
                        try {
                            block24: {
                                if (!(objectArray[1] instanceof Integer)) break block21;
                                break block24;
                                catch (Exception exception) {
                                    throw HibernateEntityManager.c(exception);
                                }
                            }
                            hashMap.put((Goid)objectArray[0], (Integer)objectArray[1]);
                            continue;
                        }
                        catch (Exception exception) {
                            throw HibernateEntityManager.c(exception);
                        }
                    }
                    String[] stringArray = S;
                    throw new FindException(stringArray[46] + String.valueOf(objectArray[0]) + stringArray[40] + String.valueOf(objectArray[1]) + stringArray[21]);
                }
            }
            if (session == null) break block22;
            try {
                block25: {
                    if (flushMode == null) break block22;
                    break block25;
                    catch (Exception exception) {
                        throw HibernateEntityManager.c(exception);
                    }
                }
                session.setHibernateFlushMode(flushMode);
                break block22;
            }
            catch (Exception exception) {
                throw HibernateEntityManager.c(exception);
            }
            catch (Exception exception) {
                try {
                    throw new FindException(exception.toString(), (Throwable)exception);
                }
                catch (Throwable throwable) {
                    block23: {
                        try {
                            try {
                                if (session == null || flushMode == null) break block23;
                            }
                            catch (Exception exception2) {
                                throw HibernateEntityManager.c(exception2);
                            }
                            session.setHibernateFlushMode(flushMode);
                        }
                        catch (Exception exception3) {
                            throw HibernateEntityManager.c(exception3);
                        }
                    }
                    HibernateEntityManager.closeNewSession(session);
                    throw throwable;
                }
            }
        }
        HibernateEntityManager.closeNewSession(session);
        return hashMap;
    }

    /*
     * Loose catch block
     */
    @NotNull
    public static Session useCurrentOrOpenNewSession(@Nullable SessionFactory sessionFactory) throws HibernateException {
        Session session;
        block9: {
            if (l) break block9;
            try {
                block10: {
                    if (sessionFactory != null) break block9;
                    break block10;
                    catch (HibernateException hibernateException) {
                        throw HibernateEntityManager.c((Exception)((Object)hibernateException));
                    }
                }
                throw new AssertionError((Object)S[64]);
            }
            catch (HibernateException hibernateException) {
                throw HibernateEntityManager.c((Exception)((Object)hibernateException));
            }
        }
        Session session2 = null;
        try {
            session2 = sessionFactory.getCurrentSession();
        }
        catch (HibernateException hibernateException) {
            session2 = sessionFactory.openSession();
        }
        try {
            session = session2;
            if (session == null) {
                HibernateEntityManager.a(9);
            }
        }
        catch (HibernateException hibernateException) {
            throw HibernateEntityManager.c((Exception)((Object)hibernateException));
        }
        return session;
    }

    public static void closeNewSession(@Nullable Session session) {
        block4: {
            try {
                try {
                    if (session == null || session.isJoinedToTransaction()) break block4;
                }
                catch (NullPointerException nullPointerException) {
                    throw HibernateEntityManager.c(nullPointerException);
                }
                SessionFactoryUtils.closeSession((Session)session);
            }
            catch (NullPointerException nullPointerException) {
                throw HibernateEntityManager.c(nullPointerException);
            }
        }
    }

    @Transactional(propagation=Propagation.SUPPORTS)
    public EntityType getEntityType() {
        EntityType entityType = this.k;
        if (entityType == null) {
            this.k = entityType = EntityType.findTypeByEntity(this.getInterfaceClass());
        }
        if (entityType == null) {
            this.k = entityType = EntityType.ANY;
        }
        return entityType;
    }

    @Transactional(readOnly=true)
    public EntityHeaderSet<HT> findAllHeaders() throws FindException {
        Collection<ET> collection = this.findAll();
        EntityHeaderSet entityHeaderSet = new EntityHeaderSet();
        for (PersistentEntity persistentEntity : collection) {
            entityHeaderSet.add(this.newHeader(persistentEntity));
        }
        return entityHeaderSet;
    }

    @Transactional(readOnly=true)
    public EntityHeaderSet<HT> findAllHeaders(int n2, int n3) {
        List list = (List)this.getHibernateTemplate().execute((HibernateCallback)new bm(this, n2, n3));
        EntityHeaderSet entityHeaderSet = new EntityHeaderSet();
        for (PersistentEntity persistentEntity : list) {
            entityHeaderSet.add(this.newHeader(persistentEntity));
        }
        return entityHeaderSet;
    }

    protected EntityHeaderSet<HT> doFindHeaders(int n2, int n3, Map<String, ?> map, boolean bl2) {
        List list = (List)this.getHibernateTemplate().execute((HibernateCallback)new bn(this, bl2, map, n2, n3));
        EntityHeaderSet entityHeaderSet = new EntityHeaderSet();
        for (PersistentEntity persistentEntity : list) {
            entityHeaderSet.add(this.newHeader(persistentEntity));
        }
        return entityHeaderSet;
    }

    protected Predicate doFindHeaderPredicate(Predicate predicate, CriteriaBuilder criteriaBuilder, Root<ET> root) {
        return predicate;
    }

    protected HT newHeader(ET ET) {
        String string = null;
        if (ET instanceof NamedEntity) {
            string = ((NamedEntity)ET).getName();
        }
        if (string == null) {
            string = "";
        }
        EntityHeader entityHeader = new EntityHeader(ET.getGoid(), this.getEntityType(), string, "", Integer.valueOf(ET.getVersion()));
        if (ET instanceof ZoneableEntity) {
            Goid goid;
            ZoneableEntityHeader zoneableEntityHeader;
            ZoneableEntity zoneableEntity = (ZoneableEntity)ET;
            SecurityZone securityZone = zoneableEntity.getSecurityZone();
            ZoneableEntityHeader zoneableEntityHeader2 = new ZoneableEntityHeader(entityHeader);
            try {
                zoneableEntityHeader = zoneableEntityHeader2;
                goid = securityZone == null ? null : securityZone.getGoid();
            }
            catch (NullPointerException nullPointerException) {
                throw HibernateEntityManager.c(nullPointerException);
            }
            zoneableEntityHeader.setSecurityZoneId(goid);
            entityHeader = zoneableEntityHeader2;
        }
        return (HT)entityHeader;
    }

    protected void addFindAllCriteria(Criteria criteria) {
    }

    protected Predicate addFindAllPredicate(Predicate predicate, CriteriaBuilder criteriaBuilder, Root<ET> root) {
        return predicate;
    }

    @Transactional(readOnly=true)
    public Collection<ET> findAll() throws FindException {
        try {
            return (Collection)this.getHibernateTemplate().execute((HibernateCallback)new bo(this));
        }
        catch (HibernateException hibernateException) {
            throw new FindException(hibernateException.toString(), (Throwable)hibernateException);
        }
    }

    @NotNull
    private TypedQuery<ET> a(@NotNull Session session) {
        Query query;
        try {
            if (session == null) {
                HibernateEntityManager.a(10);
            }
        }
        catch (NullPointerException nullPointerException) {
            throw HibernateEntityManager.c(nullPointerException);
        }
        CriteriaBuilder criteriaBuilder = session.getCriteriaBuilder();
        CriteriaQuery criteriaQuery = criteriaBuilder.createQuery(this.getImpClass());
        Root root = criteriaQuery.from(this.getImpClass());
        try {
            criteriaQuery.select((Selection)root).where((Expression)this.addFindAllPredicate(criteriaBuilder.conjunction(), criteriaBuilder, root));
            query = session.createQuery(criteriaQuery);
            if (query == null) {
                HibernateEntityManager.a(11);
            }
        }
        catch (NullPointerException nullPointerException) {
            throw HibernateEntityManager.c(nullPointerException);
        }
        return query;
    }

    public Collection<ET> findAll(int n2, int n3) throws FindException {
        try {
            return (Collection)this.getHibernateTemplate().execute((HibernateCallback)new bp(this, n2, n3));
        }
        catch (HibernateException hibernateException) {
            throw new FindException(hibernateException.toString(), (Throwable)hibernateException);
        }
    }

    @Transactional(propagation=Propagation.SUPPORTS)
    public String getAllQuery() {
        String string = this.getTableName();
        String[] stringArray = S;
        return stringArray[68] + string + stringArray[70] + this.getImpClass().getName();
    }

    public void delete(Goid goid) throws DeleteException, FindException {
        try {
            this.getHibernateTemplate().execute((HibernateCallback)new ad(this, goid));
        }
        catch (Exception exception) {
            throw new DeleteException(exception.toString(), (Throwable)exception);
        }
    }

    public void delete(ET ET) throws DeleteException {
        try {
            this.getHibernateTemplate().execute((HibernateCallback)new ae(this, (PersistentEntity)ET));
        }
        catch (DataAccessException dataAccessException) {
            throw new DeleteException(S[38], (Throwable)dataAccessException);
        }
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     * Loose catch block
     */
    @Transactional(propagation=Propagation.SUPPORTS)
    public boolean isCacheCurrent(Goid goid, int n2) {
        boolean bl2;
        Lock lock = this.g.readLock();
        try {
            boolean bl3;
            block15: {
                block14: {
                    ao ao2;
                    lock.lock();
                    WeakReference<ao<ET>> weakReference = this.h.get(goid);
                    lock.unlock();
                    lock = null;
                    try {
                        ao2 = weakReference == null ? null : (ao)weakReference.get();
                    }
                    catch (NullPointerException nullPointerException) {
                        throw HibernateEntityManager.c(nullPointerException);
                    }
                    ao ao3 = ao2;
                    if (ao3 == null) break block14;
                    try {
                        block16: {
                            if (ao3.b + (long)n2 < System.currentTimeMillis()) break block14;
                            break block16;
                            catch (NullPointerException nullPointerException) {
                                throw HibernateEntityManager.c(nullPointerException);
                            }
                        }
                        bl3 = true;
                        break block15;
                    }
                    catch (NullPointerException nullPointerException) {
                        throw HibernateEntityManager.c(nullPointerException);
                    }
                }
                bl3 = false;
            }
            bl2 = bl3;
        }
        catch (Throwable throwable) {
            try {
                if (lock != null) {
                    lock.unlock();
                }
            }
            catch (NullPointerException nullPointerException) {
                throw HibernateEntityManager.c(nullPointerException);
            }
            throw throwable;
        }
        try {
            if (lock != null) {
                lock.unlock();
            }
        }
        catch (NullPointerException nullPointerException) {
            throw HibernateEntityManager.c(nullPointerException);
        }
        return bl2;
    }

    /*
     * Loose catch block
     */
    @Transactional(propagation=Propagation.SUPPORTS)
    public ET getCachedEntityByName(String string, int n2) throws FindException {
        Lock lock;
        block22: {
            ao ao2;
            try {
                if (string == null) {
                    throw new NullPointerException();
                }
            }
            catch (RuntimeException runtimeException) {
                throw HibernateEntityManager.c(runtimeException);
            }
            try {
                if (!NamedEntity.class.isAssignableFrom(this.getImpClass())) {
                    throw new IllegalArgumentException(S[71]);
                }
            }
            catch (RuntimeException runtimeException) {
                throw HibernateEntityManager.c(runtimeException);
            }
            lock = this.g.readLock();
            lock.lock();
            WeakReference<ao<ET>> weakReference = this.i.get(string);
            lock.unlock();
            lock = null;
            try {
                ao ao3 = ao2 = weakReference == null ? null : (ao)weakReference.get();
            }
            catch (RuntimeException runtimeException) {
                throw HibernateEntityManager.c(runtimeException);
            }
            if (ao2 == null) break block22;
            ET ET = this.a(ao2, n2);
            try {
                if (lock != null) {
                    lock.unlock();
                }
            }
            catch (RuntimeException runtimeException) {
                throw HibernateEntityManager.c(runtimeException);
            }
            return ET;
        }
        PersistentEntity persistentEntity = (PersistentEntity)new TransactionTemplate(this.transactionManager).execute((TransactionCallback)new af(this, string));
        try {
            if (lock != null) {
                lock.unlock();
            }
        }
        catch (RuntimeException runtimeException) {
            throw HibernateEntityManager.c(runtimeException);
        }
        return (ET)persistentEntity;
        catch (RuntimeException runtimeException) {
            try {
                throw new FindException(ExceptionUtils.getMessage((Throwable)runtimeException), (Throwable)runtimeException);
            }
            catch (Throwable throwable) {
                try {
                    if (lock != null) {
                        lock.unlock();
                    }
                }
                catch (RuntimeException runtimeException2) {
                    throw HibernateEntityManager.c(runtimeException2);
                }
                throw throwable;
            }
        }
    }

    @Transactional(readOnly=true)
    public ET findByUniqueName(String string) throws FindException {
        try {
            if (string == null) {
                throw new NullPointerException();
            }
        }
        catch (HibernateException hibernateException) {
            throw HibernateEntityManager.c((Exception)((Object)hibernateException));
        }
        try {
            if (!NamedEntity.class.isAssignableFrom(this.getImpClass())) {
                throw new IllegalArgumentException(S[82]);
            }
        }
        catch (HibernateException hibernateException) {
            throw HibernateEntityManager.c((Exception)((Object)hibernateException));
        }
        try {
            return (ET)((PersistentEntity)this.getHibernateTemplate().execute((HibernateCallback)new bq(this, string)));
        }
        catch (HibernateException hibernateException) {
            throw new FindException(S[17], (Throwable)hibernateException);
        }
    }

    @Nullable
    protected ET initializeLazilyLoadedUniqueResult(TypedQuery<ET> typedQuery) {
        PersistentEntity persistentEntity = null;
        try {
            persistentEntity = (PersistentEntity)typedQuery.getSingleResult();
        }
        catch (NoResultException noResultException) {
            // empty catch block
        }
        PersistentEntity persistentEntity2 = persistentEntity;
        this.initializeLazilyLoaded(persistentEntity2);
        return (ET)persistentEntity2;
    }

    @Nullable
    protected ET getSingleResult(TypedQuery<ET> typedQuery) {
        try {
            return (ET)((PersistentEntity)typedQuery.getSingleResult());
        }
        catch (NoResultException noResultException) {
            return null;
        }
    }

    protected void addFindByNameCriteria(Criteria criteria) {
    }

    protected Predicate addFindByNamePredicate(Predicate predicate, CriteriaBuilder criteriaBuilder, Root<ET> root) {
        return predicate;
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     */
    @Transactional(propagation=Propagation.SUPPORTS, readOnly=true)
    public ET getCachedEntity(Goid goid, int n2) throws FindException {
        ao ao2;
        Lock lock;
        block18: {
            PersistentEntity persistentEntity;
            block19: {
                ET ET;
                lock = this.g.readLock();
                try {
                    lock.lock();
                    WeakReference<ao<ET>> weakReference = this.h.get(goid);
                    lock.unlock();
                    lock = null;
                    try {
                        ao ao3 = ao2 = weakReference == null ? null : (ao)weakReference.get();
                    }
                    catch (FindException findException) {
                        throw HibernateEntityManager.c((Exception)((Object)findException));
                    }
                    if (ao2 != null) break block18;
                    persistentEntity = (PersistentEntity)new TransactionTemplate(this.transactionManager).execute((TransactionCallback)new ag(this, goid));
                    if (persistentEntity != null) break block19;
                    ET = null;
                }
                catch (Throwable throwable) {
                    try {
                        if (lock != null) {
                            lock.unlock();
                        }
                    }
                    catch (FindException findException) {
                        throw HibernateEntityManager.c((Exception)((Object)findException));
                    }
                    throw throwable;
                }
                try {
                    if (lock != null) {
                        lock.unlock();
                    }
                }
                catch (FindException findException) {
                    throw HibernateEntityManager.c((Exception)((Object)findException));
                }
                return ET;
            }
            PersistentEntity persistentEntity2 = this.checkAndCache(persistentEntity);
            try {
                if (lock != null) {
                    lock.unlock();
                }
            }
            catch (FindException findException) {
                throw HibernateEntityManager.c((Exception)((Object)findException));
            }
            return (ET)persistentEntity2;
        }
        ET ET = this.a(ao2, n2);
        try {
            if (lock != null) {
                lock.unlock();
            }
        }
        catch (FindException findException) {
            throw HibernateEntityManager.c((Exception)((Object)findException));
        }
        return ET;
    }

    private ET a(ao<ET> ao2, int n2) throws FindException {
        if (ao2.b + (long)n2 < System.currentTimeMillis()) {
            Integer n3 = this.getVersion(ao2.a.getGoid());
            try {
                if (n3 == null) {
                    this.cacheRemove((PersistentEntity)ao2.a);
                    return null;
                }
            }
            catch (FindException findException) {
                throw HibernateEntityManager.c((Exception)((Object)findException));
            }
            if (n3 != ao2.c) {
                ET ET;
                ET ET2 = this.findByPrimaryKey(ao2.a.getGoid());
                try {
                    ET = ET2 == null ? null : (ET)this.checkAndCache(ET2);
                }
                catch (FindException findException) {
                    throw HibernateEntityManager.c((Exception)((Object)findException));
                }
                return ET;
            }
        }
        return ao2.a;
    }

    protected void cacheRemove(PersistentEntity persistentEntity) {
        Lock lock = this.g.writeLock();
        lock.lock();
        try {
            this.h.remove(persistentEntity.getGoid());
            if (persistentEntity instanceof NamedEntity) {
                this.i.remove(((NamedEntity)persistentEntity).getName());
            }
            this.removedFromCache(persistentEntity);
        }
        finally {
            lock.unlock();
        }
    }

    protected void removedFromCache(PersistentEntity persistentEntity) {
    }

    protected void addedToCache(PersistentEntity persistentEntity) {
    }

    protected void initializeLazilyLoaded(ET ET) {
    }

    protected final <RT> RT doWithCacheWriteLock(Callable<RT> callable) throws Exception {
        return this.a(this.g.writeLock(), callable);
    }

    protected final <RT> RT doWithCacheReadLock(Callable<RT> callable) throws Exception {
        return this.a(this.g.readLock(), callable);
    }

    /*
     * Enabled force condition propagation
     * Lifted jumps to return sites
     */
    private void a(Object object) {
        block6: {
            try {
                if (this.applicationContext == null || !(object instanceof Entity)) break block6;
            }
            catch (NullPointerException nullPointerException) {
                throw HibernateEntityManager.c(nullPointerException);
            }
            EntityType entityType = EntityType.findTypeByEntity(object.getClass());
            try {
                try {
                    if (entityType == null || !entityType.isAllowSpecificScope()) return;
                }
                catch (NullPointerException nullPointerException) {
                    throw HibernateEntityManager.c(nullPointerException);
                }
                this.applicationContext.publishEvent((ApplicationEvent)new RoleAwareEntityDeletionEvent((Object)this, (Entity)object));
                return;
            }
            catch (NullPointerException nullPointerException) {
                throw HibernateEntityManager.c(nullPointerException);
            }
        }
        this.e.log(Level.WARNING, S[6]);
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     */
    private <RT> RT a(Lock lock, Callable<RT> callable) throws Exception {
        try {
            lock.lock();
            RT RT = callable.call();
            return RT;
        }
        finally {
            lock.unlock();
        }
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     * Enabled aggressive block sorting
     * Enabled unnecessary exception pruning
     * Enabled aggressive exception aggregation
     */
    protected ET checkAndCache(ET ET) throws FindException {
        Object object;
        Goid goid = ET.getGoid();
        ao ao2 = null;
        Lock lock = this.g.readLock();
        try {
            ao ao3;
            lock.lock();
            object = this.h.get(goid);
            try {
                ao3 = object == null ? null : (ao)((Reference)object).get();
            }
            catch (FindException findException) {
                throw HibernateEntityManager.c((Exception)((Object)findException));
            }
            ao2 = ao3;
        }
        catch (Throwable throwable) {
            try {
                if (lock == null) throw throwable;
                lock.unlock();
                throw throwable;
            }
            catch (FindException findException) {
                throw HibernateEntityManager.c((Exception)((Object)findException));
            }
        }
        try {
            if (lock != null) {
                lock.unlock();
            }
        }
        catch (FindException findException) {
            throw HibernateEntityManager.c((Exception)((Object)findException));
        }
        object = this.g.writeLock();
        try {
            object.lock();
            if (ao2 == null) {
                ao2 = new ao();
                WeakReference weakReference = new WeakReference(ao2);
                try {
                    this.h.put(goid, weakReference);
                    if (ET instanceof NamedEntity) {
                        this.i.put(((NamedEntity)ET).getName(), weakReference);
                    }
                }
                catch (FindException findException) {
                    throw HibernateEntityManager.c((Exception)((Object)findException));
                }
            }
            ao2.a = ET;
            ao2.c = ET.getVersion();
            ao2.b = System.currentTimeMillis();
            this.addedToCache((PersistentEntity)ET);
            if (object == null) return ET;
            object.unlock();
            return ET;
        }
        catch (Throwable throwable) {
            try {
                if (object == null) throw throwable;
                object.unlock();
                throw throwable;
            }
            catch (FindException findException) {
                throw HibernateEntityManager.c((Exception)((Object)findException));
            }
        }
    }

    protected ET findByPrimaryKey(Class clazz, Goid goid) throws FindException {
        try {
            return (ET)((PersistentEntity)this.getHibernateTemplate().execute((HibernateCallback)new bs(this, clazz, goid)));
        }
        catch (Exception exception) {
            block6: {
                try {
                    try {
                        if (!ExceptionUtils.causedBy((Throwable)exception, ObjectNotFoundException.class) && !ExceptionUtils.causedBy((Throwable)exception, ObjectDeletedException.class)) break block6;
                    }
                    catch (Exception exception2) {
                        throw HibernateEntityManager.c(exception2);
                    }
                    return null;
                }
                catch (Exception exception3) {
                    throw HibernateEntityManager.c(exception3);
                }
            }
            throw new FindException(S[60], (Throwable)exception);
        }
    }

    protected boolean findAndDelete(Goid goid) throws FindException, DeleteException {
        boolean bl2 = false;
        ET ET = this.findByPrimaryKey(goid);
        if (ET != null) {
            this.delete(ET);
            bl2 = true;
        }
        return bl2;
    }

    protected List<ET> findByPropertyMaybeNull(String string, Object object) throws FindException {
        try {
            return (List)this.getHibernateTemplate().execute((HibernateCallback)new bt(this, object, string));
        }
        catch (DataAccessException dataAccessException) {
            throw new FindException(S[33], (Throwable)dataAccessException);
        }
    }

    protected final <R> R doReadOnlyWork(Functions.UnaryThrows<? extends R, Connection, SQLException> unaryThrows) throws SQLException {
        return (R)this.getHibernateTemplate().execute((HibernateCallback)new bu(this, unaryThrows));
    }

    protected EntityManager.UniqueType getUniqueType() {
        return EntityManager.UniqueType.NAME;
    }

    @Transactional(propagation=Propagation.SUPPORTS)
    public String getTableName() {
        String string = this.j;
        if (string == null) {
            Class clazz = this.getImpClass();
            Table table = clazz.getAnnotation(Table.class);
            try {
                if (table == null) {
                    throw new IllegalStateException(S[29]);
                }
            }
            catch (NullPointerException nullPointerException) {
                throw HibernateEntityManager.c(nullPointerException);
            }
            this.j = string = table.name();
        }
        return string;
    }

    @Transactional(propagation=Propagation.SUPPORTS)
    public Class<? extends Entity> getInterfaceClass() {
        return this.getImpClass();
    }

    public void setTransactionManager(PlatformTransactionManager platformTransactionManager) {
        this.transactionManager = platformTransactionManager;
    }

    @Contract(value="_ -> fail")
    public final <E extends ApplicationEvent> void onApplicationEvent(E e10) {
        throw new UnsupportedOperationException(S[56]);
    }

    /*
     * Unable to fully structure code
     */
    static {
        block12: {
            block11: {
                var5 = new String[85];
                var3_1 = 0;
                var2_2 = " tT/!\u0017,\u0018CBrM\u0007rjiMxJ\u001d=b-fr\u001e\u001a&eeP=\r.Ds\u0003\u0017r1 \u0019{\u0005\u001a6\u0016CLi\u0006\u0017<+t\u0003z\u0003\u001d6,eMh\u0003\u0007;is\u001bCLi\u0006\u0017<+t\u0003z\u0003\u001d6,uMu\u001b\u00067,eMh\u0003\u0007+\u0007sFo\u0019\u001a=bmUM}\b\u001f7,tL<\u001a\u00060`iPtJ!=`ebk\u000b\u00017InWu\u001e\n\u0016ilFh\u0003\u001c<IvFr\u001eS0icBi\u0019\u0016rcbIy\t\u0007res\u0003r\u0005\u0007rmn\u0003Y\u0004\u0007;xy\u0003s\u0018S3|pOu\t\u0012&eoM_\u0005\u001d&ixW<\u0003\u0000rbuOpD\u0006 Vo\u000f\u0017r\u001auPy)\u0006 ~eMh%\u0001\u001d|eMR\u000f\u0004\u0001isPu\u0005\u001d\u0012:\u0003j\u000f\u0001!eoM<\u0007\u001a!aaW\u007f\u0002\u0007vFn\u0019\u001a=b\u001cgFh9\u0016>icWM\u001f\u0016 uWKy\u0018\u0016\u0002~eGu\t\u0012&i\u0012cQy\u000b\u00077JiMx+\u001f>]uFn\u0013\u0004rLs\u001e\u0005FqS'S\u0004sBj\u000f\u0013EQn\u0005\u0001rjiMx\u0003\u001d5,cLi\u0004\u0007\u001bCLi\u0006\u0017<+t\u0003z\u0003\u001d6,uMu\u001b\u00067,eMh\u0003\u0007+>AQ{\u001f\u001e7bt\u0003z\u0005\u0001rLNLh$\u0006>` S}\u0018\u0012?itFnJTw\u007f'\u0003s\fSw\u007f.\u0006oJ\u001e'\u007ft\u0003r\u0005\u0007rne\u0003r\u001f\u001f><CBr\u0004\u001c&,sBj\u000fS3b Fr\u001e\u001a&u Tu\u001e\u001brmn\u0003u\u000eS;b Wt\u000fS isFn\u001c\u00166,rBr\r\u0016|,Ig&J(cLqE\u001fexe@tE\u00007~vFnE;;neQr\u000b\u00077InWu\u001e\n\u001fmnB{\u000f\u0001\f En\u0005\u001er}uFn\u0013R\n jRJ0\u001eMSp<\u0012cQy\u000b\u00077JiMx+\u001f>]uFn\u0013\u0010CLi\u0006\u0017<+t\u0003i\u001a\u00173xe\u0003\r.Ds\u0003\u0017r1 \u0019{\u0005\u001a6\f,\u0003r\u0005\u0007rm ds\u0003\u0017\u001eUMu\u001b\u00067,aWh\u0018\u001a0ytF<\u0007\u0012\",wBoJ\u0016?|tZ\"uMu\u001b\u00067\\rLl\u000f\u0001&uNBq\u000fS1mnMs\u001eS0i Fq\u001a\u0007+%INl\u0006\u0016?inW}\u001e\u001a=b @p\u000b\u0000!,iP<\u0004\u001c&,aMr\u0005\u00073xeG(cLqE\u001fexe@tE\u00007~vFnE;;neQr\u000b\u00077InWu\u001e\n\u001fmnB{\u000f\u0001\u0002\\\r\u0002iG\u0015CLi\u0006\u0017<+t\u0003z\u0003\u001d6,cFn\u001e[!%\u0007SfP/0\u0006,\u0002)\u0003[CBr\u0004\u001c&,sBj\u000fS3b Fr\u001e\u001a&u Tu\u001e\u001brm Pl\u000f\u0010;ji@<#7|,WBoJ\u0006<mbOyJ\u0007=,pQy\u0019\u0016 ze\u0003h\u0002\u0016rinWu\u001e\nrED\u0003z\u0005\u0001rinWu\u001e\nh,\u0007.Ds\u0003\u0017~,\u0016CLi\u0006\u0017<+t\u0003x\u000f\u001f7xe\u0003y\u0004\u0007;xy-cLqD\u001fexe@tD\u00007~vFnD\u001b;neQr\u000b\u00077\"uPy%\u0003&emJf\u000f\u0017\u0011cuMh\u0005 Br\u000eS\u0002iG'OWt\u000f\u0001rinWu\u001e\nrixJo\u001e\u0000r{iWtJ\u0007:i Du\u001c\u0016<,iG&J\u0005FqS'S\u001cgFh9\u0016>icWM\u001f\u0016 uWKy\u0018\u0016\u0002~eGu\t\u0012&i\u0015e[l\u000b\u001d6BePh\u000f\u0017\u0013xtQu\b\u0006&i\u0016GLhJ\u0006<ixSy\t\u00077h Eu\u000f\u001f6\u007f \ffJr\u000e>3xcKu\u0004\u0014\u000eCLi\u0006\u0017<+t\u0003o\u000b\u00057,\u0007SfP/0\u0006,\u000e.Uy\u0018\u0000;cn\u0003Z8<\u001f,\u0002,\u0003\u0004nBq\u000f\u000f Ni\u0019\u0007rne\u0003i\u0004\u001a#ye\u001cSBj\u0003\u001d5,{\u0013aJ[)=}\n<\u001d\u001a&d JxJ\b`q\u0004gLu\u000e\u0095TQ}\u0004\u00003otJs\u0004\u0012>,HJ~\u000f\u0001<mtFY\u0004\u0007;xyn}\u0004\u00125ir\u0003o\u0002\u001c'`d\u0003r\u0005\u0007r`iPh\u000f\u001drxo\u0003}\u001a\u0003>ecBh\u0003\u001c<,eUy\u0004\u0007!,sJr\t\u0016r_pQu\u0004\u0014rxrBr\u0019\u00121xiLrJ\u0012 i Fd\u001a\u0016<\u007fiUyJ\u0012<h @}\u0004S>iaG<\u001e\u001cr|oLnJ\u00037~fLn\u0007\u0012<oe\r\u0004gLu\u000e\n jRJ0\u001eMSp<\u0007 tT/!\u0017,\u0012DBh\u000bS3ocFo\u0019S7~rLnJ\u000e.Uy\u0018\u0000;cn\u0003Z8<\u001f,6CLi\u0006\u0017<+t\u0003z\u0003\u001d6,pQy\u001c\u001a=ys\u0003j\u000f\u0001!eoM<\u001e\u001crohF\u007f\u0001S4cr\u0003j\u000f\u0001!eoMu\u0004\u00145CLi\u0006\u0017<+t\u0003z\u0003\u001d6,pQy\u001c\u001a=ys\u0003j\u000f\u0001!eoM4\u0019Zrxo\u0003\u007f\u0002\u00161g Vr\u0003\u0002'inFo\u0019\u0015NL<9\u0016!\u007fiLr,\u00121xoQeJ\u00007x\u0010SBj\u0003\u001d5,{\u0013aJ[)=}\n]EQn\u0005\u0001r\u007faUu\u0004\u0014rinWu\u001e\nr{iWtJ\u0012r\u007fpF\u007f\u0003\u0015;o jXDS\u0006de\u0003o\u000b\u00057,mFh\u0002\u001c6,sBj\u000f\u0017r{iWtJ\u0012rhiEz\u000f\u00017bt\u0003u\u000e]rIxSy\t\u00077h:\u0003\u0004mBl\u0019\u0005fQs\u0007S\u000eCLi\u0006\u0017<+t\u0003o\u000b\u00057,\n JrJ\u0010>msP<.TKu\u0019S\u001fmnB{\u000f\u0001u\u007f Fr\u001e\u001a&eeP<\u000b\u00017,nLhJ=3aeGY\u0004\u0007;xiFoK>UMu\u001b\u00067XySyJ\u001a!,OwT/!~,bVhJ\u00147xUMu\u001b\u00067OoMo\u001e\u00013enWoBZrboW<\u0005\u00057~rJx\u000e\u0016<\u0006eMh\u0003\u0007+\u0007EMh\u0003\u0007+,5CLi\u0006\u0017<+t\u0003z\u0003\u001d6,pQy\u001c\u001a=ys\u0003j\u000f\u0001!eoM4\u0019Zrxo\u0003\u007f\u0002\u00161g Vr\u0003\u0002'inFo\u0019\u0012PQu\u0007\u0012 u Hy\u0013S%ms\u0003}J\n.\u0003Y\u0004\u0007;xy\u0019<\"uMu\u001b\u00067\\rLl\u000f\u0001&uNBq\u000fS1mnMs\u001eS0i Fq\u001a\u0007+\u0016EQn\u0005\u0001rjiMx\u0003\u001d5,eMh\u0003\u0007;is\u0004nBq\u000f3UMu\u001b\u00067XySyJ\u001a!,NbQ/_rnuW<\u000f\u001d&etZ<\u0003\u0000rboW<\u000bS\u001cmmFx/\u001d&etZ.TKu\u0019S\u001fmnB{\u000f\u0001u\u007f Fr\u001e\u001a&eeP<\u000b\u00017,nLhJ=3aeGY\u0004\u0007;xiFoK";
                var4_3 = " tT/!\u0017,\u0018CBrM\u0007rjiMxJ\u001d=b-fr\u001e\u001a&eeP=\r.Ds\u0003\u0017r1 \u0019{\u0005\u001a6\u0016CLi\u0006\u0017<+t\u0003z\u0003\u001d6,eMh\u0003\u0007;is\u001bCLi\u0006\u0017<+t\u0003z\u0003\u001d6,uMu\u001b\u00067,eMh\u0003\u0007+\u0007sFo\u0019\u001a=bmUM}\b\u001f7,tL<\u001a\u00060`iPtJ!=`ebk\u000b\u00017InWu\u001e\n\u0016ilFh\u0003\u001c<IvFr\u001eS0icBi\u0019\u0016rcbIy\t\u0007res\u0003r\u0005\u0007rmn\u0003Y\u0004\u0007;xy\u0003s\u0018S3|pOu\t\u0012&eoM_\u0005\u001d&ixW<\u0003\u0000rbuOpD\u0006 Vo\u000f\u0017r\u001auPy)\u0006 ~eMh%\u0001\u001d|eMR\u000f\u0004\u0001isPu\u0005\u001d\u0012:\u0003j\u000f\u0001!eoM<\u0007\u001a!aaW\u007f\u0002\u0007vFn\u0019\u001a=b\u001cgFh9\u0016>icWM\u001f\u0016 uWKy\u0018\u0016\u0002~eGu\t\u0012&i\u0012cQy\u000b\u00077JiMx+\u001f>]uFn\u0013\u0004rLs\u001e\u0005FqS'S\u0004sBj\u000f\u0013EQn\u0005\u0001rjiMx\u0003\u001d5,cLi\u0004\u0007\u001bCLi\u0006\u0017<+t\u0003z\u0003\u001d6,uMu\u001b\u00067,eMh\u0003\u0007+>AQ{\u001f\u001e7bt\u0003z\u0005\u0001rLNLh$\u0006>` S}\u0018\u0012?itFnJTw\u007f'\u0003s\fSw\u007f.\u0006oJ\u001e'\u007ft\u0003r\u0005\u0007rne\u0003r\u001f\u001f><CBr\u0004\u001c&,sBj\u000fS3b Fr\u001e\u001a&u Tu\u001e\u001brmn\u0003u\u000eS;b Wt\u000fS isFn\u001c\u00166,rBr\r\u0016|,Ig&J(cLqE\u001fexe@tE\u00007~vFnE;;neQr\u000b\u00077InWu\u001e\n\u001fmnB{\u000f\u0001\f En\u0005\u001er}uFn\u0013R\n jRJ0\u001eMSp<\u0012cQy\u000b\u00077JiMx+\u001f>]uFn\u0013\u0010CLi\u0006\u0017<+t\u0003i\u001a\u00173xe\u0003\r.Ds\u0003\u0017r1 \u0019{\u0005\u001a6\f,\u0003r\u0005\u0007rm ds\u0003\u0017\u001eUMu\u001b\u00067,aWh\u0018\u001a0ytF<\u0007\u0012\",wBoJ\u0016?|tZ\"uMu\u001b\u00067\\rLl\u000f\u0001&uNBq\u000fS1mnMs\u001eS0i Fq\u001a\u0007+%INl\u0006\u0016?inW}\u001e\u001a=b @p\u000b\u0000!,iP<\u0004\u001c&,aMr\u0005\u00073xeG(cLqE\u001fexe@tE\u00007~vFnE;;neQr\u000b\u00077InWu\u001e\n\u001fmnB{\u000f\u0001\u0002\\\r\u0002iG\u0015CLi\u0006\u0017<+t\u0003z\u0003\u001d6,cFn\u001e[!%\u0007SfP/0\u0006,\u0002)\u0003[CBr\u0004\u001c&,sBj\u000fS3b Fr\u001e\u001a&u Tu\u001e\u001brm Pl\u000f\u0010;ji@<#7|,WBoJ\u0006<mbOyJ\u0007=,pQy\u0019\u0016 ze\u0003h\u0002\u0016rinWu\u001e\nrED\u0003z\u0005\u0001rinWu\u001e\nh,\u0007.Ds\u0003\u0017~,\u0016CLi\u0006\u0017<+t\u0003x\u000f\u001f7xe\u0003y\u0004\u0007;xy-cLqD\u001fexe@tD\u00007~vFnD\u001b;neQr\u000b\u00077\"uPy%\u0003&emJf\u000f\u0017\u0011cuMh\u0005 Br\u000eS\u0002iG'OWt\u000f\u0001rinWu\u001e\nrixJo\u001e\u0000r{iWtJ\u0007:i Du\u001c\u0016<,iG&J\u0005FqS'S\u001cgFh9\u0016>icWM\u001f\u0016 uWKy\u0018\u0016\u0002~eGu\t\u0012&i\u0015e[l\u000b\u001d6BePh\u000f\u0017\u0013xtQu\b\u0006&i\u0016GLhJ\u0006<ixSy\t\u00077h Eu\u000f\u001f6\u007f \ffJr\u000e>3xcKu\u0004\u0014\u000eCLi\u0006\u0017<+t\u0003o\u000b\u00057,\u0007SfP/0\u0006,\u000e.Uy\u0018\u0000;cn\u0003Z8<\u001f,\u0002,\u0003\u0004nBq\u000f\u000f Ni\u0019\u0007rne\u0003i\u0004\u001a#ye\u001cSBj\u0003\u001d5,{\u0013aJ[)=}\n<\u001d\u001a&d JxJ\b`q\u0004gLu\u000e\u0095TQ}\u0004\u00003otJs\u0004\u0012>,HJ~\u000f\u0001<mtFY\u0004\u0007;xyn}\u0004\u00125ir\u0003o\u0002\u001c'`d\u0003r\u0005\u0007r`iPh\u000f\u001drxo\u0003}\u001a\u0003>ecBh\u0003\u001c<,eUy\u0004\u0007!,sJr\t\u0016r_pQu\u0004\u0014rxrBr\u0019\u00121xiLrJ\u0012 i Fd\u001a\u0016<\u007fiUyJ\u0012<h @}\u0004S>iaG<\u001e\u001cr|oLnJ\u00037~fLn\u0007\u0012<oe\r\u0004gLu\u000e\n jRJ0\u001eMSp<\u0007 tT/!\u0017,\u0012DBh\u000bS3ocFo\u0019S7~rLnJ\u000e.Uy\u0018\u0000;cn\u0003Z8<\u001f,6CLi\u0006\u0017<+t\u0003z\u0003\u001d6,pQy\u001c\u001a=ys\u0003j\u000f\u0001!eoM<\u001e\u001crohF\u007f\u0001S4cr\u0003j\u000f\u0001!eoMu\u0004\u00145CLi\u0006\u0017<+t\u0003z\u0003\u001d6,pQy\u001c\u001a=ys\u0003j\u000f\u0001!eoM4\u0019Zrxo\u0003\u007f\u0002\u00161g Vr\u0003\u0002'inFo\u0019\u0015NL<9\u0016!\u007fiLr,\u00121xoQeJ\u00007x\u0010SBj\u0003\u001d5,{\u0013aJ[)=}\n]EQn\u0005\u0001r\u007faUu\u0004\u0014rinWu\u001e\nr{iWtJ\u0012r\u007fpF\u007f\u0003\u0015;o jXDS\u0006de\u0003o\u000b\u00057,mFh\u0002\u001c6,sBj\u000f\u0017r{iWtJ\u0012rhiEz\u000f\u00017bt\u0003u\u000e]rIxSy\t\u00077h:\u0003\u0004mBl\u0019\u0005fQs\u0007S\u000eCLi\u0006\u0017<+t\u0003o\u000b\u00057,\n JrJ\u0010>msP<.TKu\u0019S\u001fmnB{\u000f\u0001u\u007f Fr\u001e\u001a&eeP<\u000b\u00017,nLhJ=3aeGY\u0004\u0007;xiFoK>UMu\u001b\u00067XySyJ\u001a!,OwT/!~,bVhJ\u00147xUMu\u001b\u00067OoMo\u001e\u00013enWoBZrboW<\u0005\u00057~rJx\u000e\u0016<\u0006eMh\u0003\u0007+\u0007EMh\u0003\u0007+,5CLi\u0006\u0017<+t\u0003z\u0003\u001d6,pQy\u001c\u001a=ys\u0003j\u000f\u0001!eoM4\u0019Zrxo\u0003\u007f\u0002\u00161g Vr\u0003\u0002'inFo\u0019\u0012PQu\u0007\u0012 u Hy\u0013S%ms\u0003}J\n.\u0003Y\u0004\u0007;xy\u0019<\"uMu\u001b\u00067\\rLl\u000f\u0001&uNBq\u000fS1mnMs\u001eS0i Fq\u001a\u0007+\u0016EQn\u0005\u0001rjiMx\u0003\u001d5,eMh\u0003\u0007;is\u0004nBq\u000f3UMu\u001b\u00067XySyJ\u001a!,NbQ/_rnuW<\u000f\u001d&etZ<\u0003\u0000rboW<\u000bS\u001cmmFx/\u001d&etZ.TKu\u0019S\u001fmnB{\u000f\u0001u\u007f Fr\u001e\u001a&eeP<\u000b\u00017,nLhJ=3aeGY\u0004\u0007;xiFoK".length();
                var1_4 = 7;
                var0_5 = -1;
lbl7:
                // 2 sources

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

                while (true) {
                    var5[var3_1++] = HibernateEntityManager.a(v0, HibernateEntityManager.c(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "~SM \u0003\u0019^R=O19\u0004]Z=\u0007'cIA\u001epW'9L\\Qi\u0002&(\u0018GLs\u0002:8\u0000^\u0019}rW8)\u0002\u0015J=A<(\u000fY\u001ehL=<\u0019WPxQ'";
                    var4_3 = "~SM \u0003\u0019^R=O19\u0004]Z=\u0007'cIA\u001epW'9L\\Qi\u0002&(\u0018GLs\u0002:8\u0000^\u0019}rW8)\u0002\u0015J=A<(\u000fY\u001ehL=<\u0019WPxQ'".length();
                    var1_4 = 42;
                    var0_5 = -1;
lbl22:
                    // 2 sources

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

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

                ** continue;
            }
        }
        HibernateEntityManager.S = var5;
        HibernateEntityManager.F_GOID = HibernateEntityManager.S[57];
        HibernateEntityManager.F_NAME = HibernateEntityManager.S[52];
        HibernateEntityManager.F_VERSION = HibernateEntityManager.S[10];
        try {
            v5 = HibernateEntityManager.class.desiredAssertionStatus() == false;
        }
        catch (NullPointerException v6) {
            throw HibernateEntityManager.c(v6);
        }
        HibernateEntityManager.l = v5;
        HibernateEntityManager.NULL = new Object();
        HibernateEntityManager.NOTNULL = new Object();
        HibernateEntityManager.f = ConfigFactory.getBooleanProperty((String)HibernateEntityManager.S[39], (boolean)true);
    }

    /*
     * Exception decompiling
     */
    private static /* synthetic */ void a(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 c(Exception exception) {
        return exception;
    }

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

    /*
     * Handled impossible loop by duplicating code
     * Enabled aggressive block sorting
     */
    private static String a(int n2, char[] cArray) {
        char[] cArray2;
        block11: {
            int n3;
            int n4;
            int n5;
            block10: {
                n5 = n2;
                cArray2 = cArray;
                n4 = cArray.length;
                n3 = 0;
                if (!true) break block10;
                n4 = n4;
                if (n4 <= n3) break block11;
            }
            do {
                n5 = n5;
                cArray2 = cArray2;
                int n6 = n3;
                cArray2[n6] = (char)(cArray2[n6] ^ (n5 ^ (switch (n3 % 7) {
                    case 0 -> 33;
                    case 1 -> 2;
                    case 2 -> 61;
                    case 3 -> 75;
                    case 4 -> 82;
                    case 5 -> 115;
                    default -> 45;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

