[582958] Avoid inflicting ASResource as a Sirius semanticResource
diff --git a/plugins/org.eclipse.ocl.pivot.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.ocl.pivot.ui/META-INF/MANIFEST.MF
index 00eb997..a27fc81 100644
--- a/plugins/org.eclipse.ocl.pivot.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.ocl.pivot.ui/META-INF/MANIFEST.MF
@@ -10,7 +10,8 @@
  org.eclipse.xtext.ui.shared;bundle-version="[2.9.0,3.0.0)";visibility:=reexport,
  org.eclipse.ocl.pivot;bundle-version="[1.3.0,2.0.0)";visibility:=reexport,
  org.eclipse.ocl.xtext.completeocl.ui;bundle-version="[1.3.0,2.0.0)",
- org.eclipse.ocl.xtext.oclstdlib.ui;bundle-version="[1.3.0,2.0.0)"
+ org.eclipse.ocl.xtext.oclstdlib.ui;bundle-version="[1.3.0,2.0.0)",
+ org.eclipse.sirius;bundle-version="7.3.0";resolution:=optional
 Export-Package: org.eclipse.ocl.pivot.ui,
  org.eclipse.ocl.pivot.ui.builder,
  org.eclipse.ocl.pivot.ui.internal.preferences;x-internal:=true,
diff --git a/plugins/org.eclipse.ocl.pivot.ui/plugin.xml b/plugins/org.eclipse.ocl.pivot.ui/plugin.xml
index e38a9e9..3d646d1 100644
--- a/plugins/org.eclipse.ocl.pivot.ui/plugin.xml
+++ b/plugins/org.eclipse.ocl.pivot.ui/plugin.xml
@@ -144,4 +144,7 @@
       <factory uri="http://www.eclipse.org/OCL/Import"
             class="org.eclipse.emf.ecore.provider.annotation.EAnnotationItemProviderAdapterFactory$Reflective"/>
    </extension>
+   <extension point="org.eclipse.sirius.resourceStrategy">
+      <resourceStrategy class="org.eclipse.ocl.pivot.ui.OCLNotAResourceStrategyImpl"/>
+   </extension>
 </plugin>
diff --git a/plugins/org.eclipse.ocl.pivot.ui/src/org/eclipse/ocl/pivot/ui/OCLNotAResourceStrategyImpl.java b/plugins/org.eclipse.ocl.pivot.ui/src/org/eclipse/ocl/pivot/ui/OCLNotAResourceStrategyImpl.java
new file mode 100644
index 0000000..c141764
--- /dev/null
+++ b/plugins/org.eclipse.ocl.pivot.ui/src/org/eclipse/ocl/pivot/ui/OCLNotAResourceStrategyImpl.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2024 Willink Transformations and others.
+ * All rights reserved.   This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v2.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v20.html
+ *
+ * Contributors:
+ *   E.D.Willink - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ocl.pivot.ui;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.sirius.business.api.resource.strategy.AbstractResourceStrategyImpl;
+import org.eclipse.sirius.business.api.session.Session;
+
+/**
+ * OCLNotAResourceStrategyImpl provides the OCL-specific implementation of the Sirius AbstractResourceStrategyImpl
+ * to prevent *.oclas files being loaded as Sirius semantic resources. See Bug 582958.
+ * <p>
+ * A more elegant solution could be available if Sirius responds to
+ * https://github.com/eclipse-sirius/sirius-desktop/issues/301
+ * by providing a parameterizable NotAResourceStrategyImpl.
+ */
+public class OCLNotAResourceStrategyImpl extends AbstractResourceStrategyImpl
+{
+	@Override
+	public boolean canHandle(URI resourceURI, ResourceStrategyType resourceStrategyType) {
+		if ("oclas".equals(resourceURI.fileExtension())) {
+			return true;
+		}
+		return false;
+	}
+
+	@Override
+	public boolean canHandle(Resource resource, ResourceStrategyType resourceStrategyType) {
+		return canHandle(resource.getURI(), resourceStrategyType);
+	}
+
+	@Override
+	public boolean isPotentialSemanticResource(URI uri) {
+		return true;
+	}
+
+	@Override
+	public boolean isLoadableModel(URI uri, Session session) {
+		return false;
+	}
+
+}
diff --git a/plugins/org.eclipse.ocl.pivot/src/org/eclipse/ocl/pivot/internal/resource/ASResourceImpl.java b/plugins/org.eclipse.ocl.pivot/src/org/eclipse/ocl/pivot/internal/resource/ASResourceImpl.java
index 774d82f..17c8cc7 100644
--- a/plugins/org.eclipse.ocl.pivot/src/org/eclipse/ocl/pivot/internal/resource/ASResourceImpl.java
+++ b/plugins/org.eclipse.ocl.pivot/src/org/eclipse/ocl/pivot/internal/resource/ASResourceImpl.java
@@ -17,6 +17,7 @@
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.log4j.Logger;
 import org.eclipse.emf.common.notify.Notification;
 import org.eclipse.emf.common.notify.NotificationChain;
 import org.eclipse.emf.common.notify.Notifier;
