<commit_before>package org.minimalj.backend;

import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;

import org.minimalj.frontend.Frontend;
import org.minimalj.security.Authenticated;
import org.minimalj.security.LoginTransaction;
import org.minimalj.transaction.StreamConsumer;
import org.minimalj.transaction.StreamProducer;
import org.minimalj.transaction.Transaction;

public class AuthenticationBackend extends Backend {

	private final Backend backend;

	public AuthenticationBackend(Backend backend) {
		this.backend = backend;
	}

	@Override
	public Persistence getPersistence() {
		return backend.getPersistence();
	}

	@Override
	public <T> T execute(Transaction<T> transaction) {
		if (!(transaction instanceof LoginTransaction)) {
			return backend.execute(new Authenticated.AuthenticatedTransaction<T>(transaction, Frontend.getBrowser().getSubject()));
		} else {
			return backend.execute(transaction);
		}
	}

	@Override
	public <T extends Serializable> T execute(StreamConsumer<T> streamConsumer, InputStream inputStream) {
		return backend.execute(new Authenticated.AuthenticatedStreamConsumer<T>(streamConsumer, Frontend.getBrowser().getSubject()), inputStream);
	}

	@Override
	public <T extends Serializable> T execute(StreamProducer<T> streamProducer, OutputStream outputStream) {
		return backend.execute(new Authenticated.AuthenticatedStreamProducer<T>(streamProducer, Frontend.getBrowser().getSubject()), outputStream);
	}

}<commit_msg>AuthenticationBackend: Logout doesn't need to be wrapped<commit_after>package org.minimalj.backend;

import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;

import org.minimalj.frontend.Frontend;
import org.minimalj.security.Authenticated;
import org.minimalj.security.LoginTransaction;
import org.minimalj.security.LogoutTransaction;
import org.minimalj.transaction.StreamConsumer;
import org.minimalj.transaction.StreamProducer;
import org.minimalj.transaction.Transaction;

public class AuthenticationBackend extends Backend {

	private final Backend backend;

	public AuthenticationBackend(Backend backend) {
		this.backend = backend;
	}

	@Override
	public Persistence getPersistence() {
		return backend.getPersistence();
	}

	@Override
	public <T> T execute(Transaction<T> transaction) {
		if (!(transaction instanceof LoginTransaction || transaction instanceof LogoutTransaction)) {
			return backend.execute(new Authenticated.AuthenticatedTransaction<T>(transaction, Frontend.getBrowser().getSubject()));
		} else {
			return backend.execute(transaction);
		}
	}

	@Override
	public <T extends Serializable> T execute(StreamConsumer<T> streamConsumer, InputStream inputStream) {
		return backend.execute(new Authenticated.AuthenticatedStreamConsumer<T>(streamConsumer, Frontend.getBrowser().getSubject()), inputStream);
	}

	@Override
	public <T extends Serializable> T execute(StreamProducer<T> streamProducer, OutputStream outputStream) {
		return backend.execute(new Authenticated.AuthenticatedStreamProducer<T>(streamProducer, Frontend.getBrowser().getSubject()), outputStream);
	}

}
{'fraction_non_alphanumeric': 0.09868631848766421, 'fraction_numerical': 0.0, 'mean_word_length': 6.9238578680203045, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3631787', 'n_tokens_mistral': 894, 'n_tokens_neox': 849, 'n_words': 185}