aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDawid Pakuła2018-05-31 15:13:59 -0400
committerDawid Pakuła2018-05-31 15:13:59 -0400
commit0547a8fa04fa2ed1c1a36645efa5c95d53d59764 (patch)
tree9a76a669257943cf72d49a61efc2f578b916cdfe
parente2885431d6767250689abdc9b35f4c5e02f450fc (diff)
downloadorg.eclipse.pdt-0547a8fa04fa2ed1c1a36645efa5c95d53d59764.zip
org.eclipse.pdt-0547a8fa04fa2ed1c1a36645efa5c95d53d59764.tar.gz
org.eclipse.pdt-0547a8fa04fa2ed1c1a36645efa5c95d53d59764.tar.xz
Bug 535402 - Deadlock during project creation
Signed-off-by: Dawid Pakuła <zulus@w3des.net>
-rw-r--r--plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/facet/PHPFacets.java12
-rw-r--r--plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/wizards/PHPProjectCreationWizard.java44
2 files changed, 31 insertions, 25 deletions
diff --git a/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/facet/PHPFacets.java b/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/facet/PHPFacets.java
index fcff140..42fb116 100644
--- a/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/facet/PHPFacets.java
+++ b/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/facet/PHPFacets.java
@@ -54,8 +54,8 @@ public class PHPFacets {
}
/**
- * Returns true if the given project is a faceted project and the php core facet
- * is installed
+ * Returns true if the given project is a faceted project and the php core
+ * facet is installed
*
* @param project
* the project
@@ -178,8 +178,12 @@ public class PHPFacets {
facetedProject.setFixedProjectFacets(fixedFacets);
// install the fixed facets
- facetedProject.installProjectFacet(coreFacet.getDefaultVersion(), null, monitor);
- facetedProject.installProjectFacet(convertToFacetVersion(phpVersion), null, monitor);
+ if (!facetedProject.hasProjectFacet(coreFacet.getDefaultVersion())) {
+ facetedProject.installProjectFacet(coreFacet.getDefaultVersion(), null, monitor);
+ }
+ if (!facetedProject.hasProjectFacet(phpFacet)) {
+ facetedProject.installProjectFacet(convertToFacetVersion(phpVersion), null, monitor);
+ }
}
/**
diff --git a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/wizards/PHPProjectCreationWizard.java b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/wizards/PHPProjectCreationWizard.java
index aeb7464..4c26aa4 100644
--- a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/wizards/PHPProjectCreationWizard.java
+++ b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/wizards/PHPProjectCreationWizard.java
@@ -84,26 +84,17 @@ public class PHPProjectCreationWizard extends NewElementWizard implements INewWi
@Override
protected void finishPage(IProgressMonitor monitor) throws InterruptedException, CoreException {
- if (fFirstPage != null) {
- fFirstPage.performFinish(monitor); // use the full progress monitor
- }
- if (fSecondPage != null) {
- fSecondPage.performFinish(monitor); // use the full progress monitor
- }
- if (fThirdPage != null) {
- fThirdPage.performFinish(monitor); // use the full progress monitor
- }
- }
-
- @Override
- public boolean performFinish() {
- boolean res = super.performFinish();
- if (res) {
- if (updatePerspective()) {
- BasicNewProjectResourceWizard.updatePerspective(fConfigElement);
+ try {
+ fFirstPage.performFinish(monitor); // use the full progress
+ // monitor
+ if (fSecondPage != null) {
+ fSecondPage.performFinish(monitor);
}
- selectAndReveal(fLastPage.getScriptProject().getProject());
-
+ if (fThirdPage != null) {
+ fThirdPage.performFinish(monitor); // use the full
+ // progress monitor
+ }
+ } finally {
IProject project = fLastPage.getScriptProject().getProject();
PHPVersion version = fFirstPage.getPHPVersionValue();
if (version == null) {
@@ -114,6 +105,17 @@ public class PHPProjectCreationWizard extends NewElementWizard implements INewWi
} catch (CoreException ex) {
PHPCorePlugin.log(ex);
}
+ }
+ }
+
+ @Override
+ public boolean performFinish() {
+ boolean res = super.performFinish();
+ if (res) {
+ if (updatePerspective()) {
+ BasicNewProjectResourceWizard.updatePerspective(fConfigElement);
+ }
+ selectAndReveal(fLastPage.getScriptProject().getProject());
WizardModel model = fFirstPage.getWizardData();
@@ -144,8 +146,8 @@ public class PHPProjectCreationWizard extends NewElementWizard implements INewWi
}
/*
- * Stores the configuration element for the wizard. The config element will be
- * used in <code>performFinish</code> to set the result perspective.
+ * Stores the configuration element for the wizard. The config element will
+ * be used in <code>performFinish</code> to set the result perspective.
*/
@Override
public void setInitializationData(IConfigurationElement cfig, String propertyName, Object data) {