From 54777e1c024823f14a34585b87c41e1358c39035 Mon Sep 17 00:00:00 2001
From: Tiziano Munaro <munaro@fortiss.org>
Date: Mon, 25 Sep 2023 13:22:21 +0200
Subject: [PATCH] GREEN/RED

Issue-Ref: 4324
Issue-Url: https://git.fortiss.org/af3/af3/-/issues/4324

Signed-off-by: Tiziano Munaro <munaro@fortiss.org>
---
 .../src/org/fortiss/tooling/ext/reuse/.ratings                 | 2 +-
 .../src/org/fortiss/tooling/kernel/internal/.ratings           | 2 +-
 .../tooling/kernel/internal/ConstraintCheckerService.java      | 3 +++
 .../src/org/fortiss/tooling/kernel/service/.ratings            | 2 +-
 4 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/org.fortiss.tooling.ext.reuse/src/org/fortiss/tooling/ext/reuse/.ratings b/org.fortiss.tooling.ext.reuse/src/org/fortiss/tooling/ext/reuse/.ratings
index 691c1eb71..da06f1f9f 100644
--- a/org.fortiss.tooling.ext.reuse/src/org/fortiss/tooling/ext/reuse/.ratings
+++ b/org.fortiss.tooling.ext.reuse/src/org/fortiss/tooling/ext/reuse/.ratings
@@ -1 +1 @@
-ToolingReuseActivator.java 52b9208684334f60ee8c0bc074c86f06f6248227 YELLOW
+ToolingReuseActivator.java 52b9208684334f60ee8c0bc074c86f06f6248227 GREEN
diff --git a/org.fortiss.tooling.kernel/src/org/fortiss/tooling/kernel/internal/.ratings b/org.fortiss.tooling.kernel/src/org/fortiss/tooling/kernel/internal/.ratings
index 04e9ad025..6af5a8844 100644
--- a/org.fortiss.tooling.kernel/src/org/fortiss/tooling/kernel/internal/.ratings
+++ b/org.fortiss.tooling.kernel/src/org/fortiss/tooling/kernel/internal/.ratings
@@ -1,7 +1,7 @@
 CommandLineInterfaceService.java 6b5c94c52702f773c60b181eff52204ab379b248 GREEN
 CommandStackService.java 957bda69b5feb91f002aed4d25ed334e92801e7e GREEN
 ConnectionCompositorService.java 5a52f8a3e88c167ae6909c3d9eb3fb4706177e8b GREEN
-ConstraintCheckerService.java 4f6f11949433f8dc76c00c2eb6d56bf277378954 YELLOW
+ConstraintCheckerService.java 94f1c07c37520161065128d8faaab10ab0c041b0 RED
 DummyTopLevelElement.java 21807bbdafec2e0ef28f0ee9090218f90bd73aee GREEN
 ElementCompositorService.java b1924b5b349118a70149cfac5b48544897d26e9e GREEN
 LoggingService.java da784259f7b456b54bf75c41ec268f64919ce78d GREEN
diff --git a/org.fortiss.tooling.kernel/src/org/fortiss/tooling/kernel/internal/ConstraintCheckerService.java b/org.fortiss.tooling.kernel/src/org/fortiss/tooling/kernel/internal/ConstraintCheckerService.java
index 4f6f11949..94f1c07c3 100644
--- a/org.fortiss.tooling.kernel/src/org/fortiss/tooling/kernel/internal/ConstraintCheckerService.java
+++ b/org.fortiss.tooling.kernel/src/org/fortiss/tooling/kernel/internal/ConstraintCheckerService.java
@@ -132,6 +132,9 @@ public class ConstraintCheckerService extends EObjectAwareServiceBase<IConstrain
 
 		// Skip constraint checks if the given element itself is excluded from checks or if it
 		// exists within an excluded element.
+		// TODO (TM): Looking through all parents for each excluded type introduces quite an
+		// overhead. As the list of parents is never used, memory and runtime overhead can be
+		// reduced by using `getFirstParentWithType` or, even better, `isAncestor` instead.
 		for(Class<? extends EObject> excludedClass : constraintCheckExclusionTypes) {
 			List<? extends EObject> foundExcludedParents =
 					getParentsWithType(modelElement, excludedClass);
diff --git a/org.fortiss.tooling.kernel/src/org/fortiss/tooling/kernel/service/.ratings b/org.fortiss.tooling.kernel/src/org/fortiss/tooling/kernel/service/.ratings
index 06a3d8d9b..3697f4eff 100644
--- a/org.fortiss.tooling.kernel/src/org/fortiss/tooling/kernel/service/.ratings
+++ b/org.fortiss.tooling.kernel/src/org/fortiss/tooling/kernel/service/.ratings
@@ -1,7 +1,7 @@
 ICommandLineInterfaceService.java c3e3ba08b2a1b8125b43abd1c29b7dc0a0be2b80 GREEN
 ICommandStackService.java 678dcd1a6ab435ed0870fa2a9ec48ce47f25a187 GREEN
 IConnectionCompositorService.java 0cdf4568b2cd3e95ea195df90a84699eff36442b GREEN
-IConstraintCheckerService.java dc04965ac0265f77cb846f472d76620fb05a491a YELLOW
+IConstraintCheckerService.java dc04965ac0265f77cb846f472d76620fb05a491a GREEN
 IEclipseResourceStorageService.java b1155ca15cd9474d4d533d6cb2725e8a22040ec9 GREEN
 IElementCompositorService.java acd462ec15f3bcc247b544b46ceebee971fe1408 GREEN
 IKernelIntrospectionSystemService.java 7005c3acb4c6f978729d93279c595765e94e38eb GREEN
-- 
GitLab