Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraradermache2023-10-20 15:09:24 +0000
committeraradermache2023-10-20 15:09:24 +0000
commit164ff7a90bc0e19c92f7edc25f6439c63cc560e5 (patch)
tree7dde6220e9e23551cbff3436fee360e862945dcb
parentfbc75752c3d5e3859c54085bd169ec6dfe10c79f (diff)
downloadorg.eclipse.papyrus-designer-164ff7a90bc0e19c92f7edc25f6439c63cc560e5.tar.gz
org.eclipse.papyrus-designer-164ff7a90bc0e19c92f7edc25f6439c63cc560e5.tar.xz
org.eclipse.papyrus-designer-164ff7a90bc0e19c92f7edc25f6439c63cc560e5.zip
Bug 534666 - [Designer] Invalid.thread access and use of Display.getCurrent()
- Revert use of UI thread Change-Id: I6be57a72232f10a27a49f8f2303ad6e39932bb60 Signed-off-by: aradermache <ansgar.radermacher@cea.fr>
-rw-r--r--plugins/uml/org.eclipse.papyrus.designer.uml.tools.utils/src/org/eclipse/papyrus/designer/uml/tools/utils/ElementUtils.java15
1 files changed, 2 insertions, 13 deletions
diff --git a/plugins/uml/org.eclipse.papyrus.designer.uml.tools.utils/src/org/eclipse/papyrus/designer/uml/tools/utils/ElementUtils.java b/plugins/uml/org.eclipse.papyrus.designer.uml.tools.utils/src/org/eclipse/papyrus/designer/uml/tools/utils/ElementUtils.java
index 3e4041e54..4f65e9d46 100644
--- a/plugins/uml/org.eclipse.papyrus.designer.uml.tools.utils/src/org/eclipse/papyrus/designer/uml/tools/utils/ElementUtils.java
+++ b/plugins/uml/org.eclipse.papyrus.designer.uml.tools.utils/src/org/eclipse/papyrus/designer/uml/tools/utils/ElementUtils.java
@@ -29,7 +29,6 @@ import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.xmi.XMLResource;
import org.eclipse.papyrus.designer.infra.base.StringConstants;
import org.eclipse.papyrus.designer.infra.base.StringUtils;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.uml2.uml.Class;
import org.eclipse.uml2.uml.Classifier;
import org.eclipse.uml2.uml.Dependency;
@@ -193,7 +192,8 @@ public class ElementUtils {
/**
* Provide a wrapper for the packageUtil functionality.
- * The loading is done in the UI thread (see bug 572601) in case of a Papyrus model-set
+ * The loading was done in the UI thread (see bug 572601), but this is no
+ * longer needed, the code is therefore just forwarding to PackageUtil
*
* @param uri
* the URI of the resource to load
@@ -202,17 +202,6 @@ public class ElementUtils {
* @return the contained package, or null, if not found
*/
public static Package loadPackage(URI uri, ResourceSet set) {
- // load if and not yet loaded
- if (set.getResource(uri, false) == null) {
- // execute in UI thread
- Display.getDefault().syncExec(new Runnable() {
- @Override
- public void run() {
- set.getResource(uri, true);
- }
- });
- // resource is now already loaded, invocation of PackageUtil is now safe
- }
return PackageUtil.loadPackage(uri, set);
}

Back to the top