Corrected validation for hierarchical scheduler allocations.

Now only considers the closest ancestor that has specified
responsibilities.

Signed-off-by: Raphael Weber <raphael.weber@vector.com>
diff --git a/plugins/org.eclipse.app4mc.amalthea.validations.standard/src/org/eclipse/app4mc/amalthea/validations/standard/misc/AmMappingSchedulerAllocationHierarchy.java b/plugins/org.eclipse.app4mc.amalthea.validations.standard/src/org/eclipse/app4mc/amalthea/validations/standard/misc/AmMappingSchedulerAllocationHierarchy.java
index 59eb7e7..a5abe50 100644
--- a/plugins/org.eclipse.app4mc.amalthea.validations.standard/src/org/eclipse/app4mc/amalthea/validations/standard/misc/AmMappingSchedulerAllocationHierarchy.java
+++ b/plugins/org.eclipse.app4mc.amalthea.validations.standard/src/org/eclipse/app4mc/amalthea/validations/standard/misc/AmMappingSchedulerAllocationHierarchy.java
@@ -66,7 +66,7 @@
 				parent.getSchedulerAllocations().stream().map(SchedulerAllocation::getResponsibility)
 					.forEach(ancestorResponsibilities::addAll);
 				parent = parent.getParentScheduler();
-			} while (null != parent);
+			} while (ancestorResponsibilities.isEmpty() && null != parent);
 			
 			if (false == ancestorResponsibilities.containsAll(sall.getResponsibility())) {
 				addIssue(results, sall, ePackage.getSchedulerAllocation_Responsibility(), objectInfo(sall)
diff --git a/tests/org.eclipse.app4mc.amalthea.validations.standard.tests/src/org/eclipse/app4mc/amalthea/validations/standard/tests/MappingModelTests.xtend b/tests/org.eclipse.app4mc.amalthea.validations.standard.tests/src/org/eclipse/app4mc/amalthea/validations/standard/tests/MappingModelTests.xtend
index b02d5da..0a3c58c 100644
--- a/tests/org.eclipse.app4mc.amalthea.validations.standard.tests/src/org/eclipse/app4mc/amalthea/validations/standard/tests/MappingModelTests.xtend
+++ b/tests/org.eclipse.app4mc.amalthea.validations.standard.tests/src/org/eclipse/app4mc/amalthea/validations/standard/tests/MappingModelTests.xtend
@@ -444,10 +444,10 @@
 				]
 				schedulerAllocation [
 					scheduler = _find(TaskScheduler, "c2_scheduler_ok")
-					responsibility += #[_find(ProcessingUnit, "core2"), _find(ProcessingUnit, "core3")]
+					responsibility += #[_find(ProcessingUnit, "core2")]
 				]
 				schedulerAllocation [
-					scheduler = _find(TaskScheduler, "c3_scheduler_notOk") // ancestors do not schedule core6
+					scheduler = _find(TaskScheduler, "c3_scheduler_notOk") // ancestor a1 does not schedule core6
 					responsibility += #[_find(ProcessingUnit, "core4"), _find(ProcessingUnit, "core6")]
 				]
 				schedulerAllocation [
@@ -456,18 +456,18 @@
 				]
 				schedulerAllocation [
 					scheduler = _find(TaskScheduler, "d1_scheduler_ok")
-					responsibility += _find(ProcessingUnit, "core3")
+					responsibility += _find(ProcessingUnit, "core2")
 				]
 				schedulerAllocation [
-					scheduler = _find(TaskScheduler, "d2_scheduler_notOk") // ancestors do not schedule core6
-					responsibility += _find(ProcessingUnit, "core6")
+					scheduler = _find(TaskScheduler, "d2_scheduler_notOk") // ancestor b1 does not schedule core3
+					responsibility += _find(ProcessingUnit, "core3")
 				]
 				schedulerAllocation [
 					scheduler = _find(TaskScheduler, "a2_scheduler_ok")
 					responsibility += _find(ProcessingUnit, "core6")
 				]
 				schedulerAllocation [
-					scheduler = _find(TaskScheduler, "c6_scheduler_notOk") // ancestors do not schedule core5
+					scheduler = _find(TaskScheduler, "c6_scheduler_notOk") // ancestor a2 does not schedule core5
 					responsibility += #[_find(ProcessingUnit, "core5"), _find(ProcessingUnit, "core6")]
 				]
 				schedulerAllocation [
diff --git a/tests/org.eclipse.app4mc.amalthea.validations.standard.tests/xtend-gen/org/eclipse/app4mc/amalthea/validations/standard/tests/MappingModelTests.java b/tests/org.eclipse.app4mc.amalthea.validations.standard.tests/xtend-gen/org/eclipse/app4mc/amalthea/validations/standard/tests/MappingModelTests.java
index 8024db4..a831e96 100644
--- a/tests/org.eclipse.app4mc.amalthea.validations.standard.tests/xtend-gen/org/eclipse/app4mc/amalthea/validations/standard/tests/MappingModelTests.java
+++ b/tests/org.eclipse.app4mc.amalthea.validations.standard.tests/xtend-gen/org/eclipse/app4mc/amalthea/validations/standard/tests/MappingModelTests.java
@@ -741,8 +741,7 @@
           it_2.setScheduler(this.b1.<TaskScheduler>_find(it_2, TaskScheduler.class, "c2_scheduler_ok"));
           EList<ProcessingUnit> _responsibility = it_2.getResponsibility();
           ProcessingUnit __find = this.b1.<ProcessingUnit>_find(it_2, ProcessingUnit.class, "core2");
-          ProcessingUnit __find_1 = this.b1.<ProcessingUnit>_find(it_2, ProcessingUnit.class, "core3");
-          Iterables.<ProcessingUnit>addAll(_responsibility, Collections.<ProcessingUnit>unmodifiableList(CollectionLiterals.<ProcessingUnit>newArrayList(__find, __find_1)));
+          Iterables.<ProcessingUnit>addAll(_responsibility, Collections.<ProcessingUnit>unmodifiableList(CollectionLiterals.<ProcessingUnit>newArrayList(__find)));
         };
         this.b5.schedulerAllocation(it_1, _function_6);
         final Procedure1<SchedulerAllocation> _function_7 = (SchedulerAllocation it_2) -> {
@@ -764,14 +763,14 @@
         final Procedure1<SchedulerAllocation> _function_9 = (SchedulerAllocation it_2) -> {
           it_2.setScheduler(this.b1.<TaskScheduler>_find(it_2, TaskScheduler.class, "d1_scheduler_ok"));
           EList<ProcessingUnit> _responsibility = it_2.getResponsibility();
-          ProcessingUnit __find = this.b1.<ProcessingUnit>_find(it_2, ProcessingUnit.class, "core3");
+          ProcessingUnit __find = this.b1.<ProcessingUnit>_find(it_2, ProcessingUnit.class, "core2");
           _responsibility.add(__find);
         };
         this.b5.schedulerAllocation(it_1, _function_9);
         final Procedure1<SchedulerAllocation> _function_10 = (SchedulerAllocation it_2) -> {
           it_2.setScheduler(this.b1.<TaskScheduler>_find(it_2, TaskScheduler.class, "d2_scheduler_notOk"));
           EList<ProcessingUnit> _responsibility = it_2.getResponsibility();
-          ProcessingUnit __find = this.b1.<ProcessingUnit>_find(it_2, ProcessingUnit.class, "core6");
+          ProcessingUnit __find = this.b1.<ProcessingUnit>_find(it_2, ProcessingUnit.class, "core3");
           _responsibility.add(__find);
         };
         this.b5.schedulerAllocation(it_1, _function_10);