From d0b05897136426e9e7add7c0d296486ee59d1d41 Mon Sep 17 00:00:00 2001
From: Vincent Aravantinos <aravantinos@fortiss.org>
Date: Wed, 4 May 2016 16:32:17 +0000
Subject: [PATCH] Persistency service does not return dummy projects anymore.
 Seems reasonable but let's see if somebody relies on this somewhere... refs
 2553

---
 .../tooling/kernel/internal/PersistencyService.java       | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PersistencyService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PersistencyService.java
index d9dbf9feb..a18572981 100644
--- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PersistencyService.java
+++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PersistencyService.java
@@ -32,7 +32,9 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
+import org.conqat.lib.commons.collections.CollectionUtils;
 import org.conqat.lib.commons.collections.UnmodifiableList;
 import org.eclipse.core.resources.WorkspaceJob;
 import org.eclipse.core.runtime.CoreException;
@@ -63,7 +65,7 @@ import org.osgi.framework.Bundle;
  * @author hoelzl
  * @author $Author$
  * @version $Rev$
- * @ConQAT.Rating YELLOW Hash: 8DEBAB54DBCCDEFE11E26C58CE999DB0
+ * @ConQAT.Rating YELLOW Hash: 23E60A2C8958B99893C8108307551BBE
  */
 public class PersistencyService implements IPersistencyService, IIntrospectiveKernelService {
 
@@ -120,7 +122,9 @@ public class PersistencyService implements IPersistencyService, IIntrospectiveKe
 					.filter(t -> t.getRootModelElement() == activeRootElement)
 					.collect(Collectors.toList()));
 		}
-		return asUnmodifiable(elementCache);
+		Stream<ITopLevelElement> noDummy =
+				elementCache.stream().filter(elt -> !(elt instanceof DummyTopLevelElement));
+		return CollectionUtils.asUnmodifiable(noDummy.collect(Collectors.toList()));
 	}
 
 	/** {@inheritDoc} */
-- 
GitLab