Commit 5487357b authored by Daniel Honsel's avatar Daniel Honsel
Browse files

fixed false positive check over specified runs on

parent b1496df1
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -823,6 +823,8 @@ class CodeStyleValidator extends AbstractDeclarativeValidator {
			return;
		}
		
		
		
		val overSpecifiedFirstLevel = !component.isReferencedComponentSpec(parent)
		val message = "Definition for \"" + (parent as TTCN3Reference).name +
			"\" contains an over specific runs on clause!"
@@ -923,8 +925,11 @@ class CodeStyleValidator extends AbstractDeclarativeValidator {
				if (o instanceof FunctionDef) {
					if (o.runsOn != null) {
						if (o.specifiedComponentResolved(o.runsOn.component)) {
							if (o.runsOn.component.isReferencedComponentSpec(o))
							if (o.runsOn.component.isReferencedComponentSpec(o)) {
								return true
							} else {
								nextLevelCheck = o.nextLevelFunctionsOrAltsteps(consideredAltOrFunc)
							}
						}
					} else {
						// TODO: error message?
@@ -932,14 +937,16 @@ class CodeStyleValidator extends AbstractDeclarativeValidator {
				} else if (o instanceof AltstepDef) {
					if (o.spec != null) {
						if (o.specifiedComponentResolved(o.spec.component)) {
							if (o.spec.component.isReferencedComponentSpec(o))
							if (o.spec.component.isReferencedComponentSpec(o)) {
								return true
							} else {
								nextLevelCheck = o.nextLevelFunctionsOrAltsteps(consideredAltOrFunc)
							}
						}
					} else {
						// TODO: error message?
					}
				}
				nextLevelCheck = o.nextLevelFunctionsOrAltsteps(consideredAltOrFunc)
			}
		} while (!nextLevelCheck.empty)