@Check public void checkUniqueIntentsInRefinement(final Refinement refinement) { final HashSet<String> visitedIntentTypeNames = CollectionLiterals.<String>newHashSet(); EList<Intent> intents = refinement.getIntents(); ListIterator<Intent> i = intents.listIterator(); while (i.hasNext()) { { Intent _next = i.next(); Intent d = ((Intent) _next); IntentType _type = d.getType(); String typeName = _type.getTypeName(); boolean _contains = visitedIntentTypeNames.contains(typeName); if (_contains) { EReference _refinement_Intents = IntentSpecificationPackage.eINSTANCE.getRefinement_Intents(); String _name = d.getName(); this.warning( (("duplicate intent type \'" + typeName) + "\' in refinement"), _refinement_Intents, IntentSpecificationValidator.UNIQUE_INTENTS_REFINEMENT, _name); } visitedIntentTypeNames.add(typeName); } } }
@Check public void checkUniqueDecompositionInIntent(final Intent intent) { final HashSet<String> visitedDecompositionTypeNames = CollectionLiterals.<String>newHashSet(); EList<Decomposition> decompositions = intent.getDecompositions(); ListIterator<Decomposition> i = decompositions.listIterator(); while (i.hasNext()) { { Decomposition _next = i.next(); Decomposition d = ((Decomposition) _next); DecompositionType _type = d.getType(); String typeName = _type.getTypeName(); boolean _contains = visitedDecompositionTypeNames.contains(typeName); if (_contains) { EReference _intent_Decompositions = IntentSpecificationPackage.eINSTANCE.getIntent_Decompositions(); String _name = d.getName(); this.warning( (("duplicate decomposition type \'" + typeName) + "\' in intent"), _intent_Decompositions, IntentSpecificationValidator.UNIQUE_DECOMPOSITION_INTENT, _name); } visitedDecompositionTypeNames.add(typeName); } } }