/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.task.ScheduledTask
 *  com.l7tech.objectmodel.Entity
 *  com.l7tech.objectmodel.EntityHeader
 *  com.l7tech.objectmodel.FindException
 *  com.l7tech.objectmodel.Goid
 *  com.l7tech.objectmodel.PersistentEntity
 *  com.l7tech.util.ExceptionUtils
 *  jakarta.persistence.TypedQuery
 *  org.hibernate.ObjectDeletedException
 *  org.hibernate.ObjectNotFoundException
 *  org.springframework.orm.hibernate5.HibernateCallback
 *  org.springframework.transaction.annotation.Propagation
 *  org.springframework.transaction.annotation.Transactional
 */
package com.l7tech.server.task;

import com.l7tech.gateway.common.task.ScheduledTask;
import com.l7tech.objectmodel.Entity;
import com.l7tech.objectmodel.EntityHeader;
import com.l7tech.objectmodel.FindException;
import com.l7tech.objectmodel.Goid;
import com.l7tech.objectmodel.PersistentEntity;
import com.l7tech.server.HibernateEntityManager;
import com.l7tech.server.task.ScheduledTaskManager;
import com.l7tech.server.task.c;
import com.l7tech.util.ExceptionUtils;
import jakarta.persistence.TypedQuery;
import java.util.logging.Logger;
import org.hibernate.ObjectDeletedException;
import org.hibernate.ObjectNotFoundException;
import org.springframework.orm.hibernate5.HibernateCallback;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Transactional(propagation=Propagation.REQUIRED, rollbackFor={Throwable.class})
public class ScheduledTaskManagerImpl
extends HibernateEntityManager<ScheduledTask, EntityHeader>
implements ScheduledTaskManager {
    private static final Logger m;
    private static final String n;

    public Class<? extends Entity> getImpClass() {
        return ScheduledTask.class;
    }

    @Override
    public ScheduledTask findByPrimaryKey(Goid goid, boolean bl2) throws FindException {
        try {
            return (ScheduledTask)this.getHibernateTemplate().execute((HibernateCallback)new c(this, goid, bl2));
        }
        catch (Exception exception) {
            block6: {
                try {
                    try {
                        if (!ExceptionUtils.causedBy((Throwable)exception, ObjectNotFoundException.class) && !ExceptionUtils.causedBy((Throwable)exception, ObjectDeletedException.class)) break block6;
                    }
                    catch (Exception exception2) {
                        throw ScheduledTaskManagerImpl.a(exception2);
                    }
                    return null;
                }
                catch (Exception exception3) {
                    throw ScheduledTaskManagerImpl.a(exception3);
                }
            }
            throw new FindException(n, (Throwable)exception);
        }
    }

    static /* synthetic */ PersistentEntity access$000(ScheduledTaskManagerImpl scheduledTaskManagerImpl, TypedQuery typedQuery) {
        return scheduledTaskManagerImpl.getSingleResult(typedQuery);
    }

    /*
     * Enabled aggressive block sorting
     */
    static {
        n = ScheduledTaskManagerImpl.b(45, ScheduledTaskManagerImpl.a("-1.?7x\u0012\n5)-7|\u0003\u001b?(~"));
        m = Logger.getLogger(ScheduledTaskManagerImpl.class.getName());
    }

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

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

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

