/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.objectmodel.UpdateException
 *  com.l7tech.util.ExceptionUtils
 */
package com.l7tech.server.security.keystore.software;

import com.l7tech.objectmodel.UpdateException;
import com.l7tech.server.security.keystore.KeystoreFile;
import com.l7tech.server.security.keystore.software.DatabasePkcs12SsgKeyStore;
import com.l7tech.server.security.keystore.software.c;
import com.l7tech.util.ExceptionUtils;
import java.security.KeyStoreException;
import java.util.concurrent.Callable;

class b
implements Callable<OUT> {
    final Callable val$mutator;
    final Runnable val$transactionCallback;
    final DatabasePkcs12SsgKeyStore this$0;

    /*
     * Ignored method signature, as it can't be verified against descriptor
     */
    b(DatabasePkcs12SsgKeyStore databasePkcs12SsgKeyStore, Callable callable, Runnable runnable) {
        this.this$0 = databasePkcs12SsgKeyStore;
        this.val$mutator = callable;
        this.val$transactionCallback = runnable;
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     */
    @Override
    public OUT call() throws Exception {
        Object[] objectArray = new Object[]{null};
        try {
            DatabasePkcs12SsgKeyStore databasePkcs12SsgKeyStore = this.this$0;
            synchronized (databasePkcs12SsgKeyStore) {
                KeystoreFile keystoreFile = this.this$0.l.mutateKeystoreFile(this.this$0.getGoid(), new c(this, objectArray));
                this.this$0.o = keystoreFile.getVersion();
                this.this$0.n = this.this$0.a(keystoreFile.getDatabytes());
            }
        }
        catch (UpdateException updateException) {
            try {
                if (ExceptionUtils.causedBy((Throwable)updateException, KeyStoreException.class)) {
                    throw (KeyStoreException)ExceptionUtils.getCauseIfCausedBy((Throwable)updateException, KeyStoreException.class);
                }
            }
            catch (UpdateException updateException2) {
                throw b.a(updateException2);
            }
            throw new KeyStoreException(updateException);
        }
        return objectArray[0];
    }

    private static UpdateException a(UpdateException updateException) {
        return updateException;
    }
}

