/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.audit.AuditRecord
 *  com.l7tech.gateway.common.cluster.ClusterProperty
 *  com.l7tech.gateway.common.jdbc.JdbcConnection
 *  com.l7tech.gateway.common.resources.ResourceEntryHeader
 *  com.l7tech.gateway.common.security.keystore.SsgKeyEntry
 *  com.l7tech.gateway.common.security.password.SecurePassword
 *  com.l7tech.gateway.common.security.rbac.Permission
 *  com.l7tech.gateway.common.security.rbac.Role
 *  com.l7tech.gateway.common.security.rbac.Role$Tag
 *  com.l7tech.gateway.common.service.PublishedService
 *  com.l7tech.gateway.common.service.PublishedService$SoapValidationGroup
 *  com.l7tech.gateway.common.service.PublishedServiceAlias
 *  com.l7tech.gateway.common.service.ServiceDocument
 *  com.l7tech.gateway.common.service.ServiceHeader
 *  com.l7tech.gateway.common.task.ScheduledTask
 *  com.l7tech.gateway.common.transport.InterfaceTag
 *  com.l7tech.gateway.common.transport.jms.JmsConnection
 *  com.l7tech.gateway.common.transport.jms.JmsConnection$StandardValidationGroup
 *  com.l7tech.gateway.common.transport.jms.JmsEndpoint
 *  com.l7tech.gateway.common.transport.jms.JmsEndpoint$StandardValidationGroup
 *  com.l7tech.identity.User
 *  com.l7tech.identity.UserBean
 *  com.l7tech.identity.cert.ClientCertManager
 *  com.l7tech.identity.internal.InternalUser
 *  com.l7tech.objectmodel.Alias
 *  com.l7tech.objectmodel.ConstraintViolationException
 *  com.l7tech.objectmodel.DeleteException
 *  com.l7tech.objectmodel.DuplicateObjectException
 *  com.l7tech.objectmodel.Entity
 *  com.l7tech.objectmodel.EntityHeader
 *  com.l7tech.objectmodel.EntityType
 *  com.l7tech.objectmodel.FindException
 *  com.l7tech.objectmodel.Goid
 *  com.l7tech.objectmodel.GuidEntity
 *  com.l7tech.objectmodel.GuidEntityHeader
 *  com.l7tech.objectmodel.NameableEntity
 *  com.l7tech.objectmodel.ObjectModelException
 *  com.l7tech.objectmodel.OrganizationHeader
 *  com.l7tech.objectmodel.PersistentEntity
 *  com.l7tech.objectmodel.SaveException
 *  com.l7tech.objectmodel.UpdateException
 *  com.l7tech.objectmodel.encass.EncapsulatedAssertionConfig
 *  com.l7tech.objectmodel.folder.Folder
 *  com.l7tech.objectmodel.folder.HasFolder
 *  com.l7tech.objectmodel.folder.HasFolderId
 *  com.l7tech.objectmodel.polback.PolicyBackedService
 *  com.l7tech.objectmodel.polback.PolicyBackedServiceOperation
 *  com.l7tech.policy.Policy
 *  com.l7tech.policy.Policy$GlobalPolicyValidationGroup
 *  com.l7tech.policy.PolicyType
 *  com.l7tech.util.Either
 *  com.l7tech.util.Eithers
 *  com.l7tech.util.ExceptionUtils
 *  com.l7tech.util.Functions
 *  com.l7tech.util.Functions$Unary
 *  com.l7tech.util.Option
 *  com.l7tech.util.PathUtils
 *  com.l7tech.util.Triple
 *  jakarta.inject.Inject
 *  javax.validation.ConstraintViolation
 *  javax.validation.Validation
 *  javax.validation.Validator
 *  javax.validation.groups.Default
 *  org.apache.commons.lang3.StringUtils
 *  org.hibernate.exception.ConstraintViolationException
 *  org.jetbrains.annotations.NotNull
 *  org.jetbrains.annotations.Nullable
 *  org.springframework.dao.DataIntegrityViolationException
 *  org.springframework.transaction.PlatformTransactionManager
 *  org.springframework.transaction.TransactionStatus
 *  org.springframework.transaction.support.TransactionCallback
 *  org.springframework.transaction.support.TransactionTemplate
 */
package com.l7tech.server.bundling;

import com.l7tech.gateway.common.audit.AuditRecord;
import com.l7tech.gateway.common.cluster.ClusterProperty;
import com.l7tech.gateway.common.jdbc.JdbcConnection;
import com.l7tech.gateway.common.resources.ResourceEntryHeader;
import com.l7tech.gateway.common.security.keystore.SsgKeyEntry;
import com.l7tech.gateway.common.security.password.SecurePassword;
import com.l7tech.gateway.common.security.rbac.Permission;
import com.l7tech.gateway.common.security.rbac.Role;
import com.l7tech.gateway.common.service.PublishedService;
import com.l7tech.gateway.common.service.PublishedServiceAlias;
import com.l7tech.gateway.common.service.ServiceDocument;
import com.l7tech.gateway.common.service.ServiceHeader;
import com.l7tech.gateway.common.task.ScheduledTask;
import com.l7tech.gateway.common.transport.InterfaceTag;
import com.l7tech.gateway.common.transport.jms.JmsConnection;
import com.l7tech.gateway.common.transport.jms.JmsEndpoint;
import com.l7tech.identity.User;
import com.l7tech.identity.UserBean;
import com.l7tech.identity.cert.ClientCertManager;
import com.l7tech.identity.internal.InternalUser;
import com.l7tech.objectmodel.Alias;
import com.l7tech.objectmodel.ConstraintViolationException;
import com.l7tech.objectmodel.DeleteException;
import com.l7tech.objectmodel.DuplicateObjectException;
import com.l7tech.objectmodel.Entity;
import com.l7tech.objectmodel.EntityHeader;
import com.l7tech.objectmodel.EntityType;
import com.l7tech.objectmodel.FindException;
import com.l7tech.objectmodel.Goid;
import com.l7tech.objectmodel.GuidEntity;
import com.l7tech.objectmodel.GuidEntityHeader;
import com.l7tech.objectmodel.NameableEntity;
import com.l7tech.objectmodel.ObjectModelException;
import com.l7tech.objectmodel.OrganizationHeader;
import com.l7tech.objectmodel.PersistentEntity;
import com.l7tech.objectmodel.SaveException;
import com.l7tech.objectmodel.UpdateException;
import com.l7tech.objectmodel.encass.EncapsulatedAssertionConfig;
import com.l7tech.objectmodel.folder.Folder;
import com.l7tech.objectmodel.folder.HasFolder;
import com.l7tech.objectmodel.folder.HasFolderId;
import com.l7tech.objectmodel.polback.PolicyBackedService;
import com.l7tech.objectmodel.polback.PolicyBackedServiceOperation;
import com.l7tech.policy.Policy;
import com.l7tech.policy.PolicyType;
import com.l7tech.server.EntityCrud;
import com.l7tech.server.EntityHeaderUtils;
import com.l7tech.server.audit.AuditContextFactory;
import com.l7tech.server.audit.AuditContextUtils;
import com.l7tech.server.audit.AuditsCollector;
import com.l7tech.server.bundling.EntityBundle;
import com.l7tech.server.bundling.EntityBundleImporter;
import com.l7tech.server.bundling.EntityContainer;
import com.l7tech.server.bundling.EntityMappingInstructions;
import com.l7tech.server.bundling.EntityMappingResult;
import com.l7tech.server.bundling.JmsContainer;
import com.l7tech.server.bundling.PublishedServiceContainer;
import com.l7tech.server.bundling.UserContainer;
import com.l7tech.server.bundling.c;
import com.l7tech.server.bundling.d;
import com.l7tech.server.bundling.e;
import com.l7tech.server.bundling.exceptions.BundleImportException;
import com.l7tech.server.bundling.exceptions.IncorrectMappingInstructionsException;
import com.l7tech.server.bundling.f;
import com.l7tech.server.bundling.g;
import com.l7tech.server.bundling.h;
import com.l7tech.server.bundling.j;
import com.l7tech.server.bundling.k;
import com.l7tech.server.bundling.n;
import com.l7tech.server.bundling.r;
import com.l7tech.server.bundling.s;
import com.l7tech.server.bundling.t;
import com.l7tech.server.cluster.ClusterPropertyManager;
import com.l7tech.server.folder.FolderManager;
import com.l7tech.server.identity.IdentityProviderFactory;
import com.l7tech.server.module.ServerModuleFileManager;
import com.l7tech.server.policy.PolicyAliasManager;
import com.l7tech.server.policy.PolicyCache;
import com.l7tech.server.policy.PolicyManager;
import com.l7tech.server.policy.PolicyVersionManager;
import com.l7tech.server.search.DependencyAnalyzer;
import com.l7tech.server.search.exceptions.CannotReplaceDependenciesException;
import com.l7tech.server.search.processors.DependencyProcessorUtils;
import com.l7tech.server.security.PasswordEnforcerManager;
import com.l7tech.server.security.keystore.SsgKeyFinder;
import com.l7tech.server.security.keystore.SsgKeyStore;
import com.l7tech.server.security.keystore.SsgKeyStoreManager;
import com.l7tech.server.security.rbac.ProtectedEntityTracker;
import com.l7tech.server.security.rbac.RoleManager;
import com.l7tech.server.service.ServiceAliasManager;
import com.l7tech.server.service.ServiceManager;
import com.l7tech.util.Either;
import com.l7tech.util.Eithers;
import com.l7tech.util.ExceptionUtils;
import com.l7tech.util.Functions;
import com.l7tech.util.Option;
import com.l7tech.util.PathUtils;
import com.l7tech.util.Triple;
import jakarta.inject.Inject;
import java.io.Serializable;
import java.security.KeyStoreException;
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.groups.Default;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.TransactionCallback;
import org.springframework.transaction.support.TransactionTemplate;

/*
 * Exception performing whole class analysis ignored.
 */
