Commit a3e69430 authored by Daniel Honsel's avatar Daniel Honsel
Browse files

fixed output of checkNoAllKeywordInPortDefinitions

parent 3b578aba
Loading
Loading
Loading
Loading
+37 −25
Original line number Diff line number Diff line
@@ -240,33 +240,43 @@ class StructureOfDataValidator extends AbstractDeclarativeValidator {
		if (!activeProfile.checkNoAllKeywordInPortDefinitions)
			return;

		val INode node = NodeModelUtils.getNode(port)
		var allIsUsed = false;
		val procOrTypeList = port.body.attribs.getAllContentsOfType(ProcOrTypeList)
		val allOrSignatureList = port.body.attribs.getAllContentsOfType(AllOrSignatureList)
		val allOrTypeList = port.body.attribs.getAllContentsOfType(AllOrTypeList)
		for (a : procOrTypeList) {
			if (a.all != null) {
				allIsUsed = true
				TTCN3StatisticsProvider.getInstance.incrementCountStructure
				val INode node = NodeModelUtils.getNode(a)
				val message = "\"all\" keyword is used in the definition of port \"" + port.name + "\"!"
				warning(
					message,
					TTCN3Package.eINSTANCE.TTCN3Reference_Name,
					MessageClass.STRUCTURE.toString,
					node.startLine.toString,
					node.endLine.toString,
					"4.2.1, " + MiscTools.getMethodName()
				);
			}
		}
		if (!allIsUsed) {
		for (a : allOrSignatureList) {
			if (a.all != null) {
					allIsUsed = true
				}
				TTCN3StatisticsProvider.getInstance.incrementCountStructure
				val INode node = NodeModelUtils.getNode(a)
				val message = "\"all\" keyword is used in the definition of port \"" + port.name + "\"!"
				warning(
					message,
					TTCN3Package.eINSTANCE.TTCN3Reference_Name,
					MessageClass.STRUCTURE.toString,
					node.startLine.toString,
					node.endLine.toString,
					"4.2.1, " + MiscTools.getMethodName()
				);
			}
		}
		if (!allIsUsed) {
		for (a : allOrTypeList) {
			if (a.all != null) {
					allIsUsed = true
				}
			}
		}

		if (allIsUsed) {
				TTCN3StatisticsProvider.getInstance.incrementCountStructure
				val INode node = NodeModelUtils.getNode(a)
				val message = "\"all\" keyword is used in the definition of port \"" + port.name + "\"!"
				warning(
					message,
@@ -279,6 +289,8 @@ class StructureOfDataValidator extends AbstractDeclarativeValidator {
			}
		}

	}

	override register(EValidatorRegistrar registrar) {
		//not needed for classes used as ComposedCheck
	}