From 062c24495ddc4f1f9494a2490967a42b25675cb6 Mon Sep 17 00:00:00 2001
From: dgelessus <dgelessus@users.noreply.github.com>
Date: Tue, 2 Jul 2024 13:53:58 +0200
Subject: [PATCH] Fix new compilation errors related to getChildren() list
 types

The variables expect List<SomeType> exactly, but getChildren() now
returns List<? extends SomeType>, which is not compatible and so causes
a compile error.

I'm guessing that at some point in the past, getChildren() didn't return
the correct generic type, so the intermediate variables with explicit
generic types were added as a workaround. Now that it has a proper
return type, the intermediate variables are no longer necessary.
---
 .../de/prob/ui/ltl/CounterExamplePropositionFigure.java    | 7 +------
 de.prob.ui/src/de/prob/ui/ltl/CounterExampleTab.java       | 7 +------
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/de.prob.ui/src/de/prob/ui/ltl/CounterExamplePropositionFigure.java b/de.prob.ui/src/de/prob/ui/ltl/CounterExamplePropositionFigure.java
index 49542819..b5fbdd2e 100644
--- a/de.prob.ui/src/de/prob/ui/ltl/CounterExamplePropositionFigure.java
+++ b/de.prob.ui/src/de/prob/ui/ltl/CounterExamplePropositionFigure.java
@@ -95,12 +95,7 @@ public abstract class CounterExamplePropositionFigure extends Figure implements
 			final IFigure parent = getParent();
 
 			if (parent != null) {
-				// We know that each element is of type
-				// IFigure, but IFigure.getParent() returns just a list
-				@SuppressWarnings("unchecked")
-				final List<IFigure> figures = parent.getChildren();
-
-				for (IFigure figure : figures) {
+				for (IFigure figure : parent.getChildren()) {
 					if (figure instanceof CounterExamplePropositionFigure) {
 						if (((CounterExamplePropositionFigure) figure)
 								.getModel().equals(proposition)) {
diff --git a/de.prob.ui/src/de/prob/ui/ltl/CounterExampleTab.java b/de.prob.ui/src/de/prob/ui/ltl/CounterExampleTab.java
index 038ed22b..b1ccd579 100644
--- a/de.prob.ui/src/de/prob/ui/ltl/CounterExampleTab.java
+++ b/de.prob.ui/src/de/prob/ui/ltl/CounterExampleTab.java
@@ -310,12 +310,7 @@ public class CounterExampleTab {
 
 			treeViewer.refresh();
 			tableViewer.refresh();
-			// We know that each element is of type
-			// EditPart, but AbstractEditPart.getChildren() returns just
-			// a list
-			@SuppressWarnings("unchecked")
-			List<EditPart> children = rootEditPart.getChildren();
-			for (EditPart child : children) {
+			for (EditPart child : rootEditPart.getChildren()) {
 				child.refresh();
 			}
 
-- 
GitLab