<commit_before>package org.yakindu.sct.model.stext.naming;

import org.eclipse.xtext.naming.IQualifiedNameConverter;
import org.eclipse.xtext.naming.QualifiedName;
import org.eclipse.xtext.util.Strings;
import org.yakindu.sct.model.sgraph.naming.SGraphNameProvider;
import org.yakindu.sct.model.stext.stext.InterfaceScope;

import com.google.inject.Inject;

public class StextNameProvider extends SGraphNameProvider {
	@Inject
	IQualifiedNameConverter nameConverter;

	QualifiedName qualifiedName(InterfaceScope ele) {
		QualifiedName name = null;
		if (!Strings.isEmpty(ele.getName())) {
			name = nameConverter.toQualifiedName(ele.getName());
		} else if (ele.getName() == null) {
			// Default interface
			name = nameConverter.toQualifiedName("default");
		}

		QualifiedName namespace = getNamespace(ele);
		if (namespace != null && name != null) {
			name = namespace.append(name);
		}
		return name;
	}
}<commit_msg>Nameprovider für Interfaces angepasst<commit_after>package org.yakindu.sct.model.stext.naming;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.EcoreUtil2;
import org.eclipse.xtext.naming.IQualifiedNameConverter;
import org.eclipse.xtext.naming.QualifiedName;
import org.eclipse.xtext.util.Strings;
import org.yakindu.sct.model.sgraph.naming.SGraphNameProvider;
import org.yakindu.sct.model.stext.stext.InterfaceScope;

import com.google.inject.Inject;

public class StextNameProvider extends SGraphNameProvider {
	@Inject
	IQualifiedNameConverter nameConverter;

	QualifiedName qualifiedName(InterfaceScope ele) {
		QualifiedName name = null;
		if (!Strings.isEmpty(ele.getName())) {
			name = nameConverter.toQualifiedName(ele.getName());
		} else if (ele.getName() == null) {
			// Default interface
			name = nameConverter.toQualifiedName("default");
		}

		QualifiedName namespace = getNamespace(ele);
		if (namespace != null && name != null) {
			name = namespace.append(name);
		}
		return name;
	}

	protected QualifiedName getNamespace(EObject child) {
		QualifiedName name = super.getNamespace(child);
		if (!(child instanceof InterfaceScope)) {
			InterfaceScope interfaceScope = EcoreUtil2.getContainerOfType(
					child, InterfaceScope.class);
			if (interfaceScope != null
					&& getFullyQualifiedName(interfaceScope) != null) {
				name = getFullyQualifiedName(interfaceScope);
			}
		}
		return name;
	}
}
{'fraction_non_alphanumeric': 0.11313559322033899, 'fraction_numerical': 0.000847457627118644, 'mean_word_length': 5.10077519379845, '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': '3441964', 'n_tokens_mistral': 808, 'n_tokens_neox': 751, 'n_words': 136}