@@ -74,6 +75,8 @@
 	 */
 	public static boolean SKIP_CHECK_BAD_REFERENCES = false;
 
+	private static final Logger logger = Logger.getLogger(ASResourceImpl.class);
+
 	/**
 	 * An adapter implementation for tracking resource modification. This is only in use if the
 	 * "resource/checkImmutability" .option is set as is the case for JUnit tests.
@@ -277,11 +280,28 @@
 
 	/**
 	 * Overridden to ensure that the ResourceFactoryRegistry ExtensionToFactoryMap entries for AS file extensions
-	 * have ASResourceFactory instnaces that are able to fall back from AS extension to CS extension using the
+	 * have ASResourceFactory instances that are able to fall back from AS extension to CS extension using the
 	 * resourceSet as the AS ResourceSet for OCL parsing.
+	 * <.P
+	 * As a workaround for Sirius issues wrt Bug 582958, addition of an ASResource to a ResourceSet
+	 * containing a *.aird file is suppressed and an explanatory note added to the error log.
 	 */
 	@Override
 	public NotificationChain basicSetResourceSet(ResourceSet resourceSet, NotificationChain notifications) {
+		if (resourceSet != null) {
+			for (Resource resource : resourceSet.getResources()) {
+				if (!(resource instanceof ASResource)) {
+					URI resourceURI = resource.getURI();
+					if ((resourceURI != null) && "aird".equals(resourceURI.fileExtension())) {
+						resourceSet.getResources().remove(this);
+						logger.warn("Excluded " + resource.getClass().getSimpleName() + " \"" + uri + "\" from Sirius ResourceSet.\n" +
+						" To prevent repeated occurrence, open \"" + resourceURI + "\" with a text editor\n" +
+						" and delete the <semanticResources> line for \"" + uri + "\".");
+						return notifications;
+					}
+				}
+			}
+		}
 		NotificationChain notificationChain = super.basicSetResourceSet(resourceSet, notifications);
 		if (resourceSet != null) {
 			String fileExtension = getURI().fileExtension();
diff --git a/releng/org.eclipse.ocl.releng.tycho/targetPlatforms/interim.target b/releng/org.eclipse.ocl.releng.tycho/targetPlatforms/interim.target
index fd2b8b4..4a5f6d1 100644
--- a/releng/org.eclipse.ocl.releng.tycho/targetPlatforms/interim.target
+++ b/releng/org.eclipse.ocl.releng.tycho/targetPlatforms/interim.target
@@ -11,18 +11,37 @@
     <repository location="https://download.eclipse.org/modeling/emf/emf/builds/milestone"/>
   </location>
   <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+    <unit id="org.eclipse.emf.transaction" version="0.0.0"/>
+    <!--repository location="https://download.eclipse.org/modeling/emf/validation/updates/interim"/-->
+    <repository location="https://download.eclipse.org/modeling/emf/transaction/updates/releases/R202208110935"/>
+  </location>
+  <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
     <unit id="org.eclipse.emf.validation" version="0.0.0"/>
     <repository location="https://download.eclipse.org/modeling/emf/validation/updates/releases/R202305230712"/>
   </location>
   <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+    <unit id="org.eclipse.draw2d" version="0.0.0"/>
+    <repository location="https://download.eclipse.org/tools/gef/classic/release/3.18.0"/>
+  </location>
+  <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+    <unit id="org.eclipse.gmf.runtime.notation.sdk.feature.group" version="0.0.0"/>
+    <!--repository location="https://download.eclipse.org/modeling/emf/validation/updates/interim"/-->
+    <repository location="https://download.eclipse.org/modeling/gmp/gmf-notation/updates/releases/R202211151334"/>
+  </location>
+  <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+    <unit id="org.eclipse.gmf.feature.group" version="0.0.0"/>
+    <!--repository location="https://download.eclipse.org/modeling/emf/validation/updates/interim"/-->
+    <repository location="https://download.eclipse.org/modeling/gmp/gmf-runtime/updates/releases/R202311130907"/>
+  </location>
+  <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
     <unit id="org.eclipse.uml2.sdk.feature.group" version="0.0.0"/>
     <repository location="https://download.eclipse.org/modeling/mdt/uml2/updates/interim"/>
     <repository location="https://download.eclipse.org/modeling/mdt/uml2/updates/milestones"/>
     <repository location="https://download.eclipse.org/modeling/mdt/uml2/updates/5.4"/>
   </location>
   <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
-    <unit id="org.eclipse.draw2d" version="0.0.0"/>
-    <repository location="https://download.eclipse.org/tools/gef/classic/releases/latest"/>
+    <unit id="org.eclipse.sirius.runtime.feature.group" version="0.0.0"/>
+    <repository location="https://download.eclipse.org/sirius/updates/releases/7.3.0/2023-03"/>
   </location>
   <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
     <unit id="org.eclipse.xtend.sdk.feature.group" version="0.0.0"/>
diff --git a/releng/org.eclipse.ocl.releng.tycho/targetPlatforms/nightly.target b/releng/org.eclipse.ocl.releng.tycho/targetPlatforms/nightly.target
index 9110a46..e3e89be 100644
--- a/releng/org.eclipse.ocl.releng.tycho/targetPlatforms/nightly.target
+++ b/releng/org.eclipse.ocl.releng.tycho/targetPlatforms/nightly.target
@@ -12,18 +12,37 @@
     <repository location="https://download.eclipse.org/modeling/emf/emf/builds/milestone"/>
   </location>
   <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+    <unit id="org.eclipse.emf.transaction" version="0.0.0"/>
+    <!--repository location="https://download.eclipse.org/modeling/emf/validation/updates/interim"/-->
+    <repository location="https://download.eclipse.org/modeling/emf/transaction/updates/releases/R202208110935"/>
+  </location>
+  <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
     <unit id="org.eclipse.emf.validation" version="0.0.0"/>
     <repository location="https://download.eclipse.org/modeling/emf/validation/updates/releases/R202305230712"/>
   </location>
   <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+    <unit id="org.eclipse.draw2d" version="0.0.0"/>
+    <repository location="https://download.eclipse.org/tools/gef/classic/releases/latest"/>
+  </location>
+  <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+    <unit id="org.eclipse.gmf.runtime.notation.sdk.feature.group" version="0.0.0"/>
+    <!--repository location="https://download.eclipse.org/modeling/emf/validation/updates/interim"/-->
+    <repository location="https://download.eclipse.org/modeling/gmp/gmf-notation/updates/releases/R202211151334"/>
+  </location>
+  <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+    <unit id="org.eclipse.gmf.feature.group" version="0.0.0"/>
+    <!--repository location="https://download.eclipse.org/modeling/emf/validation/updates/interim"/-->
+    <repository location="https://download.eclipse.org/modeling/gmp/gmf-runtime/updates/releases/R202311130907"/>
+  </location>
+  <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
     <unit id="org.eclipse.uml2.sdk.feature.group" version="0.0.0"/>
     <!--repository location="https://download.eclipse.org/modeling/mdt/uml2/updates/interim/latest"/-->
     <repository location="https://download.eclipse.org/modeling/mdt/uml2/updates/milestones/latest"/>
     <repository location="https://download.eclipse.org/modeling/mdt/uml2/updates/releases/latest"/>
   </location>
   <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
-    <unit id="org.eclipse.draw2d" version="0.0.0"/>
-    <repository location="https://download.eclipse.org/tools/gef/classic/releases/latest"/>
+    <unit id="org.eclipse.sirius.runtime.feature.group" version="0.0.0"/>
+    <repository location="https://download.eclipse.org/sirius/updates/releases/7.3.0/2023-03"/>
   </location>
   <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
     <unit id="org.eclipse.xtend.sdk.feature.group" version="0.0.0"/>
diff --git a/releng/org.eclipse.ocl.releng.tycho/targetPlatforms/stable.target b/releng/org.eclipse.ocl.releng.tycho/targetPlatforms/stable.target
index 4aec752..3024320 100644
--- a/releng/org.eclipse.ocl.releng.tycho/targetPlatforms/stable.target
+++ b/releng/org.eclipse.ocl.releng.tycho/targetPlatforms/stable.target
@@ -6,6 +6,7 @@
     <unit id="org.eclipse.emf.sdk.feature.group" version="0.0.0"/>
     <unit id="org.eclipse.uml2.sdk.feature.group" version="0.0.0"/>
     <unit id="org.eclipse.xtext.sdk.feature.group" version="0.0.0"/>
+    <unit id="org.eclipse.sirius.specifier.feature.group" version="0.0.0"/>
     <repository location="https://download.eclipse.org/releases/latest"/>
     <repository location="https://download.eclipse.org/modeling/emf/emf/builds/milestone"/>
     <repository location="https://download.eclipse.org/modeling/mdt/uml2/updates/milestones"/>