/*
 * Decompiled with CFR 0.152.
 */
package com.l7tech.server.event;

import java.util.concurrent.Callable;
import java.util.concurrent.CompletionException;
import javax.security.auth.Subject;

class a
implements Callable<OUT> {
    final Subject val$subject;
    final Callable val$toWrap;

    /*
     * Ignored method signature, as it can't be verified against descriptor
     */
    a(Subject subject, Callable callable) {
        this.val$subject = subject;
        this.val$toWrap = callable;
    }

    @Override
    public OUT call() throws Exception {
        try {
            return Subject.callAs(this.val$subject, this.val$toWrap::call);
        }
        catch (CompletionException completionException) {
            Throwable throwable = completionException.getCause();
            if (throwable instanceof Exception) {
                Exception exception = (Exception)throwable;
                throw exception;
            }
            throw completionException;
        }
    }
}

