Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2016-07-06 08:23:07 -0400
committerChristian W. Damus2016-07-06 08:25:49 -0400
commitcfc4d531b1d9c6d2d3510c1562bf8760b39b8788 (patch)
treeab37ae0e38d0ad23c6a5d8b890111c907fa728c3
parente5f04ece6847a5edb2fe4347c8bd4347b7c6aab7 (diff)
downloadorg.eclipse.papyrus-cfc4d531b1d9c6d2d3510c1562bf8760b39b8788.tar.gz
org.eclipse.papyrus-cfc4d531b1d9c6d2d3510c1562bf8760b39b8788.tar.xz
org.eclipse.papyrus-cfc4d531b1d9c6d2d3510c1562bf8760b39b8788.zip
Bug 497379: Validation deadlocks when proxy resolution loads other resources
https://bugs.eclipse.org/bugs/show_bug.cgi?id=497379 (cherry-picked from streams/2.0-maintenance) Wrap the validation operation in a privileged runnable to fork it with the current transaction. Change-Id: I72cdcfb06eab4f8cbc70346f72cde132d1797de7
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.validation/META-INF/MANIFEST.MF2
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.validation/pom.xml2
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/commands/AbstractValidateCommand.java11
3 files changed, 11 insertions, 4 deletions
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/META-INF/MANIFEST.MF b/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/META-INF/MANIFEST.MF
index 7c8a6253e5e..a7ad5c3e848 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/META-INF/MANIFEST.MF
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/META-INF/MANIFEST.MF
@@ -12,7 +12,7 @@ Require-Bundle: org.eclipse.gmf.runtime.emf.commands.core;bundle-version="[1.7.0
org.eclipse.papyrus.infra.ui;bundle-version="[1.2.0,2.0.0)"
Bundle-Vendor: %pluginProvider
Bundle-ActivationPolicy: lazy
-Bundle-Version: 2.0.0.qualifier
+Bundle-Version: 2.0.1.qualifier
Bundle-Localization: plugin
Bundle-Name: %pluginName
Bundle-Activator: org.eclipse.papyrus.infra.services.validation.Activator
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/pom.xml b/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/pom.xml
index ad87c4f2dc3..873d1498647 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/pom.xml
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/pom.xml
@@ -7,6 +7,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.infra.services.validation</artifactId>
- <version>2.0.0-SNAPSHOT</version>
+ <version>2.0.1-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/commands/AbstractValidateCommand.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/commands/AbstractValidateCommand.java
index e027ba2866c..d61fae239fe 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/commands/AbstractValidateCommand.java
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/commands/AbstractValidateCommand.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2010, 2014 CEA LIST and others.
+ * Copyright (c) 2010, 2016 CEA LIST, Christian W. Damus, and others.
*
*
* All rights reserved. This program and the accompanying materials
@@ -12,10 +12,13 @@
* Christian W. Damus (CEA) - refactor for non-workspace abstraction of problem markers (CDO)
* Patrick Tessier (CEA LIST) refacor to add allowing adding validation specific to UML
* Christian W. Damus (CEA) - bug 432813
+ * Christian W. Damus - bug 497379
*
*****************************************************************************/
package org.eclipse.papyrus.infra.services.validation.commands;
+import static org.eclipse.papyrus.infra.ui.util.TransactionUIHelper.createPrivilegedRunnableWithProgress;
+
import java.lang.reflect.InvocationTargetException;
import java.util.Collections;
import java.util.Iterator;
@@ -154,7 +157,10 @@ abstract public class AbstractValidateCommand extends AbstractTransactionalComma
// runs the operation, and shows progress.
try {
if (showUIfeedback) {
- new ProgressMonitorDialog(shell).run(true, true, runValidationWithProgress);
+ // Share our current transaction with the modal context
+ IRunnableWithProgress privileged = createPrivilegedRunnableWithProgress(
+ getEditingDomain(), runValidationWithProgress);
+ new ProgressMonitorDialog(shell).run(true, true, privileged);
} else {
runValidationWithProgress.run(new NullProgressMonitor());
}
@@ -185,6 +191,7 @@ abstract public class AbstractValidateCommand extends AbstractTransactionalComma
// don't fork this dialog, i.e. run it in the UI thread. This avoids that the diagrams are constantly refreshing *while*
// markers/decorations are changing. This greatly enhances update performance. See also bug 400593
if (showUIfeedback) {
+ // Running in the same thread, we don't have to share the transaction
new ProgressMonitorDialog(shell).run(false, true, createMarkersWithProgress);
} else {
createMarkersWithProgress.run(new NullProgressMonitor());

Back to the top