<commit_before>package tools.vitruv.framework.util.command;

import java.util.concurrent.Callable;

import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.transaction.TransactionalEditingDomain;

public class EMFCommandBridge {

    protected TransformationResult transformationResult;

    private EMFCommandBridge() {
    }

    public static VitruviusTransformationRecordingCommand createVitruviusTransformationRecordingCommand(
            final Callable<TransformationResult> callable) {
        final VitruviusTransformationRecordingCommand recordingCommand = new VitruviusTransformationRecordingCommand() {
            @Override
            protected void doExecute() {
                try {
                    TransformationResult transformationResult = callable.call();
                    if (null == transformationResult) {
                        logger.warn(
                                "Transformation change result is null. This indicates that the previous transformation had an error.");
                    }
                    this.transformationResult = transformationResult;
                } catch (Throwable e) {
                    storeAndRethrowException(e);
                }
            }
        };
        return recordingCommand;
    }
   
    public static VitruviusRecordingCommand createVitruviusRecordingCommand(final Callable<Void> callable) {
        VitruviusRecordingCommand recordingCommand = new VitruviusRecordingCommand() {
            @Override
            protected void doExecute() {
                try {
                    callable.call();
                } catch (Throwable e) {
                    storeAndRethrowException(e);
                }
            }
        };
        return recordingCommand;
    }

    public static void executeVitruviusRecordingCommand(final TransactionalEditingDomain domain,
            final VitruviusRecordingCommand command) {
        command.setTransactionDomain(domain);
        executeCommand(domain, command);
        command.rethrowRuntimeExceptionIfExisting();
    }
    
    private static void executeCommand(TransactionalEditingDomain domain,
            final Command command) {
        domain.getCommandStack().execute(command);
    }

    public static void createAndExecuteVitruviusRecordingCommand(final Callable<Void> callable,
    		final TransactionalEditingDomain domain) {
        final VitruviusRecordingCommand command = createVitruviusRecordingCommand(callable);
        executeVitruviusRecordingCommand(domain, command);
    }

    public TransformationResult getTransformationResult() {
        return this.transformationResult;
    }

}<commit_msg>Remove unused transformation result property in EMFCommandBridge.<commit_after>package tools.vitruv.framework.util.command;

import java.util.concurrent.Callable;

import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.transaction.TransactionalEditingDomain;

public class EMFCommandBridge {

    private EMFCommandBridge() {
    }

    public static VitruviusTransformationRecordingCommand createVitruviusTransformationRecordingCommand(
            final Callable<TransformationResult> callable) {
        final VitruviusTransformationRecordingCommand recordingCommand = new VitruviusTransformationRecordingCommand() {
            @Override
            protected void doExecute() {
                try {
                    TransformationResult transformationResult = callable.call();
                    if (null == transformationResult) {
                        logger.warn(
                                "Transformation change result is null. This indicates that the previous transformation had an error.");
                    }
                    this.transformationResult = transformationResult;
                } catch (Throwable e) {
                    storeAndRethrowException(e);
                }
            }
        };
        return recordingCommand;
    }
   
    public static VitruviusRecordingCommand createVitruviusRecordingCommand(final Callable<Void> callable) {
        VitruviusRecordingCommand recordingCommand = new VitruviusRecordingCommand() {
            @Override
            protected void doExecute() {
                try {
                    callable.call();
                } catch (Throwable e) {
                    storeAndRethrowException(e);
                }
            }
        };
        return recordingCommand;
    }

    public static void executeVitruviusRecordingCommand(final TransactionalEditingDomain domain,
            final VitruviusRecordingCommand command) {
        command.setTransactionDomain(domain);
        executeCommand(domain, command);
        command.rethrowRuntimeExceptionIfExisting();
    }
    
    private static void executeCommand(TransactionalEditingDomain domain,
            final Command command) {
        domain.getCommandStack().execute(command);
    }

    public static void createAndExecuteVitruviusRecordingCommand(final Callable<Void> callable,
    		final TransactionalEditingDomain domain) {
        final VitruviusRecordingCommand command = createVitruviusRecordingCommand(callable);
        executeVitruviusRecordingCommand(domain, command);
    }

}
{'fraction_non_alphanumeric': 0.059889376311272176, 'fraction_numerical': 0.0, 'mean_word_length': 2.4118412491867276, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '7326269', 'n_tokens_mistral': 1258, 'n_tokens_neox': 1215, 'n_words': 250}