Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Hauge2013-05-31 18:53:41 +0000
committerNeil Hauge2013-05-31 18:54:42 +0000
commitc2d52733c07931591ca870a76b4fa14983c40a01 (patch)
tree78617a7f9ed2e24901c475798ee042280726c040
parent1f567bc4422fd6f98806222419875363968d6790 (diff)
downloadwebtools.dali-c2d52733c07931591ca870a76b4fa14983c40a01.tar.gz
webtools.dali-c2d52733c07931591ca870a76b4fa14983c40a01.tar.xz
webtools.dali-c2d52733c07931591ca870a76b4fa14983c40a01.zip
405320 - Temporary fix for intermittent failure on JPA project creation
when starting Eclipse.
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/AbstractJpaProject.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/AbstractJpaProject.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/AbstractJpaProject.java
index 5c9e3273b1..89386aa169 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/AbstractJpaProject.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/AbstractJpaProject.java
@@ -30,6 +30,7 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
@@ -609,9 +610,17 @@ public abstract class AbstractJpaProject
}
protected ProjectResourceLocator getProjectResourceLocator() {
- return (ProjectResourceLocator) this.project.getAdapter(ProjectResourceLocator.class);
+ Object resourceLocator = this.project.getAdapter(ProjectResourceLocator.class);
+ //Hack fix to ensure the adatper can be successfully loaded as there are currently problems in the platform
+ //in this area. See bugs 405320 and 408506. This fix is essentially a delay mechanism but appears to
+ //fully resolve the issue. This temp fix should be removed when bug 408506 is fixed in the platform.
+ if (resourceLocator == null) {
+ resourceLocator = Platform.getAdapterManager().loadAdapter(this.project, ProjectResourceLocator.class.getName());
+ }
+ return (ProjectResourceLocator) resourceLocator;
}
+
/**
* Log any developer exceptions and don't build a JPA file rather
* than completely failing to build the JPA Project.

Back to the top