Commit 8894f5b5 authored by Philip Makedonski's avatar Philip Makedonski
Browse files

* deactivate information messages on cyclic calls, #19

parent 5935e224
Loading
Loading
Loading
Loading
+31 −27
Original line number Diff line number Diff line
@@ -1023,20 +1023,22 @@ class CodeStyleValidator extends AbstractDeclarativeValidator {

		for (f : parent.getAllContentsOfType(FunctionInstance).map[it.ref]) {
			if (consideredAltOrFunc.contains(f)) {
				statistics.incrementCountStyle
				val message = "" + "Possible cyclic call sequence: \"" + f.name + "\". Skipping..."
				val INode node = NodeModelUtils.getNode(f)
				info(
					message,
					f,
//					consideredAltOrFunc.first,
					null,
					MessageClass.STYLE.toString,
					node.startLine.toString,
					node.endLine.toString,
					"6.13, " + "collectReferencedFunctionsAndAltsteps",
					LogLevel.INFORMATION.toString
				);
				//TODO: this is unreliable indicator -> skip, also causes issues with logging
//				statistics.incrementCountStyle
//				val message = "" + "Possible cyclic call sequence: \"" + f.name + "\". Skipping..."
//				val INode node = NodeModelUtils.getNode(f)
//				info(
//					message,
////					f, //no longer permitted
//					parent,
////					consideredAltOrFunc.first,
//					null,
//					MessageClass.STYLE.toString,
//					node.startLine.toString,
//					node.endLine.toString,
//					"6.13, " + "collectReferencedFunctionsAndAltsteps",
//					LogLevel.INFORMATION.toString
//				);
			} else {
				nextLevelCheck.add(f)
			}
@@ -1044,19 +1046,21 @@ class CodeStyleValidator extends AbstractDeclarativeValidator {

		for (a : parent.getAllContentsOfType(AltstepInstance).map[it.ref]) {
			if (consideredAltOrFunc.contains(a)) {
				statistics.incrementCountStyle
				val message = "" + "Possible cyclic call sequence: \"" + a.name + "\". Skipping..."
				val INode node = NodeModelUtils.getNode(a)
				info(
					message,
					a,
					null,
					MessageClass.STYLE.toString,
					node.startLine.toString,
					node.endLine.toString,
					"6.13, " + "collectReferencedFunctionsAndAltsteps",
					LogLevel.INFORMATION.toString
				);
				//TODO: this is unreliable indicator -> skip, also causes issues with logging
//				statistics.incrementCountStyle
//				val message = "" + "Possible cyclic call sequence: \"" + a.name + "\". Skipping..."
//				val INode node = NodeModelUtils.getNode(a)
//				info(
//					message,
////					a, //no longer permitted
//					parent,
//					null,
//					MessageClass.STYLE.toString,
//					node.startLine.toString,
//					node.endLine.toString,
//					"6.13, " + "collectReferencedFunctionsAndAltsteps",
//					LogLevel.INFORMATION.toString
//				);
			} else {
				nextLevelCheck.add(a)
			}