<commit_before>package hu.eltesoft.modelexecution.m2t.smap.xtend;

import org.eclipse.xtend.core.macro.declaration.CompilationUnitImpl;
import org.eclipse.xtend.ide.internal.XtendActivator;
import org.eclipse.xtend.lib.macro.declaration.NamedElement;
import org.eclipse.xtext.xbase.compiler.output.FakeTreeAppendable;
import org.eclipse.xtext.xbase.compiler.output.ITreeAppendable;

import com.google.inject.Injector;

/**
 * Responsible for instantiating or casting to types which are internal to
 * Xtend. The main purpose is to suppress warnings caused by visibility
 * restrictions here, as it could not be done from Xtend code.
 */
@SuppressWarnings("restriction")
class BuiltinObjectsFactory {

	public static Injector getXtendPluginInjector() {
		return XtendActivator.getInstance().getInjector(
				XtendActivator.ORG_ECLIPSE_XTEND_CORE_XTEND);
	}

	public static CompilationUnitImpl getCompilationUnitInternal(
			NamedElement element) {
		return (CompilationUnitImpl) element.getCompilationUnit();
	}

	public static ITreeAppendable createAppendable() {
		return new FakeTreeAppendable();
	}
}<commit_msg>Releng: fixing source mapping to work outside eclipse to support template compilation and testing with maven<commit_after>package hu.eltesoft.modelexecution.m2t.smap.xtend;

import org.eclipse.xtend.core.XtendStandaloneSetup;
import org.eclipse.xtend.core.macro.declaration.CompilationUnitImpl;
import org.eclipse.xtend.ide.internal.XtendActivator;
import org.eclipse.xtend.lib.macro.declaration.NamedElement;
import org.eclipse.xtext.xbase.compiler.output.FakeTreeAppendable;
import org.eclipse.xtext.xbase.compiler.output.ITreeAppendable;

import com.google.inject.Injector;

/**
 * Responsible for instantiating or casting to types which are internal to
 * Xtend. The main purpose is to suppress warnings caused by visibility
 * restrictions here, as it could not be done from Xtend code.
 */
@SuppressWarnings("restriction")
class BuiltinObjectsFactory {

	public static Injector getXtendPluginInjector() {
		XtendActivator activator = XtendActivator.getInstance();
		if (null != activator) {
			return activator
					.getInjector(XtendActivator.ORG_ECLIPSE_XTEND_CORE_XTEND);
		}
		return new XtendStandaloneSetup().createInjectorAndDoEMFRegistration();
	}

	public static CompilationUnitImpl getCompilationUnitInternal(
			NamedElement element) {
		return (CompilationUnitImpl) element.getCompilationUnit();
	}

	public static ITreeAppendable createAppendable() {
		return new FakeTreeAppendable();
	}
}
{'fraction_non_alphanumeric': 0.08240887480190175, 'fraction_numerical': 0.000792393026941363, 'mean_word_length': 5.936813186813187, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7255873', 'n_tokens_mistral': 800, 'n_tokens_neox': 767, 'n_words': 172}