public class EntityBundleImporterImpl
implements EntityBundleImporter {
    private static final Logger a;
    private static final String b;
    private final Validator c = Validation.buildDefaultValidatorFactory().getValidator();
    @Inject
    private PlatformTransactionManager transactionManager;
    @Inject
    private DependencyAnalyzer dependencyAnalyzer;
    @Inject
    private EntityCrud entityCrud;
    @Inject
    private IdentityProviderFactory identityProviderFactory;
    @Inject
    private PolicyManager policyManager;
    @Inject
    private ServiceManager serviceManager;
    @Inject
    private FolderManager folderManager;
    @Inject
    private RoleManager roleManager;
    @Inject
    private PolicyVersionManager policyVersionManager;
    @Inject
    private AuditContextFactory auditContextFactory;
    @Inject
    private SsgKeyStoreManager keyStoreManager;
    @Inject
    private SsgKeyStoreManager ssgKeyStoreManager;
    @Inject
    private ServiceAliasManager serviceAliasManager;
    @Inject
    private PolicyAliasManager policyAliasManager;
    @Inject
    private ClusterPropertyManager clusterPropertyManager;
    @Inject
    private ClientCertManager clientCertManager;
    @Inject
    private PolicyCache policyCache;
    @Inject
    private ServerModuleFileManager serverModuleFileManager;
    @Inject
    private ProtectedEntityTracker protectedEntityTracker;
    @Inject
    private PasswordEnforcerManager passwordEnforcerManager;
    private static final String[] d;

    @Override
    @NotNull
    public List<List<EntityMappingResult>> importBundles(@NotNull List<EntityBundle> list, boolean bl2, boolean bl3, boolean bl4, @Nullable String string) {
        List<List<EntityMappingResult>> list2;
        String[] stringArray;
        block21: {
            String string2;
            block20: {
                String string3;
                block19: {
                    block18: {
                        try {
                            if (list == null) {
                                EntityBundleImporterImpl.a(0);
                            }
                        }
                        catch (IllegalStateException illegalStateException) {
                            throw EntityBundleImporterImpl.a(illegalStateException);
                        }
                        try {
                            if (list.size() > 1) break block18;
                            string3 = "!";
                            break block19;
                        }
                        catch (IllegalStateException illegalStateException) {
                            throw EntityBundleImporterImpl.a(illegalStateException);
                        }
                    }
                    stringArray = d;
                    string3 = stringArray[0];
                }
                string2 = string3;
                try {
                    if (bl2) break block20;
                    a.log(Level.INFO, d[116] + string2);
                    break block21;
                }
                catch (IllegalStateException illegalStateException) {
                    throw EntityBundleImporterImpl.a(illegalStateException);
                }
            }
            stringArray = d;
            a.log(Level.FINE, stringArray[114] + string2);
        }
        AuditsCollector auditsCollector = new AuditsCollector();
        List<List<EntityMappingResult>> list3 = AuditContextUtils.doWithAuditsCollector(auditsCollector, new c(this, list, bl2, bl3, bl4, string));
        if (!bl2) {
            for (int i2 = 0; i2 < list3.size(); ++i2) {
                Object object;
                int n2;
                int n3;
                List<EntityMappingResult> list4;
                block23: {
                    String string4;
                    block22: {
                        list4 = list3.get(i2);
                        string4 = list.get(i2).getBundleName();
                        try {
                            n3 = i2 + 1;
                            n2 = list3.size();
                            if (!StringUtils.isBlank((CharSequence)string4)) break block22;
                            object = "";
                            break block23;
                        }
                        catch (IllegalStateException illegalStateException) {
                            throw EntityBundleImporterImpl.a(illegalStateException);
                        }
                    }
                    stringArray = d;
                    object = stringArray[3] + string4 + "'";
                }
                String string5 = object;
                int n4 = n2;
                int n5 = n3;
                stringArray = d;
                String string6 = stringArray[68] + n5 + "/" + n4 + ")" + string5;
                try {
                    if (this.a(list4)) {
                        a.log(Level.INFO, stringArray[1] + string6);
                        continue;
                    }
                }
                catch (IllegalStateException illegalStateException) {
                    throw EntityBundleImporterImpl.a(illegalStateException);
                }
                for (Triple triple : auditsCollector) {
                    this.auditContextFactory.emitAuditRecordWithDetails((AuditRecord)triple.left, false, triple.middle, (Collection)triple.right);
                }
                stringArray = d;
                a.log(Level.INFO, stringArray[30] + string6 + stringArray[83]);
            }
        }
        try {
            list2 = list3;
            if (list2 == null) {
                EntityBundleImporterImpl.a(1);
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw EntityBundleImporterImpl.a(illegalStateException);
        }
        return list2;
    }

    @NotNull
    public List<EntityMappingResult> importBundle(@NotNull EntityBundle entityBundle, boolean bl2, boolean bl3, boolean bl4, @Nullable String string) {
        ArrayList<EntityMappingResult> arrayList;
        ArrayList<EntityMappingResult> arrayList2;
        block11: {
            List<List<EntityMappingResult>> list;
            block10: {
                try {
                    if (entityBundle == null) {
                        EntityBundleImporterImpl.a(2);
                    }
                }
                catch (IllegalStateException illegalStateException) {
                    throw EntityBundleImporterImpl.a(illegalStateException);
                }
                list = this.importBundles(Arrays.asList(entityBundle), bl2, bl3, bl4, string);
                try {
                    try {
                        if (list != null && !list.isEmpty()) break block10;
                    }
                    catch (IllegalStateException illegalStateException) {
                        throw EntityBundleImporterImpl.a(illegalStateException);
                    }
                    arrayList2 = new ArrayList(0);
                    break block11;
                }
                catch (IllegalStateException illegalStateException) {
                    throw EntityBundleImporterImpl.a(illegalStateException);
                }
            }
            arrayList2 = list.get(0);
        }
        try {
            arrayList = arrayList2;
            if (arrayList2 == null) {
                EntityBundleImporterImpl.a(3);
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw EntityBundleImporterImpl.a(illegalStateException);
        }
        return arrayList;
    }

    private boolean a(List<EntityMappingResult> list) {
        return Functions.exists(list, (Functions.Unary)new j(this));
    }

    @NotNull
    private List<List<EntityMappingResult>> a(@NotNull List<EntityBundle> list, boolean bl2, boolean bl3, boolean bl4, @Nullable String string) {
        List list2;
        try {
            if (list == null) {
                EntityBundleImporterImpl.a(4);
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw EntityBundleImporterImpl.a(illegalStateException);
        }
        TransactionTemplate transactionTemplate = new TransactionTemplate(this.transactionManager);
        try {
            transactionTemplate.setReadOnly(false);
            list2 = (List)transactionTemplate.execute((TransactionCallback)new k(this, list, bl2, bl3, bl4, string));
            if (list2 == null) {
                EntityBundleImporterImpl.a(5);
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw EntityBundleImporterImpl.a(illegalStateException);
        }
        return list2;
    }

    /*
     * Exception decompiling
     */
    @NotNull
    private List<EntityMappingResult> a(@NotNull TransactionStatus var1_1, @NotNull EntityBundle var2_2, boolean var3_3, boolean var4_4, boolean var5_5, @Nullable String var6_6, @NotNull Set<Goid> var7_7) {
        /*
         * 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 [40[CASE]], but top level block is 20[TRYBLOCK]
         *     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");
    }

    private boolean a(@NotNull Entity entity) {
        boolean bl2;
        block10: {
            block9: {
                try {
                    if (entity == null) {
                        EntityBundleImporterImpl.a(10);
                    }
                }
                catch (IllegalStateException illegalStateException) {
                    throw EntityBundleImporterImpl.a(illegalStateException);
                }
                try {
                    try {
                        try {
                            if (this.protectedEntityTracker == null || !this.protectedEntityTracker.isEntityProtectionEnabled()) break block9;
                        }
                        catch (IllegalStateException illegalStateException) {
                            throw EntityBundleImporterImpl.a(illegalStateException);
                        }
                        if (!this.protectedEntityTracker.isReadOnlyEntity(entity)) break block9;
                    }
                    catch (IllegalStateException illegalStateException) {
                        throw EntityBundleImporterImpl.a(illegalStateException);
                    }
                    bl2 = true;
                    break block10;
                }
                catch (IllegalStateException illegalStateException) {
                    throw EntityBundleImporterImpl.a(illegalStateException);
                }
            }
            bl2 = false;
        }
        return bl2;
    }

    @Nullable
    private EntityContainer a(@NotNull EntityMappingInstructions entityMappingInstructions, @NotNull EntityBundle entityBundle) {
        EntityContainer entityContainer;
        try {
            if (entityMappingInstructions == null) {
                EntityBundleImporterImpl.a(11);
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw EntityBundleImporterImpl.a(illegalStateException);
        }
        try {
            if (entityBundle == null) {
                EntityBundleImporterImpl.a(12);
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw EntityBundleImporterImpl.a(illegalStateException);
        }
        String string = EntityType.ASSERTION_ACCESS.equals((Object)entityMappingInstructions.getSourceEntityHeader().getType()) ? entityMappingInstructions.getSourceEntityHeader().getName() : entityMappingInstructions.getSourceEntityHeader().getStrId();
        try {
            entityContainer = string == null ? null : entityBundle.getEntity(string, entityMappingInstructions.getSourceEntityHeader().getType());
        }
        catch (IllegalStateException illegalStateException) {
            throw EntityBundleImporterImpl.a(illegalStateException);
        }
        return entityContainer;
    }

    private EntityHeader a(@NotNull Entity entity, @NotNull EntityMappingInstructions entityMappingInstructions, @NotNull Map<EntityHeader, Callable<String>> map, @NotNull Set<Goid> set) throws IncorrectMappingInstructionsException, DeleteException {
        try {
            if (entity == null) {
                EntityBundleImporterImpl.a(13);
            }
        }
        catch (IncorrectMappingInstructionsException incorrectMappingInstructionsException) {
            throw EntityBundleImporterImpl.a(incorrectMappingInstructionsException);
        }
        try {
            if (entityMappingInstructions == null) {
                EntityBundleImporterImpl.a(14);
            }
        }
        catch (IncorrectMappingInstructionsException incorrectMappingInstructionsException) {
            throw EntityBundleImporterImpl.a(incorrectMappingInstructionsException);
        }
        try {
            if (map == null) {
                EntityBundleImporterImpl.a(15);
            }
        }
        catch (IncorrectMappingInstructionsException incorrectMappingInstructionsException) {
            throw EntityBundleImporterImpl.a(incorrectMappingInstructionsException);
        }
        try {
            if (set == null) {
                EntityBundleImporterImpl.a(16);
            }
        }
        catch (IncorrectMappingInstructionsException incorrectMappingInstructionsException) {
            throw EntityBundleImporterImpl.a(incorrectMappingInstructionsException);
        }
        TransactionTemplate transactionTemplate = new TransactionTemplate(this.transactionManager);
        transactionTemplate.setReadOnly(false);
        Either either = (Either)transactionTemplate.execute((TransactionCallback)new n(this, entity, map, entityMappingInstructions, set));
        try {
            if (either.isRight()) {
                return (EntityHeader)either.right();
            }
        }
        catch (IncorrectMappingInstructionsException incorrectMappingInstructionsException) {
            throw EntityBundleImporterImpl.a(incorrectMappingInstructionsException);
        }
        try {
            if (((Either)either.left()).isLeft()) {
                throw (DeleteException)((Object)((Either)either.left()).left());
            }
        }
        catch (IncorrectMappingInstructionsException incorrectMappingInstructionsException) {
            throw EntityBundleImporterImpl.a(incorrectMappingInstructionsException);
        }
        throw (IncorrectMappingInstructionsException)((Either)either.left()).right();
    }

    private void a(@NotNull List<EntityMappingResult> list, @NotNull Map<EntityHeader, EntityHeader> map) {
        try {
            if (list == null) {
                EntityBundleImporterImpl.a(17);
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw EntityBundleImporterImpl.a(illegalStateException);
        }
        try {
            if (map == null) {
                EntityBundleImporterImpl.a(18);
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw EntityBundleImporterImpl.a(illegalStateException);
        }
        for (EntityMappingResult entityMappingResult : list) {
            try {
                block17: {
                    try {
                        try {
                            try {
                                if (entityMappingResult.getTargetEntityHeader() == null || !entityMappingResult.isSuccessful()) continue;
                            }
                            catch (IllegalStateException illegalStateException) {
                                throw EntityBundleImporterImpl.a(illegalStateException);
                            }
                            if (EntityMappingResult.MappingAction.UpdatedExisting.equals((Object)entityMappingResult.getMappingAction())) break block17;
                        }
                        catch (IllegalStateException illegalStateException) {
                            throw EntityBundleImporterImpl.a(illegalStateException);
                        }
                        if (!EntityMappingResult.MappingAction.CreatedNew.equals((Object)entityMappingResult.getMappingAction())) continue;
                    }
                    catch (IllegalStateException illegalStateException) {
                        throw EntityBundleImporterImpl.a(illegalStateException);
                    }
                }
                if (!entityMappingResult.getTargetEntityHeader().getType().equals((Object)EntityType.GENERIC)) continue;
            }
            catch (IllegalStateException illegalStateException) {
                throw EntityBundleImporterImpl.a(illegalStateException);
            }
            TransactionTemplate transactionTemplate = new TransactionTemplate(this.transactionManager);
            transactionTemplate.setReadOnly(false);
            Throwable throwable = (Throwable)transactionTemplate.execute((TransactionCallback)new r(this, entityMappingResult, map));
            try {
                if (throwable == null) continue;
                entityMappingResult.makeExceptional(throwable);
            }
            catch (IllegalStateException illegalStateException) {
                throw EntityBundleImporterImpl.a(illegalStateException);
            }
        }
    }

    private void b(@NotNull List<EntityMappingResult> list, @NotNull Map<EntityHeader, EntityHeader> map) {
        try {
            if (list == null) {
                EntityBundleImporterImpl.a(19);
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw EntityBundleImporterImpl.a(illegalStateException);
        }
        try {
            if (map == null) {
                EntityBundleImporterImpl.a(20);
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw EntityBundleImporterImpl.a(illegalStateException);
        }
        for (EntityMappingResult entityMappingResult : list) {
            try {
                block17: {
                    try {
                        try {
                            try {
                                if (entityMappingResult.getTargetEntityHeader() == null || !entityMappingResult.isSuccessful()) continue;
                            }
                            catch (IllegalStateException illegalStateException) {
                                throw EntityBundleImporterImpl.a(illegalStateException);
                            }
                            if (EntityMappingResult.MappingAction.UpdatedExisting.equals((Object)entityMappingResult.getMappingAction())) break block17;
                        }
                        catch (IllegalStateException illegalStateException) {
                            throw EntityBundleImporterImpl.a(illegalStateException);
                        }
                        if (!EntityMappingResult.MappingAction.CreatedNew.equals((Object)entityMappingResult.getMappingAction())) continue;
                    }
                    catch (IllegalStateException illegalStateException) {
                        throw EntityBundleImporterImpl.a(illegalStateException);
                    }
                }
                if (!entityMappingResult.getTargetEntityHeader().getType().equals((Object)EntityType.REVOCATION_CHECK_POLICY)) continue;
            }
            catch (IllegalStateException illegalStateException) {
                throw EntityBundleImporterImpl.a(illegalStateException);
            }
            TransactionTemplate transactionTemplate = new TransactionTemplate(this.transactionManager);
            transactionTemplate.setReadOnly(false);
            Throwable throwable = (Throwable)transactionTemplate.execute((TransactionCallback)new s(this, entityMappingResult, map));
            try {
                if (throwable == null) continue;
                entityMappingResult.makeExceptional(throwable);
            }
            catch (IllegalStateException illegalStateException) {
                throw EntityBundleImporterImpl.a(illegalStateException);
            }
        }
    }

    private void c(@NotNull List<EntityMappingResult> list, Map<EntityHeader, EntityHeader> map) {
        try {
            if (list == null) {
                EntityBundleImporterImpl.a(21);
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw EntityBundleImporterImpl.a(illegalStateException);
        }
        for (EntityMappingResult entityMappingResult : list) {
            block17: {
                try {
                    try {
                        block16: {
                            try {
                                try {
                                    try {
                                        if (entityMappingResult.getTargetEntityHeader() == null || !entityMappingResult.isSuccessful()) continue;
                                    }
                                    catch (IllegalStateException illegalStateException) {
                                        throw EntityBundleImporterImpl.a(illegalStateException);
                                    }
                                    if (EntityMappingResult.MappingAction.UpdatedExisting.equals((Object)entityMappingResult.getMappingAction())) break block16;
                                }
                                catch (IllegalStateException illegalStateException) {
                                    throw EntityBundleImporterImpl.a(illegalStateException);
                                }
                                if (!EntityMappingResult.MappingAction.CreatedNew.equals((Object)entityMappingResult.getMappingAction())) continue;
                            }
                            catch (IllegalStateException illegalStateException) {
                                throw EntityBundleImporterImpl.a(illegalStateException);
                            }
                        }
                        if (entityMappingResult.getTargetEntityHeader().getType().equals((Object)EntityType.POLICY)) break block17;
                    }
                    catch (IllegalStateException illegalStateException) {
                        throw EntityBundleImporterImpl.a(illegalStateException);
                    }
                    if (!entityMappingResult.getTargetEntityHeader().getType().equals((Object)EntityType.SERVICE)) continue;
                }
                catch (IllegalStateException illegalStateException) {
                    throw EntityBundleImporterImpl.a(illegalStateException);
                }
            }
            TransactionTemplate transactionTemplate = new TransactionTemplate(this.transactionManager);
            transactionTemplate.setReadOnly(false);
            Throwable throwable = (Throwable)transactionTemplate.execute((TransactionCallback)new t(this, entityMappingResult, map));
            try {
                if (throwable == null) continue;
                entityMappingResult.makeExceptional(throwable);
            }
            catch (IllegalStateException illegalStateException) {
                throw EntityBundleImporterImpl.a(illegalStateException);
            }
        }
    }

    private boolean a(@NotNull EntityHeader entityHeader, @NotNull EntityHeader entityHeader2) {
        boolean bl2;
        block27: {
            block26: {
                block24: {
                    block22: {
                        try {
                            if (entityHeader == null) {
                                EntityBundleImporterImpl.a(22);
                            }
                        }
                        catch (IllegalStateException illegalStateException) {
                            throw EntityBundleImporterImpl.a(illegalStateException);
                        }
                        try {
                            if (entityHeader2 == null) {
                                EntityBundleImporterImpl.a(23);
                            }
                        }
                        catch (IllegalStateException illegalStateException) {
                            throw EntityBundleImporterImpl.a(illegalStateException);
                        }
                        try {
                            block23: {
                                try {
                                    try {
                                        if (!(entityHeader instanceof GuidEntityHeader)) break block22;
                                        if (!(entityHeader2 instanceof GuidEntityHeader)) break block23;
                                    }
                                    catch (IllegalStateException illegalStateException) {
                                        throw EntityBundleImporterImpl.a(illegalStateException);
                                    }
                                    if (StringUtils.equals((CharSequence)((GuidEntityHeader)entityHeader).getGuid(), (CharSequence)((GuidEntityHeader)entityHeader2).getGuid())) break block22;
                                }
                                catch (IllegalStateException illegalStateException) {
                                    throw EntityBundleImporterImpl.a(illegalStateException);
                                }
                            }
                            return false;
                        }
                        catch (IllegalStateException illegalStateException) {
                            throw EntityBundleImporterImpl.a(illegalStateException);
                        }
                    }
                    try {
                        block25: {
                            try {
                                try {
                                    if (!(entityHeader instanceof ResourceEntryHeader)) break block24;
                                    if (!(entityHeader2 instanceof ResourceEntryHeader)) break block25;
                                }
                                catch (IllegalStateException illegalStateException) {
                                    throw EntityBundleImporterImpl.a(illegalStateException);
                                }
                                if (StringUtils.equals((CharSequence)((ResourceEntryHeader)entityHeader).getUri(), (CharSequence)((ResourceEntryHeader)entityHeader2).getUri())) break block24;
                            }
                            catch (IllegalStateException illegalStateException) {
                                throw EntityBundleImporterImpl.a(illegalStateException);
                            }
                        }
                        return false;
                    }
                    catch (IllegalStateException illegalStateException) {
                        throw EntityBundleImporterImpl.a(illegalStateException);
                    }
                }
                try {
                    try {
                        if (!entityHeader.equals((Object)entityHeader2) || !StringUtils.equals((CharSequence)entityHeader.getName(), (CharSequence)entityHeader2.getName())) break block26;
                    }
                    catch (IllegalStateException illegalStateException) {
                        throw EntityBundleImporterImpl.a(illegalStateException);
                    }
                    bl2 = true;
                    break block27;
                }
                catch (IllegalStateException illegalStateException) {
                    throw EntityBundleImporterImpl.a(illegalStateException);
                }
            }
            bl2 = false;
        }
        return bl2;
    }

    /*
     * Exception decompiling
     */
    @NotNull
    private EntityHeader a(@Nullable EntityContainer var1_1, @Nullable String var2_2, @NotNull EntityMappingInstructions var3_3, @NotNull Map<EntityHeader, EntityHeader> var4_4, @Nullable Entity var5_5, boolean var6_6, boolean var7_7, @Nullable String var8_8, boolean var9_9, @NotNull Map<EntityHeader, Callable<String>> var10_10) throws ObjectModelException, IncorrectMappingInstructionsException, CannotReplaceDependenciesException {
        /*
         * 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 [24[CASE]], but top level block is 12[TRYBLOCK]
         *     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");
    }

    private SsgKeyStore a(Goid goid) throws ObjectModelException, KeyStoreException {
        SsgKeyFinder ssgKeyFinder = this.ssgKeyStoreManager.findByPrimaryKey(goid);
        try {
            if (!ssgKeyFinder.getType().equals((Object)SsgKeyFinder.SsgKeyStoreType.PKCS12_SOFTWARE)) {
                throw new ObjectModelException(d[76] + String.valueOf((Object)ssgKeyFinder.getType()));
            }
        }
        catch (ObjectModelException objectModelException) {
            throw EntityBundleImporterImpl.a(objectModelException);
        }
        return ssgKeyFinder.getKeyStore();
    }

    @NotNull
    private String a(@NotNull Exception exception) {
        String string;
        String string2;
        block31: {
            block28: {
                String string3;
                block30: {
                    block29: {
                        boolean bl2;
                        boolean bl3;
                        block27: {
                            block26: {
                                boolean bl4;
                                block25: {
                                    block24: {
                                        boolean bl5;
                                        block23: {
                                            block22: {
                                                try {
                                                    if (exception == null) {
                                                        EntityBundleImporterImpl.a(28);
                                                    }
                                                }
                                                catch (IllegalStateException illegalStateException) {
                                                    throw EntityBundleImporterImpl.a(illegalStateException);
                                                }
                                                try {
                                                    try {
                                                        if (!(exception instanceof DataIntegrityViolationException) || !(exception.getCause() instanceof org.hibernate.exception.ConstraintViolationException)) break block22;
                                                    }
                                                    catch (IllegalStateException illegalStateException) {
                                                        throw EntityBundleImporterImpl.a(illegalStateException);
                                                    }
                                                    bl5 = true;
                                                    break block23;
                                                }
                                                catch (IllegalStateException illegalStateException) {
                                                    throw EntityBundleImporterImpl.a(illegalStateException);
                                                }
                                            }
                                            bl5 = false;
                                        }
                                        bl3 = bl5;
                                        try {
                                            try {
                                                if (!(exception.getCause() instanceof DataIntegrityViolationException) || !(exception.getCause().getCause() instanceof org.hibernate.exception.ConstraintViolationException)) break block24;
                                            }
                                            catch (IllegalStateException illegalStateException) {
                                                throw EntityBundleImporterImpl.a(illegalStateException);
                                            }
                                            bl4 = true;
                                            break block25;
                                        }
                                        catch (IllegalStateException illegalStateException) {
                                            throw EntityBundleImporterImpl.a(illegalStateException);
                                        }
                                    }
                                    bl4 = false;
                                }
                                boolean bl6 = bl4;
                                try {
                                    try {
                                        if (!bl3 && !bl6) break block26;
                                    }
                                    catch (IllegalStateException illegalStateException) {
                                        throw EntityBundleImporterImpl.a(illegalStateException);
                                    }
                                    bl2 = true;
                                    break block27;
                                }
                                catch (IllegalStateException illegalStateException) {
                                    throw EntityBundleImporterImpl.a(illegalStateException);
                                }
                            }
                            bl2 = false;
                        }
                        boolean bl7 = bl2;
                        try {
                            try {
                                if (!bl7) break block28;
                                if (!bl3) break block29;
                            }
                            catch (IllegalStateException illegalStateException) {
                                throw EntityBundleImporterImpl.a(illegalStateException);
                            }
                            string3 = exception.getCause().getMessage();
                            break block30;
                        }
                        catch (IllegalStateException illegalStateException) {
                            throw EntityBundleImporterImpl.a(illegalStateException);
                        }
                    }
                    string3 = exception.getCause().getCause().getMessage();
                }
                String[] stringArray = d;
                string2 = stringArray[66] + string3;
                break block31;
            }
            string2 = d[20] + ExceptionUtils.getMessage((Throwable)exception);
        }
        String string4 = string2;
        try {
            string = string4;
            if (string == null) {
                EntityBundleImporterImpl.a(29);
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw EntityBundleImporterImpl.a(illegalStateException);
        }
        return string;
    }

    private void a(@NotNull EntityMappingInstructions entityMappingInstructions, @NotNull String string) throws IncorrectMappingInstructionsException {
        try {
            if (entityMappingInstructions == null) {
                EntityBundleImporterImpl.a(30);
            }
        }
        catch (IncorrectMappingInstructionsException incorrectMappingInstructionsException) {
            throw EntityBundleImporterImpl.a(incorrectMappingInstructionsException);
        }
        try {
            if (string == null) {
                EntityBundleImporterImpl.a(31);
            }
        }
        catch (IncorrectMappingInstructionsException incorrectMappingInstructionsException) {
            throw EntityBundleImporterImpl.a(incorrectMappingInstructionsException);
        }
        String[] stringArray = d;
        throw new IncorrectMappingInstructionsException(entityMappingInstructions, stringArray[45] + string + stringArray[97] + string + ".");
    }

    @NotNull
    private Goid a(@NotNull Entity entity, @Nullable Goid goid, @Nullable Entity entity2) throws SaveException, UpdateException {
        Goid goid2;
        Goid goid3;
        block13: {
            block11: {
                block12: {
                    try {
                        if (entity == null) {
                            EntityBundleImporterImpl.a(32);
                        }
                    }
                    catch (SaveException saveException) {
                        throw EntityBundleImporterImpl.a(saveException);
                    }
                    try {
                        if (entity2 != null) break block11;
                        if (goid != null) break block12;
                    }
                    catch (SaveException saveException) {
                        throw EntityBundleImporterImpl.a(saveException);
                    }
                    goid3 = (Goid)this.entityCrud.save(entity);
                    break block13;
                }
                this.entityCrud.save(goid, entity);
                goid3 = goid;
                break block13;
            }
            try {
                if (entity instanceof PersistentEntity) {
                    ((PersistentEntity)entity).setGoid(goid);
                    ((PersistentEntity)entity).setVersion(((PersistentEntity)entity2).getVersion());
                }
            }
            catch (SaveException saveException) {
                throw EntityBundleImporterImpl.a(saveException);
            }
            this.entityCrud.update(entity);
            goid3 = goid;
        }
        try {
            goid2 = goid3;
            if (goid2 == null) {
                EntityBundleImporterImpl.a(33);
            }
        }
        catch (SaveException saveException) {
            throw EntityBundleImporterImpl.a(saveException);
        }
        return goid2;
    }

    /*
     * Unable to fully structure code
     */
    private void a(@NotNull EntityContainer var1_1, @Nullable Entity var2_2, @Nullable String var3_3, @NotNull Map<EntityHeader, EntityHeader> var4_4, EntityMappingInstructions var5_5) throws ObjectModelException, CannotReplaceDependenciesException {
        block141: {
            block142: {
                block144: {
                    block143: {
                        block139: {
                            block140: {
                                block137: {
                                    block138: {
                                        block134: {
                                            block135: {
                                                block117: {
                                                    block133: {
                                                        block130: {
                                                            block132: {
                                                                block121: {
                                                                    block125: {
                                                                        block126: {
                                                                            block128: {
                                                                                block127: {
                                                                                    block124: {
                                                                                        block123: {
                                                                                            block122: {
                                                                                                block119: {
                                                                                                    block120: {
                                                                                                        try {
                                                                                                            if (var1_1 == null) {
                                                                                                                EntityBundleImporterImpl.a(34);
                                                                                                            }
                                                                                                        }
                                                                                                        catch (ObjectModelException v0) {
                                                                                                            throw EntityBundleImporterImpl.a(v0);
                                                                                                        }
                                                                                                        try {
                                                                                                            if (var4_4 == null) {
                                                                                                                EntityBundleImporterImpl.a(35);
                                                                                                            }
                                                                                                        }
                                                                                                        catch (ObjectModelException v1) {
                                                                                                            throw EntityBundleImporterImpl.a(v1);
                                                                                                        }
                                                                                                        var6_6 = var1_1.getEntity();
                                                                                                        if (!(var1_1 instanceof JmsContainer)) ** GOTO lbl36
                                                                                                        var7_7 = (JmsContainer)var1_1;
                                                                                                        this.dependencyAnalyzer.replaceDependencies(var7_7.getJmsConnection(), var4_4, false);
                                                                                                        if (var2_2 == null) {
                                                                                                            var8_14 = (Goid)this.entityCrud.save((Entity)var7_7.getJmsConnection());
                                                                                                            ((JmsEndpoint)var7_7.getEntity()).setConnectionGoid(var8_14);
                                                                                                        } else if (var2_2 instanceof JmsEndpoint) {
                                                                                                            var8_15 = (JmsEndpoint)var2_2;
                                                                                                            var7_7.getJmsConnection().setGoid(var8_15.getConnectionGoid());
                                                                                                            var9_22 = this.entityCrud.find(JmsConnection.class, (Serializable)var8_15.getConnectionGoid());
                                                                                                            try {
                                                                                                                if (var9_22 != null) {
                                                                                                                    var7_7.getJmsConnection().setVersion(var9_22.getVersion());
                                                                                                                }
                                                                                                            }
                                                                                                            catch (ObjectModelException v2) {
                                                                                                                throw EntityBundleImporterImpl.a(v2);
                                                                                                            }
                                                                                                            this.entityCrud.update((Entity)var7_7.getJmsConnection());
                                                                                                            var7_7.getJmsEndpoint().setConnectionGoid(var8_15.getConnectionGoid());
                                                                                                        } else {
                                                                                                            block116: {
                                                                                                                block118: {
                                                                                                                    var17_27 = EntityBundleImporterImpl.d;
                                                                                                                    throw new IllegalStateException(var17_27[95] + String.valueOf(var2_2.getClass()));
lbl36:
                                                                                                                    // 1 sources

                                                                                                                    try {
                                                                                                                        try {
                                                                                                                            try {
                                                                                                                                if (!(var1_1 instanceof PublishedServiceContainer)) break block116;
                                                                                                                                if (var2_2 == null) break block117;
                                                                                                                            }
                                                                                                                            catch (ObjectModelException v3) {
                                                                                                                                throw EntityBundleImporterImpl.a(v3);
                                                                                                                            }
                                                                                                                            if (!(var2_2 instanceof PublishedService)) break block118;
                                                                                                                        }
                                                                                                                        catch (ObjectModelException v4) {
                                                                                                                            throw EntityBundleImporterImpl.a(v4);
                                                                                                                        }
                                                                                                                        ((PublishedServiceContainer)var1_1).getPublishedService().getPolicy().setGuid(((PublishedService)var2_2).getPolicy().getGuid());
                                                                                                                        ((PublishedServiceContainer)var1_1).getPublishedService().getPolicy().setGoid(((PublishedService)var2_2).getPolicy().getGoid());
                                                                                                                        ((PublishedServiceContainer)var1_1).getPublishedService().getPolicy().setVersion(((PublishedService)var2_2).getPolicy().getVersion());
                                                                                                                        break block117;
                                                                                                                    }
                                                                                                                    catch (ObjectModelException v5) {
                                                                                                                        throw EntityBundleImporterImpl.a(v5);
                                                                                                                    }
                                                                                                                }
                                                                                                                var17_28 = EntityBundleImporterImpl.d;
                                                                                                                throw new IllegalStateException(var17_28[93] + String.valueOf(var2_2.getClass()));
                                                                                                            }
                                                                                                            if (var6_6 instanceof EncapsulatedAssertionConfig) {
                                                                                                                var7_8 = (EncapsulatedAssertionConfig)var6_6;
                                                                                                                var8_16 = ((EncapsulatedAssertionConfig)var6_6).getPolicy();
                                                                                                                if (var8_16 != null) {
                                                                                                                    var9_23 = (Policy)this.policyManager.findByPrimaryKey(var8_16.getGoid());
                                                                                                                    var7_8.setPolicy(var9_23);
                                                                                                                }
                                                                                                            } else {
                                                                                                                try {
                                                                                                                    try {
                                                                                                                        if (!(var6_6 instanceof Role) || ((Role)var6_6).isUserCreated().booleanValue()) break block119;
                                                                                                                    }
                                                                                                                    catch (ObjectModelException v6) {
                                                                                                                        throw EntityBundleImporterImpl.a(v6);
                                                                                                                    }
                                                                                                                    if (var2_2 == null) break block120;
                                                                                                                }
                                                                                                                catch (ObjectModelException v7) {
                                                                                                                    throw EntityBundleImporterImpl.a(v7);
                                                                                                                }
                                                                                                                var7_9 = ((Role)var6_6).getPermissions();
                                                                                                                var7_9.clear();
                                                                                                                for (Permission var9_24 : ((Role)var2_2).getPermissions()) {
                                                                                                                    var7_9.add(var9_24);
                                                                                                                }
                                                                                                                try {
                                                                                                                    if (!Role.Tag.ADMIN.equals((Object)((Role)var2_2).getTag())) ** GOTO lbl245
                                                                                                                    ((Role)var6_6).setTag(Role.Tag.ADMIN);
                                                                                                                }
                                                                                                                catch (ObjectModelException v8) {
                                                                                                                    throw EntityBundleImporterImpl.a(v8);
                                                                                                                }
                                                                                                            }
                                                                                                        }
                                                                                                        break block117;
                                                                                                    }
                                                                                                    ((Role)var6_6).setUserCreated(Boolean.valueOf(true));
                                                                                                    break block117;
                                                                                                }
                                                                                                try {
                                                                                                    try {
                                                                                                        if (!(var6_6 instanceof Alias)) break block121;
                                                                                                        v9 = this.entityCrud;
                                                                                                        if (!(var6_6 instanceof PublishedServiceAlias)) break block122;
                                                                                                    }
                                                                                                    catch (ObjectModelException v10) {
                                                                                                        throw EntityBundleImporterImpl.a(v10);
                                                                                                    }
                                                                                                    v11 = EntityType.SERVICE;
                                                                                                    break block123;
                                                                                                }
                                                                                                catch (ObjectModelException v12) {
                                                                                                    throw EntityBundleImporterImpl.a(v12);
                                                                                                }
                                                                                            }
                                                                                            v11 = EntityType.POLICY;
                                                                                        }
                                                                                        var7_10 = v9.findHeader(v11, (Serializable)((Alias)var6_6).getEntityGoid());
                                                                                        try {
                                                                                            try {
                                                                                                if (!(var7_10 instanceof OrganizationHeader)) break block124;
                                                                                                if (!Goid.equals((Goid)((OrganizationHeader)var7_10).getFolderId(), (Goid)((Alias)var6_6).getFolder().getGoid())) break block125;
                                                                                            }
                                                                                            catch (ObjectModelException v13) {
                                                                                                throw EntityBundleImporterImpl.a(v13);
                                                                                            }
                                                                                            throw new DuplicateObjectException(EntityBundleImporterImpl.d[119]);
                                                                                        }
                                                                                        catch (ObjectModelException v14) {
                                                                                            throw EntityBundleImporterImpl.a(v14);
                                                                                        }
                                                                                    }
                                                                                    try {
                                                                                        try {
                                                                                            if (var7_10 != null) break block126;
                                                                                            if (!(var6_6 instanceof PublishedServiceAlias)) break block127;
                                                                                        }
                                                                                        catch (ObjectModelException v15) {
                                                                                            throw EntityBundleImporterImpl.a(v15);
                                                                                        }
                                                                                        v16 = EntityBundleImporterImpl.d[7];
                                                                                        break block128;
                                                                                    }
                                                                                    catch (ObjectModelException v17) {
                                                                                        throw EntityBundleImporterImpl.a(v17);
                                                                                    }
                                                                                }
                                                                                var17_29 = EntityBundleImporterImpl.d;
                                                                                v16 = var17_29[8];
                                                                            }
                                                                            var8_18 = v16;
                                                                            var14_34 = String.valueOf(((Alias)var6_6).getEntityGoid());
                                                                            var15_35 = var8_18;
                                                                            var16_36 = var8_18;
                                                                            var17_29 = EntityBundleImporterImpl.d;
                                                                            throw new ConstraintViolationException(var17_29[36] + var16_36 + var17_29[32] + var15_35 + var17_29[10] + var14_34);
                                                                        }
                                                                        var17_30 = EntityBundleImporterImpl.d;
                                                                        throw new IllegalStateException(var17_30[107] + String.valueOf(var7_10));
                                                                    }
                                                                    try {
                                                                        v18 = var6_6 instanceof PublishedServiceAlias != false ? this.serviceAliasManager : this.policyAliasManager;
                                                                    }
                                                                    catch (ObjectModelException v19) {
                                                                        throw EntityBundleImporterImpl.a(v19);
                                                                    }
                                                                    var8_19 = v18;
                                                                    var9_25 = var8_19.findAliasByEntityAndFolder(((Alias)var6_6).getEntityGoid(), ((Alias)var6_6).getFolder().getGoid());
                                                                    try {
                                                                        block129: {
                                                                            try {
                                                                                try {
                                                                                    if (var9_25 == null) ** GOTO lbl245
                                                                                    if (var2_2 == null) break block129;
                                                                                }
                                                                                catch (ObjectModelException v20) {
                                                                                    throw EntityBundleImporterImpl.a(v20);
                                                                                }
                                                                                if (StringUtils.equals((CharSequence)var2_2.getId(), (CharSequence)var9_25.getId())) ** GOTO lbl245
                                                                            }
                                                                            catch (ObjectModelException v21) {
                                                                                throw EntityBundleImporterImpl.a(v21);
                                                                            }
                                                                        }
                                                                        throw new DuplicateObjectException(EntityBundleImporterImpl.d[109]);
                                                                    }
                                                                    catch (ObjectModelException v22) {
                                                                        throw EntityBundleImporterImpl.a(v22);
                                                                    }
                                                                }
                                                                try {
                                                                    if (!(var6_6 instanceof SsgKeyEntry) || var3_3 == null) break block130;
                                                                }
                                                                catch (ObjectModelException v23) {
                                                                    throw EntityBundleImporterImpl.a(v23);
                                                                }
                                                                var7_11 = (SsgKeyEntry)var6_6;
                                                                var8_20 = var3_3.split(":");
                                                                try {
                                                                    block131: {
                                                                        try {
                                                                            try {
                                                                                try {
                                                                                    if (var8_20.length != 2 || var8_20[1] == null) break block131;
                                                                                }
                                                                                catch (ObjectModelException v24) {
                                                                                    throw EntityBundleImporterImpl.a(v24);
                                                                                }
                                                                                if (var8_20[1].isEmpty()) break block131;
                                                                            }
                                                                            catch (ObjectModelException v25) {
                                                                                throw EntityBundleImporterImpl.a(v25);
                                                                            }
                                                                            if (var8_20[0] != null) break block132;
                                                                        }
                                                                        catch (ObjectModelException v26) {
                                                                            throw EntityBundleImporterImpl.a(v26);
                                                                        }
                                                                    }
                                                                    throw new IllegalStateException(EntityBundleImporterImpl.d[115] + var3_3);
                                                                }
                                                                catch (ObjectModelException v27) {
                                                                    throw EntityBundleImporterImpl.a(v27);
                                                                }
                                                            }
                                                            var7_11.setAlias(var8_20[1]);
                                                            var7_11.setKeystoreId(Goid.parseGoid((String)var8_20[0]));
                                                            break block117;
                                                        }
                                                        try {
                                                            if (!(var6_6 instanceof PolicyBackedService) || var2_2 == null) break block133;
                                                        }
                                                        catch (ObjectModelException v28) {
                                                            throw EntityBundleImporterImpl.a(v28);
                                                        }
                                                        var7_12 = (PolicyBackedService)var6_6;
                                                        var8_21 = (PolicyBackedService)var2_2;
                                                        var9_26 = var8_21.getOperations();
                                                        var10_37 = var9_26.iterator();
                                                        while (var10_37.hasNext()) {
                                                            var11_38 = (PolicyBackedServiceOperation)var10_37.next();
                                                            var12_39 = (PolicyBackedServiceOperation)Functions.grepFirst((Iterable)var7_12.getOperations(), (Functions.Unary)new d(this, var11_38));
                                                            if (var12_39 != null) {
                                                                var13_40 = var12_39.getPolicyGoid();
                                                                try {
                                                                    if (this.policyManager.findByPrimaryKey(var13_40) == null) continue;
                                                                    var11_38.setPolicyGoid(var13_40);
                                                                    continue;
                                                                }
                                                                catch (ObjectModelException v29) {
                                                                    throw EntityBundleImporterImpl.a(v29);
                                                                }
                                                            }
                                                            var10_37.remove();
                                                        }
                                                        for (PolicyBackedServiceOperation var12_39 : var7_12.getOperations()) {
                                                            var13_40 = (PolicyBackedServiceOperation)Functions.grepFirst((Iterable)var8_21.getOperations(), (Functions.Unary)new e(this, var12_39));
                                                            try {
                                                                if (var13_40 != null) continue;
                                                                var9_26.add(var12_39);
                                                            }
                                                            catch (ObjectModelException v30) {
                                                                throw EntityBundleImporterImpl.a(v30);
                                                            }
                                                        }
                                                        var7_12.setOperations(var9_26);
                                                        break block117;
                                                    }
                                                    try {
                                                        if (!(var6_6 instanceof ScheduledTask) || var2_2 == null) break block117;
                                                    }
                                                    catch (ObjectModelException v31) {
                                                        throw EntityBundleImporterImpl.a(v31);
                                                    }
                                                    var7_13 = ((ScheduledTask)var6_6).getPolicyGoid();
                                                    try {
                                                        if (this.policyManager.findByPrimaryKey(var7_13) == null) {
                                                            ((ScheduledTask)var6_6).setPolicyGoid(((ScheduledTask)var2_2).getPolicyGoid());
                                                        }
                                                    }
                                                    catch (ObjectModelException v32) {
                                                        throw EntityBundleImporterImpl.a(v32);
                                                    }
                                                }
                                                try {
                                                    try {
                                                        try {
                                                            if (!(var6_6 instanceof HasFolder) || var2_2 == null) break block134;
                                                        }
                                                        catch (ObjectModelException v33) {
                                                            throw EntityBundleImporterImpl.a(v33);
                                                        }
                                                        if (!(var2_2 instanceof HasFolder)) break block135;
                                                    }
                                                    catch (ObjectModelException v34) {
                                                        throw EntityBundleImporterImpl.a(v34);
                                                    }
                                                    ((HasFolder)var6_6).setFolder(((HasFolder)var2_2).getFolder());
                                                    break block134;
                                                }
                                                catch (ObjectModelException v35) {
                                                    throw EntityBundleImporterImpl.a(v35);
                                                }
                                            }
                                            var17_31 = EntityBundleImporterImpl.d;
                                            throw new IllegalStateException(var17_31[11] + String.valueOf(var2_2.getClass()));
                                        }
                                        try {
                                            try {
                                                try {
                                                    block136: {
                                                        try {
                                                            try {
                                                                try {
                                                                    try {
                                                                        try {
                                                                            if (var6_6 instanceof JdbcConnection || var6_6 instanceof ClusterProperty) break block136;
                                                                        }
                                                                        catch (ObjectModelException v36) {
                                                                            throw EntityBundleImporterImpl.a(v36);
                                                                        }
                                                                        if (var6_6 instanceof SecurePassword) break block136;
                                                                    }
                                                                    catch (ObjectModelException v37) {
                                                                        throw EntityBundleImporterImpl.a(v37);
                                                                    }
                                                                    if (var6_6 instanceof InterfaceTag) break block136;
                                                                }
                                                                catch (ObjectModelException v38) {
                                                                    throw EntityBundleImporterImpl.a(v38);
                                                                }
                                                                if (!(var6_6 instanceof Role)) break block137;
                                                            }
                                                            catch (ObjectModelException v39) {
                                                                throw EntityBundleImporterImpl.a(v39);
                                                            }
                                                            if (((Role)var6_6).isUserCreated().booleanValue()) break block137;
                                                        }
                                                        catch (ObjectModelException v40) {
                                                            throw EntityBundleImporterImpl.a(v40);
                                                        }
                                                    }
                                                    if (var2_2 == null) break block137;
                                                }
                                                catch (ObjectModelException v41) {
                                                    throw EntityBundleImporterImpl.a(v41);
                                                }
                                                if (!(var2_2 instanceof NameableEntity)) break block138;
                                            }
                                            catch (ObjectModelException v42) {
                                                throw EntityBundleImporterImpl.a(v42);
                                            }
                                            ((NameableEntity)var6_6).setName(((NameableEntity)var2_2).getName());
                                            break block137;
                                        }
                                        catch (ObjectModelException v43) {
                                            throw EntityBundleImporterImpl.a(v43);
                                        }
                                    }
                                    var17_32 = EntityBundleImporterImpl.d;
                                    throw new IllegalStateException(var17_32[43] + String.valueOf(var2_2.getClass()));
                                }
                                try {
                                    try {
                                        try {
                                            if (!(var6_6 instanceof GuidEntity) || var2_2 == null) break block139;
                                        }
                                        catch (ObjectModelException v44) {
                                            throw EntityBundleImporterImpl.a(v44);
                                        }
                                        if (!(var2_2 instanceof GuidEntity)) break block140;
                                    }
                                    catch (ObjectModelException v45) {
                                        throw EntityBundleImporterImpl.a(v45);
                                    }
                                    ((GuidEntity)var6_6).setGuid(((GuidEntity)var2_2).getGuid());
                                    break block139;
                                }
                                catch (ObjectModelException v46) {
                                    throw EntityBundleImporterImpl.a(v46);
                                }
                            }
                            var17_33 = EntityBundleImporterImpl.d;
                            throw new IllegalStateException(var17_33[31] + String.valueOf(var2_2.getClass()));
                        }
                        try {
                            try {
                                try {
                                    try {
                                        try {
                                            if (!(var6_6 instanceof UserBean) || var2_2 == null) break block141;
                                        }
                                        catch (ObjectModelException v47) {
                                            throw EntityBundleImporterImpl.a(v47);
                                        }
                                        if (!(var2_2 instanceof User)) break block142;
                                    }
                                    catch (ObjectModelException v48) {
                                        throw EntityBundleImporterImpl.a(v48);
                                    }
                                    if (Boolean.parseBoolean(var5_5.getExtraMappingProperty(EntityBundleImporterImpl.d[126]))) break block143;
                                }
                                catch (ObjectModelException v49) {
                                    throw EntityBundleImporterImpl.a(v49);
                                }
                                ((UserBean)var6_6).setLogin(((User)var2_2).getLogin());
                                if (!(var2_2 instanceof InternalUser)) break block141;
                            }
                            catch (ObjectModelException v50) {
                                throw EntityBundleImporterImpl.a(v50);
                            }
                            ((UserBean)var6_6).setName(((User)var2_2).getName());
                            break block141;
                        }
                        catch (ObjectModelException v51) {
                            throw EntityBundleImporterImpl.a(v51);
                        }
                    }
                    try {
                        if (((UserBean)var6_6).getName() != null) break block144;
                        ((UserBean)var6_6).setName(((UserBean)var6_6).getLogin());
                        break block141;
                    }
                    catch (ObjectModelException v52) {
                        throw EntityBundleImporterImpl.a(v52);
                    }
                }
                try {
                    if (!((UserBean)var6_6).getName().equals(((UserBean)var6_6).getLogin())) {
                        throw new IllegalStateException(EntityBundleImporterImpl.d[29]);
                    }
                    break block141;
                }
                catch (ObjectModelException v53) {
                    throw EntityBundleImporterImpl.a(v53);
                }
            }
            throw new IllegalStateException(EntityBundleImporterImpl.d[15] + String.valueOf(var2_2.getClass()));
        }
    }

    private void a(@NotNull EntityContainer entityContainer, boolean bl2) throws ObjectModelException {
        block17: {
            try {
                if (entityContainer == null) {
                    EntityBundleImporterImpl.a(36);
                }
            }
            catch (ObjectModelException objectModelException) {
                throw EntityBundleImporterImpl.a(objectModelException);
            }
            if (entityContainer instanceof PublishedServiceContainer) {
                PublishedServiceContainer publishedServiceContainer = (PublishedServiceContainer)entityContainer;
                if (!bl2) {
                    Iterator<ServiceDocument> iterator = this.entityCrud.findAll(ServiceDocument.class);
                    Iterator iterator2 = iterator.iterator();
                    while (iterator2.hasNext()) {
                        EntityHeader entityHeader = (EntityHeader)iterator2.next();
                        ServiceDocument serviceDocument = (ServiceDocument)this.entityCrud.find(entityHeader);
                        try {
                            try {
                                if (serviceDocument == null || !serviceDocument.getServiceId().equals((Object)((PublishedServiceContainer)entityContainer).getPublishedService().getGoid())) continue;
                            }
                            catch (ObjectModelException objectModelException) {
                                throw EntityBundleImporterImpl.a(objectModelException);
                            }
                            this.entityCrud.delete((Entity)serviceDocument);
                        }
                        catch (ObjectModelException objectModelException) {
                            throw EntityBundleImporterImpl.a(objectModelException);
                        }
                    }
                }
                for (ServiceDocument serviceDocument : publishedServiceContainer.getServiceDocuments()) {
                    serviceDocument.setGoid(ServiceDocument.DEFAULT_GOID);
                    serviceDocument.setServiceId(((PublishedServiceContainer)entityContainer).getPublishedService().getGoid());
                    this.entityCrud.save((Entity)serviceDocument);
                }
            } else {
                try {
                    if (!(entityContainer instanceof UserContainer) || ((UserContainer)entityContainer).getCertificate() == null) break block17;
                }
                catch (ObjectModelException objectModelException) {
                    throw EntityBundleImporterImpl.a(objectModelException);
                }
                TransactionTemplate transactionTemplate = new TransactionTemplate(this.transactionManager);
                transactionTemplate.setReadOnly(false);
                Option option = (Option)transactionTemplate.execute((TransactionCallback)new f(this, entityContainer));
                try {
                    if (option.isSome()) {
                        throw (ObjectModelException)((Object)option.some());
                    }
                }
                catch (ObjectModelException objectModelException) {
                    throw EntityBundleImporterImpl.a(objectModelException);
                }
                X509Certificate x509Certificate = ((UserContainer)entityContainer).getCertificate();
                this.clientCertManager.recordNewUserCert((User)((UserContainer)entityContainer).getEntity(), (Certificate)x509Certificate, false);
            }
        }
    }

    private void a(@NotNull EntityContainer entityContainer) throws ConstraintViolationException {
        try {
            if (entityContainer == null) {
                EntityBundleImporterImpl.a(37);
            }
        }
        catch (ConstraintViolationException constraintViolationException) {
            throw EntityBundleImporterImpl.a(constraintViolationException);
        }
        for (Entity entity : entityContainer.getEntities()) {
            Class[] classArray;
            Set set = this.c.validate((Object)entity, classArray = this.a((Object)entity));
            if (set.isEmpty()) continue;
            StringBuilder stringBuilder = new StringBuilder(d[88]);
            boolean bl2 = true;
            for (ConstraintViolation constraintViolation : set) {
                try {
                    if (!bl2) {
                        stringBuilder.append('\n');
                    }
                }
                catch (ConstraintViolationException constraintViolationException) {
                    throw EntityBundleImporterImpl.a(constraintViolationException);
                }
                bl2 = false;
                stringBuilder.append(constraintViolation.getPropertyPath().toString());
                stringBuilder.append(' ');
                stringBuilder.append(constraintViolation.getMessage());
            }
            throw new ConstraintViolationException(stringBuilder.toString());
        }
    }

    @NotNull
    private Class[] a(@NotNull Object object) {
        Class[] classArray;
        block36: {
            Class[] classArray2;
            block37: {
                block34: {
                    Class[] classArray3;
                    block35: {
                        block32: {
                            Class[] classArray4;
                            block33: {
                                block30: {
                                    Class[] classArray5;
                                    block31: {
                                        try {
                                            if (object == null) {
                                                EntityBundleImporterImpl.a(38);
                                            }
                                        }
                                        catch (IllegalStateException illegalStateException) {
                                            throw EntityBundleImporterImpl.a(illegalStateException);
                                        }
                                        try {
                                            try {
                                                try {
                                                    if (!(object instanceof JmsEndpoint) || ((JmsEndpoint)object).isTemplate()) break block30;
                                                }
                                                catch (IllegalStateException illegalStateException) {
                                                    throw EntityBundleImporterImpl.a(illegalStateException);
                                                }
                                                classArray5 = new Class[]{Default.class, JmsEndpoint.StandardValidationGroup.class};
                                                if (classArray5 != null) break block31;
                                            }
                                            catch (IllegalStateException illegalStateException) {
                                                throw EntityBundleImporterImpl.a(illegalStateException);
                                            }
                                            EntityBundleImporterImpl.a(39);
                                        }
                                        catch (IllegalStateException illegalStateException) {
                                            throw EntityBundleImporterImpl.a(illegalStateException);
                                        }
                                    }
                                    return classArray5;
                                }
                                try {
                                    try {
                                        try {
                                            if (!(object instanceof JmsConnection) || ((JmsConnection)object).isTemplate()) break block32;
                                        }
                                        catch (IllegalStateException illegalStateException) {
                                            throw EntityBundleImporterImpl.a(illegalStateException);
                                        }
                                        classArray4 = new Class[]{Default.class, JmsConnection.StandardValidationGroup.class};
                                        if (classArray4 != null) break block33;
                                    }
                                    catch (IllegalStateException illegalStateException) {
                                        throw EntityBundleImporterImpl.a(illegalStateException);
                                    }
                                    EntityBundleImporterImpl.a(40);
                                }
                                catch (IllegalStateException illegalStateException) {
                                    throw EntityBundleImporterImpl.a(illegalStateException);
                                }
                            }
                            return classArray4;
                        }
                        try {
                            try {
                                try {
                                    if (!(object instanceof PublishedService) || !((PublishedService)object).isSoap()) break block34;
                                }
                                catch (IllegalStateException illegalStateException) {
                                    throw EntityBundleImporterImpl.a(illegalStateException);
                                }
                                classArray3 = new Class[]{Default.class, PublishedService.SoapValidationGroup.class};
                                if (classArray3 != null) break block35;
                            }
                            catch (IllegalStateException illegalStateException) {
                                throw EntityBundleImporterImpl.a(illegalStateException);
                            }
                            EntityBundleImporterImpl.a(41);
                        }
                        catch (IllegalStateException illegalStateException) {
                            throw EntityBundleImporterImpl.a(illegalStateException);
                        }
                    }
                    return classArray3;
                }
                try {
                    try {
                        try {
                            if (!(object instanceof Policy) || ((Policy)object).getType() != PolicyType.GLOBAL_FRAGMENT) break block36;
                        }
                        catch (IllegalStateException illegalStateException) {
                            throw EntityBundleImporterImpl.a(illegalStateException);
                        }
                        classArray2 = new Class[]{Default.class, Policy.GlobalPolicyValidationGroup.class};
                        if (classArray2 != null) break block37;
                    }
                    catch (IllegalStateException illegalStateException) {
                        throw EntityBundleImporterImpl.a(illegalStateException);
                    }
                    EntityBundleImporterImpl.a(42);
                }
                catch (IllegalStateException illegalStateException) {
                    throw EntityBundleImporterImpl.a(illegalStateException);
                }
            }
            return classArray2;
        }
        try {
            classArray = new Class[]{Default.class};
            if (classArray == null) {
                EntityBundleImporterImpl.a(43);
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw EntityBundleImporterImpl.a(illegalStateException);
        }
        return classArray;
    }

    @Nullable
    private Entity a(@NotNull EntityMappingInstructions entityMappingInstructions, @Nullable Entity entity, @NotNull EntityBundle entityBundle, @NotNull Map<EntityHeader, EntityHeader> map) throws BundleImportException {
        try {
            if (entityMappingInstructions == null) {
                EntityBundleImporterImpl.a(44);
            }
        }
        catch (BundleImportException bundleImportException) {
            throw EntityBundleImporterImpl.a(bundleImportException);
        }
        try {
            if (entityBundle == null) {
                EntityBundleImporterImpl.a(45);
            }
        }
        catch (BundleImportException bundleImportException) {
            throw EntityBundleImporterImpl.a(bundleImportException);
        }
        try {
            if (map == null) {
                EntityBundleImporterImpl.a(46);
            }
        }
        catch (BundleImportException bundleImportException) {
            throw EntityBundleImporterImpl.a(bundleImportException);
        }
        TransactionTemplate transactionTemplate = new TransactionTemplate((PlatformTransactionManager)new g(this));
        transactionTemplate.setReadOnly(true);
        return (Entity)((Option)Eithers.extract((Either)((Either)transactionTemplate.execute((TransactionCallback)new h(this, entityMappingInstructions, map, entityBundle, entity))))).toNull();
    }

    @Nullable
    private Entity a(@NotNull Role role, @NotNull Map<EntityHeader, EntityHeader> map) throws FindException {
        block17: {
            String string;
            block19: {
                String[] stringArray;
                block18: {
                    try {
                        if (role == null) {
                            EntityBundleImporterImpl.a(47);
                        }
                    }
                    catch (FindException findException) {
                        throw EntityBundleImporterImpl.a(findException);
                    }
                    try {
                        if (map == null) {
                            EntityBundleImporterImpl.a(48);
                        }
                    }
                    catch (FindException findException) {
                        throw EntityBundleImporterImpl.a(findException);
                    }
                    try {
                        try {
                            if (role.getEntityGoid() == null || role.getEntityType() == null) break block17;
                        }
                        catch (FindException findException) {
                            throw EntityBundleImporterImpl.a(findException);
                        }
                        if (!role.getName().startsWith(d[78])) break block18;
                    }
                    catch (FindException findException) {
                        throw EntityBundleImporterImpl.a(findException);
                    }
                    stringArray = d;
                    string = stringArray[16];
                    break block19;
                }
                stringArray = d;
                string = role.getName().startsWith(stringArray[51]) ? stringArray[73] : null;
            }
            if (string != null) {
                EntityHeader entityHeader = new EntityHeader(role.getEntityGoid(), role.getEntityType(), null, null);
                EntityHeader entityHeader2 = DependencyProcessorUtils.findMappedHeader(map, entityHeader);
                if (entityHeader2 == null) {
                    entityHeader2 = entityHeader;
                }
                Collection<Role> collection = this.roleManager.findEntitySpecificRoles(entityHeader2.getType(), entityHeader2.getGoid());
                try {
                    if (collection == null || collection.isEmpty()) break block17;
                }
                catch (FindException findException) {
                    throw EntityBundleImporterImpl.a(findException);
                }
                for (Role role2 : collection) {
                    try {
                        if (!role2.getName().startsWith(string)) continue;
                        return role2;
                    }
                    catch (FindException findException) {
                        throw EntityBundleImporterImpl.a(findException);
                    }
                }
            }
        }
        return null;
    }

    /*
     * Loose catch block
     */
    @NotNull
    private String a(@NotNull EntityMappingInstructions entityMappingInstructions, @NotNull Map<EntityHeader, EntityHeader> map, @NotNull EntityBundle entityBundle) throws IncorrectMappingInstructionsException {
        String string;
        String string2;
        block60: {
            EntityMappingInstructions.TargetMapping.Type type;
            block55: {
                block56: {
                    block57: {
                        Object object;
                        Object object2;
                        Folder folder;
                        block59: {
                            block54: {
                                block53: {
                                    block52: {
                                        block51: {
                                            EntityMappingInstructions.TargetMapping.Type type2;
                                            block50: {
                                                try {
                                                    if (entityMappingInstructions == null) {
                                                        EntityBundleImporterImpl.a(49);
                                                    }
                                                }
                                                catch (FindException findException) {
                                                    throw EntityBundleImporterImpl.a(findException);
                                                }
                                                try {
                                                    if (map == null) {
                                                        EntityBundleImporterImpl.a(50);
                                                    }
                                                }
                                                catch (FindException findException) {
                                                    throw EntityBundleImporterImpl.a(findException);
                                                }
                                                try {
                                                    if (entityBundle == null) {
                                                        EntityBundleImporterImpl.a(51);
                                                    }
                                                }
                                                catch (FindException findException) {
                                                    throw EntityBundleImporterImpl.a(findException);
                                                }
                                                try {
                                                    if (entityMappingInstructions.getTargetMapping() == null || entityMappingInstructions.getTargetMapping().getTargetID() == null) break block50;
                                                }
                                                catch (FindException findException) {
                                                    throw EntityBundleImporterImpl.a(findException);
                                                }
                                                string2 = entityMappingInstructions.getTargetMapping().getTargetID();
                                                break block60;
                                            }
                                            try {
                                                type2 = entityMappingInstructions.getTargetMapping() != null ? entityMappingInstructions.getTargetMapping().getType() : EntityMappingInstructions.TargetMapping.Type.ID;
                                            }
                                            catch (FindException findException) {
                                                throw EntityBundleImporterImpl.a(findException);
                                            }
                                            type = type2;
                                            try {
                                                if (!EntityMappingInstructions.TargetMapping.Type.ID.equals((Object)type) || entityMappingInstructions.getSourceEntityHeader().getStrId() == null) break block51;
                                            }
                                            catch (FindException findException) {
                                                throw EntityBundleImporterImpl.a(findException);
                                            }
                                            string2 = entityMappingInstructions.getSourceEntityHeader().getStrId();
                                            break block60;
                                        }
                                        try {
                                            if (!EntityMappingInstructions.TargetMapping.Type.NAME.equals((Object)type) || entityMappingInstructions.getSourceEntityHeader().getName() == null) break block52;
                                        }
                                        catch (FindException findException) {
                                            throw EntityBundleImporterImpl.a(findException);
                                        }
                                        string2 = entityMappingInstructions.getSourceEntityHeader().getName();
                                        break block60;
                                    }
                                    if (!EntityMappingInstructions.TargetMapping.Type.GUID.equals((Object)type)) break block53;
                                    try {
                                        block61: {
                                            if (!(entityMappingInstructions.getSourceEntityHeader() instanceof GuidEntityHeader)) break block53;
                                            break block61;
                                            catch (FindException findException) {
                                                throw EntityBundleImporterImpl.a(findException);
                                            }
                                        }
                                        if (((GuidEntityHeader)entityMappingInstructions.getSourceEntityHeader()).getGuid() == null) break block53;
                                    }
                                    catch (FindException findException) {
                                        throw EntityBundleImporterImpl.a(findException);
                                    }
                                    string2 = ((GuidEntityHeader)entityMappingInstructions.getSourceEntityHeader()).getGuid();
                                    break block60;
                                }
                                if (!EntityMappingInstructions.TargetMapping.Type.ROUTING_URI.equals((Object)type)) break block54;
                                try {
                                    block62: {
                                        if (!(entityMappingInstructions.getSourceEntityHeader() instanceof ServiceHeader)) break block54;
                                        break block62;
                                        catch (FindException findException) {
                                            throw EntityBundleImporterImpl.a(findException);
                                        }
                                    }
                                    if (((ServiceHeader)entityMappingInstructions.getSourceEntityHeader()).getRoutingUri() == null) break block54;
                                }
                                catch (FindException findException) {
                                    throw EntityBundleImporterImpl.a(findException);
                                }
                                string2 = ((ServiceHeader)entityMappingInstructions.getSourceEntityHeader()).getRoutingUri();
                                break block60;
                            }
                            if (!EntityMappingInstructions.TargetMapping.Type.PATH.equals((Object)type)) break block55;
                            try {
                                block63: {
                                    if (!(entityMappingInstructions.getSourceEntityHeader() instanceof HasFolderId)) break block55;
                                    break block63;
                                    catch (FindException findException) {
                                        throw EntityBundleImporterImpl.a(findException);
                                    }
                                }
                                if (((HasFolderId)entityMappingInstructions.getSourceEntityHeader()).getFolderId() == null) break block56;
                            }
                            catch (FindException findException) {
                                throw EntityBundleImporterImpl.a(findException);
                            }
                            EntityContainer entityContainer = entityBundle.getEntity(entityMappingInstructions.getSourceEntityHeader().getStrId(), entityMappingInstructions.getSourceEntityHeader().getType());
                            try {
                                if (entityContainer == null || !(entityContainer.getEntity() instanceof HasFolder)) break block57;
                            }
                            catch (FindException findException) {
                                throw EntityBundleImporterImpl.a(findException);
                            }
                            HasFolder hasFolder = (HasFolder)entityContainer.getEntity();
                            folder = hasFolder.getFolder();
                            if (folder != null) {
                                String[] stringArray;
                                object2 = EntityHeaderUtils.fromEntity((Entity)folder);
                                if (map.containsKey(object2)) {
                                    object2 = map.get(object2);
                                }
                                try {
                                    block58: {
                                        folder = (Folder)this.folderManager.findByHeader((EntityHeader)object2);
                                        try {
                                            if (folder == null) break block58;
                                            hasFolder.setFolder(folder);
                                            break block59;
                                        }
                                        catch (FindException findException) {
                                            throw EntityBundleImporterImpl.a(findException);
                                        }
                                    }
                                    stringArray = d;
                                    a.log(Level.WARNING, stringArray[56] + String.valueOf(object2));
                                }
                                catch (FindException findException) {
                                    stringArray = d;
                                    a.log(Level.WARNING, stringArray[21] + findException.getMessage(), ExceptionUtils.getDebugException((Throwable)findException));
                                }
                            }
                        }
                        object2 = new ArrayList();
                        ((ArrayList)object2).add(entityMappingInstructions.getSourceEntityHeader().getName());
                        while (true) {
                            try {
                                try {
                                    if (folder == null || folder.getGoid().equals((Object)Folder.ROOT_FOLDER_ID)) break;
                                }
                                catch (FindException findException) {
                                    throw EntityBundleImporterImpl.a(findException);
                                }
                                if (folder.getName() == null) break;
                            }
                            catch (FindException findException) {
                                throw EntityBundleImporterImpl.a(findException);
                            }
                            ((ArrayList)object2).add(0, folder.getName());
                            folder = folder.getFolder();
                        }
                        if (!((String)(object = PathUtils.getEscapedPathString((String[])((ArrayList)object2).toArray(new String[((ArrayList)object2).size()])))).startsWith("/")) {
                            object = "/" + (String)object;
                        }
                        string2 = object;
                        break block60;
                    }
                    String[] stringArray = d;
                    throw new IncorrectMappingInstructionsException(entityMappingInstructions, stringArray[120]);
                }
                string2 = "/";
                break block60;
            }
            if (EntityMappingInstructions.TargetMapping.Type.MAP_BY_ROLE_ENTITY.equals((Object)type)) {
                string2 = entityMappingInstructions.getSourceEntityHeader().getStrId();
            } else if (EntityMappingInstructions.TargetMapping.Type.MODULE_SHA265.equals((Object)type)) {
                string2 = entityMappingInstructions.getSourceEntityHeader().getStrId();
            } else {
                String string3 = String.valueOf((Object)type);
                String string4 = String.valueOf((Object)type);
                String string5 = String.valueOf((Object)type);
                String[] stringArray = d;
                throw new IncorrectMappingInstructionsException(entityMappingInstructions, stringArray[39] + string5 + stringArray[57] + string4 + stringArray[46] + string3 + stringArray[59]);
            }
        }
        try {
            string = string2;
            if (string == null) {
                EntityBundleImporterImpl.a(52);
            }
        }
        catch (FindException findException) {
            throw EntityBundleImporterImpl.a(findException);
        }
        return string;
    }

    @NotNull
    private Goid a(@NotNull Goid goid, @NotNull Map<EntityHeader, EntityHeader> map) {
        Goid goid2;
        try {
            if (goid == null) {
                EntityBundleImporterImpl.a(53);
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw EntityBundleImporterImpl.a(illegalStateException);
        }
        try {
            if (map == null) {
                EntityBundleImporterImpl.a(54);
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw EntityBundleImporterImpl.a(illegalStateException);
        }
        for (EntityHeader entityHeader : map.keySet()) {
            Goid goid3;
            block16: {
                try {
                    try {
                        try {
                            if (!entityHeader.getGoid().equals((Object)goid) || !entityHeader.getType().equals((Object)EntityType.ID_PROVIDER_CONFIG)) continue;
                        }
                        catch (IllegalStateException illegalStateException) {
                            throw EntityBundleImporterImpl.a(illegalStateException);
                        }
                        goid3 = map.get(entityHeader).getGoid();
                        if (goid3 != null) break block16;
                    }
                    catch (IllegalStateException illegalStateException) {
                        throw EntityBundleImporterImpl.a(illegalStateException);
                    }
                    EntityBundleImporterImpl.a(55);
                }
                catch (IllegalStateException illegalStateException) {
                    throw EntityBundleImporterImpl.a(illegalStateException);
                }
            }
            return goid3;
        }
        try {
            goid2 = goid;
            if (goid2 == null) {
                EntityBundleImporterImpl.a(56);
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw EntityBundleImporterImpl.a(illegalStateException);
        }
        return goid2;
    }

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[131];
                var3_1 = 0;
                var2_2 = "mV\u0016[\u0005cCS\u0006js\u0007~^UOmyWsYOBo{\u0016}\u0005tMUCLl\"aH@RfL\u0012bCTT`{\u0002>PBj\u001fcCVom}\u0018c^DEwS\u0016a\\HHdW\u0019bXSS`j\u001e~BRc{}\u0012aXHImZ\u0002txNom}\u0018c^DEw[\u0019eEU_Wg\u0007t\u0013y\u0012ez@Jjz\u0016eENHDl\u0018d\\R\u0007|\u0002\u007fHMCp\u0007m\u0012cZHEf\u0006n\u0018}EB_\u0007s\u0016a\\HHd\u0005>\u001eu\u0016\u0001D_WwCMBfl\u0016s@D\u0006fp\u0003xXX\u0006t\u007f\u00041A@Vs{\u00131XN\u0006bpWtBUOwgWeD@R#w\u00041BNR#x\u0018}HDTb|\u001bt\u0016\u0001\fn\u0005~ZHBfl0~EE\n>\u0000xXI\u0006jzM1\fw\u001aaCSRAk\u0019u@D8_WD_DT#{\u0019eEU_#i\u0016b\fLGsn\u0012u\fUI#\u007f\u00191IORjj\u000e1XIGw>\u001eb\fOIw>\"bIS\u001c#\u0004H\u001et[\u0004>\u0018w\f\u000fl\u0012bCTT`{:p\\QOmy\u0004n\u0016eD\tS\u0012b_@Af$W [\u0005cCS\u0006q{\u0003cEDPjp\u00101\\@Tfp\u00031JNJg{\u0005+\f\u000b0W\\MQVjp\u0010+\f\u0017K\u0019zBNQm>\u001ap\\QOmyWpOUOlpW\u0016P\u0018e\fQIpm\u001es@D\u0006wqWuIMCw{%9WuEE\u0006mq\u00031IYOpjWpBE\u0006k\u007f\u00041NDCm>\u0014cI@RfzY\bs\u0016a\\HHd>\u0011j\u0005pBRG`j\u001e~BrRbj\u0002b\rw\u001aaCSRAk\u0019u@DU*_\u00191EORfl\u0019p@\u0001Sp{\u00051B@Kf>\u001ad_U\u0006n\u007f\u0003rD\u0001OwmW}CFOm\u0006\\\u0002\u007fHMCD_WVYHBFp\u0003xXX\u0006fp\u0003xXX\u0006t\u007f\u00041A@Vs{\u00131XN\u0006bpWtBUOwgWeD@R#w\u00041BNR#Y\u0002xHdHww\u0003h\u0016\u0001\f>\u0011~^\u0001Gow\u0016b\u0002\u0001\fz\u0012}IUCFp\u0003xXX\u0007v\u0012pHDT2\u000f{\u0019eEU_@q\u0019eMHHfl\u0013]\u0018d@E\u0006mq\u00031JHHg>\u0003yI\u0001\b>\u001e\u007f_UCbz\bh\u0016}EEGw{\u000bS\u0016a\\HHd>\u0015h\f\u0013y\u0012ez@Jjz\u0016eENHDl\u0018d\\R\u000fy\u0012eo@Sp{:t_RGd{\fv\u0012pHDTpS\u0016eOIL_W_MLCb|\u001btiORjj\u000e1IORjj\u000e1[@U#s\u0016a\\DB#j\u00181MO\u0006fp\u0003xXX\u0006wv\u0016e\fHU#p\u0018e\foGn{\u0016s@Dcmj\u001eeU\u001b\u0006\u000ez\u0018XAQIqj5dBEJf\u001f_\u0003eILVww\u0019v\fUI#s\u0016a\f@H#{\u0019eEU_#|\u000e1:>\u0003~\fLGs>\u0003~\fGTlsWeDD\u0006dw\u0001tB\u0001Dvp\u0013}I\u000f\u0006Sr\u0012p_D\u0006pn\u0012rEG_#\u007fWeMSAfjW\u000el\u0012a@@Efs\u0012\u007fXlGs\u0017K\u0019zBNQm>\u001ap\\QOmyWpOUOlpW:X\u0016x@\u0001Im>\u0019t[\u0001Us{\u0014xJHCg>\u0016\u007fH\u0001Elk\u001bu\fOIw>\u001b~O@Rf>\u0012iERRjp\u00101X@Td{\u0003\u00029Y\u0006S\u0016\u007fMFC\u001eW\u001aaCSRjp\u00101nTHgr\u0012?\f\u0002\u0006N\u007f\u0007aEOAp$W\u001a}\u0016rDDBSl\u001egMUCH{\u000e^\\DTbj\u001e~BR\u000bN\u0005~ODUpw\u0019v\f\fJ\u001ft\fGIoz\u0012c\f\u0006\u001eK\u0019pNMC#j\u00181JHHg>\u0007p^DHw>\u0011~@ECq$W\u001f>\u0015dX\u0001Elk\u001bu\fOIw>\u0013tHTEf>\u00161X@Td{\u00031$[\u0005cCS\u0006ew\u0019uEOA#j\u001ft\fGIoz\u0012c\fC_#\u007fWaMUN#9\n>\u0003~\fLGs>\u0003~3}\u0018|\u0003M\u0011w{\u0014y\u0003RCqh\u0012c\u0003CSmz\u001bxBF\tFp\u0003xXXdvp\u0013}IhKsq\u0005eISonn\u001b-X\u0016x@\u0001Im>\u0012iERRjp\u00101_QC`w\u0011xIE\u0006bp\u00131X@Td{\u00031IYOpj\u0004?*^9~XoSorW|IUNlzW4_\u000f\u0003p>\u001ad_U\u0006mq\u00031^DRvl\u00191BTJo l\u0012a@@EfY\u0012\u007fISO`[\u0019eEU_G{\u0007tBECm}\u001et_\u0016]\u0016\u007fBNR#n\u0012cJNTn>\u0016rXHIm>\u0016P\u0018e\fQIpm\u001es@D\u0006wqWd\\EGw{\u0016]\u0018\u007f_UTbw\u0019e\fwOlr\u0016eENH9>\u0014r\u0018rMUCFf\u001ebXHHd[\u0019eEU_\u0002>_\u0004y\u0002xH\u001by\u0012ea@Vs{\u0013XHDHww\u0003h|SIuw\u0013t^hb\u000fz\u0018XAQIqj5dBEJfm0}\u0018|\u0002M\u0011w{\u0014y\u0002RCqh\u0012c\u0002CSmz\u001bxBF\bjy\u0019~^Dmfg>|\\NTw[\u0005cCSU\u0006S\u0016\u007fMFC\u0010x\u001e\u007fHd^jm\u0003xBFtlr\u0012\u00029W/]\u0016\u007fBNR#s\u0002eMUC#v\u0016cHVGq{WzIXUwq\u0005t\fWOb>\u001axKSGww\u0018\u007f\u0016\u0001+l\u0012a@@EfL\u0012gCBGww\u0018\u007foIC`u\u001e\u007fKqIow\u0014hhDVfp\u0013tBBOfm\u0004H\u001et[\fw\u001aaCSRAk\u0019u@D\u0012m\u0016gInTVn\u0013pXDcmj\u001eeU\u0006{\u0019eEU_\n>\u0018w\fu_s{M1\n>\u001e|\\NTw{\u0013?\by\u0012ea@VWq\u0004l\u0018}I\n>\u0018w\fu_s{M1>_\u0005vYLCmjWwCS\u0006CP\u0018ebTJo>\u0007p^@Kfj\u0012c\f\u0006\u0003p9W~J\u0001\u0003p0Rb\fLSpjW\u007fCU\u0006a{W\u007fYMJ\u000fW\u0019gMMOg>!p@TC9>\u001f>\u001e\u007f\fUNf>\u0015dBEJf0WA@DGp{Wb\\DEjx\u000e1\u000fy\u0012eo@Sp{:t_RGd{\u0019l\u0012a@@EfN\u0018}EB_G{\u0007tBECm}\u001et_\u0010z\u0012}IUCgN\u0018}EB_Jz\u0004RN\u0002s@HUk{\u0013BISPj}\u0012RCORbw\u0019t^\u0001QbmW|MQVfzWeC\u0001Gm>\u0012\u007fXHRz>\u0003yMU\u0006jmW\u007fCU\u0006b>'dNMOpv\u0012u\u007fDTuw\u0014t\u0016\u0001\u001b\u007f\u0011eISeq{\u0016eInTVn\u0013pXDcmj\u001eeEDU@T:BoNHw\u007f\u001e\u007fIS\u0006t\u007f\u00041A@Vs{\u00131XN\u0006bpWtBUOwgWeD@R#w\u00041BNR#\u007fW[ARcmz\u0007~EOR9>)Z\u0012\u007fUHHd>9t[nTVn\u0013pXD\u0006wqWCI@B.Q\u0019}U\u0001cmj\u001eeU\u001b\u0006\u001a>\u0003yMU\u0006`\u007f\u0019\u007fCU\u0006a{W|MQVfzWsU\u0001\u001c|\u0012wCSC@l\u0012pXDiqK\u0007uMUCFp\u0003xXHCp\nw\u0004CI@BLp\u001bh$Z\u0012\u007fUHHd>3t@DRf>\u0003~\fsCbzZ^BM_#[\u0019eEU_9>\u000fz\u0018XAQIqj5dBEJfm\u000eq\u00191\\SI`{\u0004bEOA#\by\u0012ea@VWq\rw\u001aaCSRAk\u0019u@DU\u0016}\u0005tMUCLl\"aH@RfL\u0012bCTT`{\u000bs\u0016a\\HHdm%eB[_WaCMO`gW~^\u0001Ufl\u0001xOD\u0006k{\u0016uIS\u0006jmWtTQC`j\u0012u\fUI#|\u00121MO\u0006Ll\u0010pBH\\bj\u001e~BiCbz\u0012c\fCSw>\u001ee\fVGp>\u0019~X\u000f\u0006K{\u0016uIS\u001c#+J\u001ft\fUGqy\u0012e\fQGwvWx_\u0001HljWp\fWGow\u00131IORjj\u000e1\\@Rk0Y]\u0016\u007fBNR#}\u0005tMUC#\u007f\u001bxMR\u0006jpWeDD\u0006p\u007f\u001at\fGIoz\u0012c\f@U#\u007f\u00191MMObmWwCS\u0006wv\u00121_@Kf>\u0016}E@UfzWaCMO`gW~^\u0001Ufl\u0001xOD\u001by\u0012ea@Vs{\u0013XHDHww\u0003h|SIuw\u0013t^hb\u001cy\u0012eiORjj\u000eRCORbw\u0019t^gTls5dBEJf$>\u0015tO@Sp{WeDDTf>\u001eb\fOI#{\u0019eEU_#q\u00111XXVf>0}\u0018|\u0002M\u0011w{\u0014y\u0002RCqh\u0012c\u0002CSmz\u001bxBF\bjy\u0019~^Dmfg>|\\NTw[\u0005cCSU\u0015J\u0012bX\u0001onn\u0018cXHHd>\u0015dBEJf&_\u00191EE\u0006eq\u00051M\u0001Vqw\u0001pXD\u0006h{\u000e1ER\u0006mq\u00031Z@JjzM1\u0010W\u001aaCSRjp\u00101NTHgr\u0012\u0017[\u0005cCS\u0006js\u0007~^UOmyWsYOBo{W\u0004p\u0016|IG]\u0016\u007fBNR#}\u0005tMUC#\u007f\u001bxMR\u0006jpWeDD\u0006p\u007f\u001at\fGIoz\u0012c\f@U#j\u001ft\f@Jj\u007f\u0004tH\u0001Vlr\u001erU\u0001Iq>\u0004t^WO`{3S\u0016a\\HHd>\u0015h\fQGwvWsYU\u0006fp\u0003xXX\u0006jmW\u007fCU\u0006b>\u0011~@ECq\u007f\u0015}I\u0001Rzn\u0012XJ\u001ft\fRVf}\u001ewEDB#w\u00131ATUw>\u001apXBN#j\u001ft\fHB#q\u00111XIC#{\u000fx_UOmyWtBUOwgWxJ\u0001Gm>\u0012iERRjp\u00101IORjj\u000e1ER\u0006dw\u0001tB\u0004>\u0018c\f\u0012m\u0016gInTVn\u0013pXDcmj\u001eeU3}\u0018|\u0003M\u0011w{\u0014y\u0003RCqh\u0012c\u0003CSmz\u001bxBF\tFp\u0003xXXdvp\u0013}IhKsq\u0005eISonn\u001b\u000ez\u0018XAQIqj5dBEJf\u0010\u007f\u001b}CVjly\u001e\u007foIGmy\u0012\u0006|\u0002\u007fHMC\u0007v\u0012pHDT1";
                var4_3 = "mV\u0016[\u0005cCS\u0006js\u0007~^UOmyWsYOBo{\u0016}\u0005tMUCLl\"aH@RfL\u0012bCTT`{\u0002>PBj\u001fcCVom}\u0018c^DEwS\u0016a\\HHdW\u0019bXSS`j\u001e~BRc{}\u0012aXHImZ\u0002txNom}\u0018c^DEw[\u0019eEU_Wg\u0007t\u0013y\u0012ez@Jjz\u0016eENHDl\u0018d\\R\u0007|\u0002\u007fHMCp\u0007m\u0012cZHEf\u0006n\u0018}EB_\u0007s\u0016a\\HHd\u0005>\u001eu\u0016\u0001D_WwCMBfl\u0016s@D\u0006fp\u0003xXX\u0006t\u007f\u00041A@Vs{\u00131XN\u0006bpWtBUOwgWeD@R#w\u00041BNR#x\u0018}HDTb|\u001bt\u0016\u0001\fn\u0005~ZHBfl0~EE\n>\u0000xXI\u0006jzM1\fw\u001aaCSRAk\u0019u@D8_WD_DT#{\u0019eEU_#i\u0016b\fLGsn\u0012u\fUI#\u007f\u00191IORjj\u000e1XIGw>\u001eb\fOIw>\"bIS\u001c#\u0004H\u001et[\u0004>\u0018w\f\u000fl\u0012bCTT`{:p\\QOmy\u0004n\u0016eD\tS\u0012b_@Af$W [\u0005cCS\u0006q{\u0003cEDPjp\u00101\\@Tfp\u00031JNJg{\u0005+\f\u000b0W\\MQVjp\u0010+\f\u0017K\u0019zBNQm>\u001ap\\QOmyWpOUOlpW\u0016P\u0018e\fQIpm\u001es@D\u0006wqWuIMCw{%9WuEE\u0006mq\u00031IYOpjWpBE\u0006k\u007f\u00041NDCm>\u0014cI@RfzY\bs\u0016a\\HHd>\u0011j\u0005pBRG`j\u001e~BrRbj\u0002b\rw\u001aaCSRAk\u0019u@DU*_\u00191EORfl\u0019p@\u0001Sp{\u00051B@Kf>\u001ad_U\u0006n\u007f\u0003rD\u0001OwmW}CFOm\u0006\\\u0002\u007fHMCD_WVYHBFp\u0003xXX\u0006fp\u0003xXX\u0006t\u007f\u00041A@Vs{\u00131XN\u0006bpWtBUOwgWeD@R#w\u00041BNR#Y\u0002xHdHww\u0003h\u0016\u0001\f>\u0011~^\u0001Gow\u0016b\u0002\u0001\fz\u0012}IUCFp\u0003xXX\u0007v\u0012pHDT2\u000f{\u0019eEU_@q\u0019eMHHfl\u0013]\u0018d@E\u0006mq\u00031JHHg>\u0003yI\u0001\b>\u001e\u007f_UCbz\bh\u0016}EEGw{\u000bS\u0016a\\HHd>\u0015h\f\u0013y\u0012ez@Jjz\u0016eENHDl\u0018d\\R\u000fy\u0012eo@Sp{:t_RGd{\fv\u0012pHDTpS\u0016eOIL_W_MLCb|\u001btiORjj\u000e1IORjj\u000e1[@U#s\u0016a\\DB#j\u00181MO\u0006fp\u0003xXX\u0006wv\u0016e\fHU#p\u0018e\foGn{\u0016s@Dcmj\u001eeU\u001b\u0006\u000ez\u0018XAQIqj5dBEJf\u001f_\u0003eILVww\u0019v\fUI#s\u0016a\f@H#{\u0019eEU_#|\u000e1:>\u0003~\fLGs>\u0003~\fGTlsWeDD\u0006dw\u0001tB\u0001Dvp\u0013}I\u000f\u0006Sr\u0012p_D\u0006pn\u0012rEG_#\u007fWeMSAfjW\u000el\u0012a@@Efs\u0012\u007fXlGs\u0017K\u0019zBNQm>\u001ap\\QOmyWpOUOlpW:X\u0016x@\u0001Im>\u0019t[\u0001Us{\u0014xJHCg>\u0016\u007fH\u0001Elk\u001bu\fOIw>\u001b~O@Rf>\u0012iERRjp\u00101X@Td{\u0003\u00029Y\u0006S\u0016\u007fMFC\u001eW\u001aaCSRjp\u00101nTHgr\u0012?\f\u0002\u0006N\u007f\u0007aEOAp$W\u001a}\u0016rDDBSl\u001egMUCH{\u000e^\\DTbj\u001e~BR\u000bN\u0005~ODUpw\u0019v\f\fJ\u001ft\fGIoz\u0012c\f\u0006\u001eK\u0019pNMC#j\u00181JHHg>\u0007p^DHw>\u0011~@ECq$W\u001f>\u0015dX\u0001Elk\u001bu\fOIw>\u0013tHTEf>\u00161X@Td{\u00031$[\u0005cCS\u0006ew\u0019uEOA#j\u001ft\fGIoz\u0012c\fC_#\u007fWaMUN#9\n>\u0003~\fLGs>\u0003~3}\u0018|\u0003M\u0011w{\u0014y\u0003RCqh\u0012c\u0003CSmz\u001bxBF\tFp\u0003xXXdvp\u0013}IhKsq\u0005eISonn\u001b-X\u0016x@\u0001Im>\u0012iERRjp\u00101_QC`w\u0011xIE\u0006bp\u00131X@Td{\u00031IYOpj\u0004?*^9~XoSorW|IUNlzW4_\u000f\u0003p>\u001ad_U\u0006mq\u00031^DRvl\u00191BTJo l\u0012a@@EfY\u0012\u007fISO`[\u0019eEU_G{\u0007tBECm}\u001et_\u0016]\u0016\u007fBNR#n\u0012cJNTn>\u0016rXHIm>\u0016P\u0018e\fQIpm\u001es@D\u0006wqWd\\EGw{\u0016]\u0018\u007f_UTbw\u0019e\fwOlr\u0016eENH9>\u0014r\u0018rMUCFf\u001ebXHHd[\u0019eEU_\u0002>_\u0004y\u0002xH\u001by\u0012ea@Vs{\u0013XHDHww\u0003h|SIuw\u0013t^hb\u000fz\u0018XAQIqj5dBEJfm0}\u0018|\u0002M\u0011w{\u0014y\u0002RCqh\u0012c\u0002CSmz\u001bxBF\bjy\u0019~^Dmfg>|\\NTw[\u0005cCSU\u0006S\u0016\u007fMFC\u0010x\u001e\u007fHd^jm\u0003xBFtlr\u0012\u00029W/]\u0016\u007fBNR#s\u0002eMUC#v\u0016cHVGq{WzIXUwq\u0005t\fWOb>\u001axKSGww\u0018\u007f\u0016\u0001+l\u0012a@@EfL\u0012gCBGww\u0018\u007foIC`u\u001e\u007fKqIow\u0014hhDVfp\u0013tBBOfm\u0004H\u001et[\fw\u001aaCSRAk\u0019u@D\u0012m\u0016gInTVn\u0013pXDcmj\u001eeU\u0006{\u0019eEU_\n>\u0018w\fu_s{M1\n>\u001e|\\NTw{\u0013?\by\u0012ea@VWq\u0004l\u0018}I\n>\u0018w\fu_s{M1>_\u0005vYLCmjWwCS\u0006CP\u0018ebTJo>\u0007p^@Kfj\u0012c\f\u0006\u0003p9W~J\u0001\u0003p0Rb\fLSpjW\u007fCU\u0006a{W\u007fYMJ\u000fW\u0019gMMOg>!p@TC9>\u001f>\u001e\u007f\fUNf>\u0015dBEJf0WA@DGp{Wb\\DEjx\u000e1\u000fy\u0012eo@Sp{:t_RGd{\u0019l\u0012a@@EfN\u0018}EB_G{\u0007tBECm}\u001et_\u0010z\u0012}IUCgN\u0018}EB_Jz\u0004RN\u0002s@HUk{\u0013BISPj}\u0012RCORbw\u0019t^\u0001QbmW|MQVfzWeC\u0001Gm>\u0012\u007fXHRz>\u0003yMU\u0006jmW\u007fCU\u0006b>'dNMOpv\u0012u\u007fDTuw\u0014t\u0016\u0001\u001b\u007f\u0011eISeq{\u0016eInTVn\u0013pXDcmj\u001eeEDU@T:BoNHw\u007f\u001e\u007fIS\u0006t\u007f\u00041A@Vs{\u00131XN\u0006bpWtBUOwgWeD@R#w\u00041BNR#\u007fW[ARcmz\u0007~EOR9>)Z\u0012\u007fUHHd>9t[nTVn\u0013pXD\u0006wqWCI@B.Q\u0019}U\u0001cmj\u001eeU\u001b\u0006\u001a>\u0003yMU\u0006`\u007f\u0019\u007fCU\u0006a{W|MQVfzWsU\u0001\u001c|\u0012wCSC@l\u0012pXDiqK\u0007uMUCFp\u0003xXHCp\nw\u0004CI@BLp\u001bh$Z\u0012\u007fUHHd>3t@DRf>\u0003~\fsCbzZ^BM_#[\u0019eEU_9>\u000fz\u0018XAQIqj5dBEJfm\u000eq\u00191\\SI`{\u0004bEOA#\by\u0012ea@VWq\rw\u001aaCSRAk\u0019u@DU\u0016}\u0005tMUCLl\"aH@RfL\u0012bCTT`{\u000bs\u0016a\\HHdm%eB[_WaCMO`gW~^\u0001Ufl\u0001xOD\u0006k{\u0016uIS\u0006jmWtTQC`j\u0012u\fUI#|\u00121MO\u0006Ll\u0010pBH\\bj\u001e~BiCbz\u0012c\fCSw>\u001ee\fVGp>\u0019~X\u000f\u0006K{\u0016uIS\u001c#+J\u001ft\fUGqy\u0012e\fQGwvWx_\u0001HljWp\fWGow\u00131IORjj\u000e1\\@Rk0Y]\u0016\u007fBNR#}\u0005tMUC#\u007f\u001bxMR\u0006jpWeDD\u0006p\u007f\u001at\fGIoz\u0012c\f@U#\u007f\u00191MMObmWwCS\u0006wv\u00121_@Kf>\u0016}E@UfzWaCMO`gW~^\u0001Ufl\u0001xOD\u001by\u0012ea@Vs{\u0013XHDHww\u0003h|SIuw\u0013t^hb\u001cy\u0012eiORjj\u000eRCORbw\u0019t^gTls5dBEJf$>\u0015tO@Sp{WeDDTf>\u001eb\fOI#{\u0019eEU_#q\u00111XXVf>0}\u0018|\u0002M\u0011w{\u0014y\u0002RCqh\u0012c\u0002CSmz\u001bxBF\bjy\u0019~^Dmfg>|\\NTw[\u0005cCSU\u0015J\u0012bX\u0001onn\u0018cXHHd>\u0015dBEJf&_\u00191EE\u0006eq\u00051M\u0001Vqw\u0001pXD\u0006h{\u000e1ER\u0006mq\u00031Z@JjzM1\u0010W\u001aaCSRjp\u00101NTHgr\u0012\u0017[\u0005cCS\u0006js\u0007~^UOmyWsYOBo{W\u0004p\u0016|IG]\u0016\u007fBNR#}\u0005tMUC#\u007f\u001bxMR\u0006jpWeDD\u0006p\u007f\u001at\fGIoz\u0012c\f@U#j\u001ft\f@Jj\u007f\u0004tH\u0001Vlr\u001erU\u0001Iq>\u0004t^WO`{3S\u0016a\\HHd>\u0015h\fQGwvWsYU\u0006fp\u0003xXX\u0006jmW\u007fCU\u0006b>\u0011~@ECq\u007f\u0015}I\u0001Rzn\u0012XJ\u001ft\fRVf}\u001ewEDB#w\u00131ATUw>\u001apXBN#j\u001ft\fHB#q\u00111XIC#{\u000fx_UOmyWtBUOwgWxJ\u0001Gm>\u0012iERRjp\u00101IORjj\u000e1ER\u0006dw\u0001tB\u0004>\u0018c\f\u0012m\u0016gInTVn\u0013pXDcmj\u001eeU3}\u0018|\u0003M\u0011w{\u0014y\u0003RCqh\u0012c\u0003CSmz\u001bxBF\tFp\u0003xXXdvp\u0013}IhKsq\u0005eISonn\u001b\u000ez\u0018XAQIqj5dBEJf\u0010\u007f\u001b}CVjly\u001e\u007foIGmy\u0012\u0006|\u0002\u007fHMC\u0007v\u0012pHDT1".length();
                var1_4 = 2;
                var0_5 = -1;
lbl7:
                // 2 sources

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

                while (true) {
                    var5[var3_1++] = EntityBundleImporterImpl.a(v0, EntityBundleImporterImpl.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "\u0013v\u0001\u000e8\u0015\u0017\f\u000b\fx\u00048((\u0004^b\u0003%";
                    var4_3 = "\u0013v\u0001\u000e8\u0015\u0017\f\u000b\fx\u00048((\u0004^b\u0003%".length();
                    var1_4 = 8;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 117;
                        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++] = EntityBundleImporterImpl.a(v0, EntityBundleImporterImpl.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;
            }
        }
        EntityBundleImporterImpl.d = var5;
        EntityBundleImporterImpl.b = EntityBundleImporterImpl.d[72];
        EntityBundleImporterImpl.a = Logger.getLogger(EntityBundleImporter.class.getName());
    }

    /*
     * 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 Throwable a(Throwable throwable) {
        return throwable;
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x16);
        }
        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 -> 11;
                    case 1 -> 98;
                    case 2 -> 4;
                    case 3 -> 57;
                    case 4 -> 52;
                    case 5 -> 51;
                    default -> 22;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

