[568572] Fix invalid representation status computation

If the diagram URI prefix indicates that the representation is stored in
an aird, it does not necessarily imply that "if the representation
exists then it would be yet loaded then we can rely on
isLoadedRepresentation". Indeed, if the representation has been moved
from a resource to another it may not be loaded yet and it is though
reachable.

Bug: 568572
Change-Id: I8acfd22698b99b556a74393a3912df95b5fd5608
Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/query/DRepresentationDescriptorQuery.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/query/DRepresentationDescriptorQuery.java
index 6d6faed..e152a53 100644
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/query/DRepresentationDescriptorQuery.java
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/query/DRepresentationDescriptorQuery.java
@@ -106,7 +106,10 @@
             // the representation exists then it would be yet loaded then we can rely on isLoadedRepresentation.
             String extention = repDescriptor.getRepPath().getResourceURI().fileExtension();
             if (SiriusUtil.SESSION_RESOURCE_EXTENSION.equals(extention)) {
-                return isRepresentationReachable;
+                // need to call getRepresentation() and not rely only on isLoadedRepresentation() because, if the
+                // representation has been moved from a resource to another it may be seen as not loaded yet as it is
+                // though reachable.
+                return repDescriptor.getRepresentation() != null;
             }
             Resource eResource = repDescriptor.eResource();
             if (eResource != null) {