<commit_before>/*******************************************************************************
 * Copyright (c) 2014 <NAME>.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     <NAME> - initial implementation.
 ******************************************************************************/

package tools.vitruv.domains.emf.monitorededitor.test.utils;

import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;

import tools.vitruv.domains.emf.monitorededitor.ISynchronizingMonitoredEmfEditor.ResourceChangeSynchronizing;
import tools.vitruv.domains.emf.monitorededitor.IVitruviusEMFEditorMonitor.IVitruviusAccessor;
import tools.vitruv.framework.change.description.PropagatedChange;
import tools.vitruv.framework.change.description.VitruviusChange;
import tools.vitruv.framework.vsum.ChangePropagationListener;
import tools.vitruv.framework.vsum.VirtualModel;
import tools.vitruv.framework.vsum.views.ViewType;

public class DefaultImplementations {
	public static final ResourceChangeSynchronizing EFFECTLESS_CHANGESYNC = new ResourceChangeSynchronizing() {

		@Override
		public void synchronizeChanges(List<VitruviusChange> changes, URI sourceModelURI, Resource res) {
		}

	};

	public static final IVitruviusAccessor ALL_ACCEPTING_VITRUV_ACCESSOR = new IVitruviusAccessor() {

		@Override
		public boolean isModelMonitored(URI modelUri) {
			return true;
		}
	};

	public static final IVitruviusAccessor NONE_ACCEPTING_VITRUV_ACCESSOR = new IVitruviusAccessor() {

		@Override
		public boolean isModelMonitored(URI modelUri) {
			return false;
		}
	};

	public static class TestVirtualModel implements ResourceChangeSynchronizing, VirtualModel {
		private URI lastURI = null;
		private List<VitruviusChange> lastChanges = null;
		private int executionCount = 0;

		@Override
		public void synchronizeChanges(List<VitruviusChange> changes, URI sourceModelURI, Resource res) {
			this.lastChanges = new ArrayList<>();
			if (changes != null) {
				this.lastChanges.addAll(changes);
			}
			this.lastURI = sourceModelURI;
			this.executionCount++;
		}

		public boolean hasBeenExecuted() {
			return executionCount > 0;
		}

		public int getExecutionCount() {
			return executionCount;
		}

		public List<VitruviusChange> getLastChanges() {
			return lastChanges;
		}

		public URI getLastURI() {
			return lastURI;
		}

		public static TestVirtualModel createInstance() {
			return new TestVirtualModel();
		}

		@Override
		public List<PropagatedChange> propagateChange(VitruviusChange change) {
			synchronizeChanges(Collections.singletonList(change), null, null);
			return null;
		}

		@Override
		public Path getFolder() {
			return null;
		}

		@Override
		public List<PropagatedChange> propagateChangedState(Resource newState) {
			return null;
		}

		@Override
		public List<PropagatedChange> propagateChangedState(Resource newState, URI oldLocation) {
			return null;
		}

		@Override
		public void addChangePropagationListener(ChangePropagationListener propagationListener) {
		}

		@Override
		public void removeChangePropagationListener(ChangePropagationListener propagationListener) {
		}

        @Override
        public Collection<ViewType> getViewTypes() {
            return null;
        }

	}
}<commit_msg>Adapt dummy virtual model implementation<commit_after>/*******************************************************************************
 * Copyright (c) 2014 <NAME>.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     <NAME> - initial implementation.
 ******************************************************************************/

package tools.vitruv.domains.emf.monitorededitor.test.utils;

import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;

import tools.vitruv.domains.emf.monitorededitor.ISynchronizingMonitoredEmfEditor.ResourceChangeSynchronizing;
import tools.vitruv.domains.emf.monitorededitor.IVitruviusEMFEditorMonitor.IVitruviusAccessor;
import tools.vitruv.framework.change.description.PropagatedChange;
import tools.vitruv.framework.change.description.VitruviusChange;
import tools.vitruv.framework.vsum.ChangePropagationListener;
import tools.vitruv.framework.vsum.VirtualModel;
import tools.vitruv.framework.vsum.views.ViewType;

public class DefaultImplementations {
	public static final ResourceChangeSynchronizing EFFECTLESS_CHANGESYNC = new ResourceChangeSynchronizing() {

		@Override
		public void synchronizeChanges(List<VitruviusChange> changes, URI sourceModelURI, Resource res) {
		}

	};

	public static final IVitruviusAccessor ALL_ACCEPTING_VITRUV_ACCESSOR = new IVitruviusAccessor() {

		@Override
		public boolean isModelMonitored(URI modelUri) {
			return true;
		}
	};

	public static final IVitruviusAccessor NONE_ACCEPTING_VITRUV_ACCESSOR = new IVitruviusAccessor() {

		@Override
		public boolean isModelMonitored(URI modelUri) {
			return false;
		}
	};

	public static class TestVirtualModel implements ResourceChangeSynchronizing, VirtualModel {
		private URI lastURI = null;
		private List<VitruviusChange> lastChanges = null;
		private int executionCount = 0;

		@Override
		public void synchronizeChanges(List<VitruviusChange> changes, URI sourceModelURI, Resource res) {
			this.lastChanges = new ArrayList<>();
			if (changes != null) {
				this.lastChanges.addAll(changes);
			}
			this.lastURI = sourceModelURI;
			this.executionCount++;
		}

		public boolean hasBeenExecuted() {
			return executionCount > 0;
		}

		public int getExecutionCount() {
			return executionCount;
		}

		public List<VitruviusChange> getLastChanges() {
			return lastChanges;
		}

		public URI getLastURI() {
			return lastURI;
		}

		public static TestVirtualModel createInstance() {
			return new TestVirtualModel();
		}

		@Override
		public List<PropagatedChange> propagateChange(VitruviusChange change) {
			synchronizeChanges(Collections.singletonList(change), null, null);
			return null;
		}

		@Override
		public Path getFolder() {
			return null;
		}

		@Override
		public List<PropagatedChange> propagateChangedState(Resource newState) {
			return null;
		}

		@Override
		public List<PropagatedChange> propagateChangedState(Resource newState, URI oldLocation) {
			return null;
		}

		@Override
		public void addChangePropagationListener(ChangePropagationListener propagationListener) {
		}

		@Override
		public void removeChangePropagationListener(ChangePropagationListener propagationListener) {
		}

        @Override
        public Collection<ViewType> getViewTypes() {
            return null;
        }
        
        @Override
        public ResourceSet getResourceSet() {
        	return null;
        }

	}
}
{'fraction_non_alphanumeric': 0.12067340067340067, 'fraction_numerical': 0.0026936026936026937, 'mean_word_length': 4.884310618066561, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '383237', 'n_tokens_mistral': 2376, 'n_tokens_neox': 2106, 'n_words': 472}